|
33 | 33 | # When changing this, also change the default version of Cabal declared below |
34 | 34 | compiler ? "ghc843", |
35 | 35 |
|
| 36 | + defaultCabalPackageVersionComingWithGhc ? "Cabal_2_2_0_1", |
| 37 | + |
36 | 38 | normalHaskellPackages ? |
37 | 39 | if integer-simple |
38 | 40 | # Note we don't have to set the `-finteger-simple` flag for packages that GHC |
|
242 | 244 | extraPrefix = ""; |
243 | 245 | }; |
244 | 246 |
|
245 | | - applyPatchesToCabalDrv = cabalDrv: builtins.trace "cabalDrv: ${builtins.toJSON cabalDrv}" pkgs.haskell.lib.overrideCabal cabalDrv (old: { |
| 247 | + applyPatchesToCabalDrv = cabalDrv: pkgs.haskell.lib.overrideCabal cabalDrv (old: { |
246 | 248 | patches = |
247 | 249 | # Patches we know are merged in a certain cabal version |
248 | 250 | # (we include them conditionally here anyway, for the case |
|
306 | 308 | let |
307 | 309 | patchIfCabal = drv: |
308 | 310 | if (drv.pname or "") == "Cabal" # the `ghc` package has not `pname` attribute, so we default to "" here |
309 | | - then builtins.trace "calling cabalDrv: ${builtins.toJSON drv}" applyPatchesToCabalDrv drv |
| 311 | + then applyPatchesToCabalDrv drv |
310 | 312 | else drv; |
311 | 313 | patchCabalInPackageList = drvs: |
312 | 314 | let |
|
434 | 436 | in { |
435 | 437 |
|
436 | 438 | Cabal = |
437 | | - if builtins.isNull super.Cabal # if null, Cabal is a non-overriden package coming with GHC |
438 | | - then builtins.trace "calling cabalDrv2: ${builtins.toJSON pkgs.haskell.packages."${compiler}".Cabal_2_2_0_1} ${toString (builtins.attrNames pkgs.haskell.packages."${compiler}".Cabal_2_2_0_1)}" applyPatchesToCabalDrv pkgs.haskell.packages."${compiler}".Cabal_2_2_0_1 |
439 | | - else builtins.trace "calling cabalDrv: ${builtins.toJSON super.Cabal}" applyPatchesToCabalDrv super.Cabal; |
| 439 | + # If null, super.Cabal is a non-overriden package coming with GHC. |
| 440 | + # In that case, we can't patch it (we can't add patches to derivations that are null). |
| 441 | + # So we need to instead add a not-with-GHC Cabal package and patch that. |
| 442 | + # The best choice for that is the version that comes with the GHC. |
| 443 | + # Unfortunately we can't query that easily, so we maintain that manually |
| 444 | + # in `defaultCabalPackageVersionComingWithGhc`. |
| 445 | + # That effort will go away once all our Cabal patches are upstreamed. |
| 446 | + if builtins.isNull super.Cabal |
| 447 | + then applyPatchesToCabalDrv pkgs.haskell.packages."${compiler}"."${defaultCabalPackageVersionComingWithGhc}" |
| 448 | + else applyPatchesToCabalDrv super.Cabal; |
440 | 449 |
|
441 | 450 | # Helpers for other packages |
442 | 451 |
|
|
451 | 460 | # It's not clear if it's safe to disable this as key functionality may be broken |
452 | 461 | hslua = dontCheck super.hslua; |
453 | 462 |
|
454 | | - hsyslog = useFixedCabal super.hsyslog; |
455 | | - |
456 | | - # Without this, when compiling `hsyslog`, GHC sees 2 Cabal |
457 | | - # libraries, the unfixed one provided by cabal-doctest |
458 | | - # (which is GHC's global unfixed one), and the fixed one as declared |
459 | | - # for `hsyslog` through statify. |
460 | | - # GHC does NOT issue a warning in that case, but just silently |
461 | | - # picks the one from the global package database (the one |
462 | | - # cabal-doctest would want), instead of the one from our |
463 | | - # `useFixedCabal` one which is given on the command line at |
464 | | - # https://github.com/NixOS/nixpkgs/blob/e7e5aaa0b9/pkgs/development/haskell-modules/generic-builder.nix#L330 |
465 | | - cabal-doctest = useFixedCabal super.cabal-doctest; |
466 | | - |
467 | 463 | darcs = |
468 | 464 | addStaticLinkerFlagsWithPkgconfig |
469 | 465 | (super.darcs.override { curl = curl_static; }) |
|
640 | 636 |
|
641 | 637 | }); |
642 | 638 |
|
| 639 | + # We have to use `useFixedCabal` here, and cannot just rely on the |
| 640 | + # "Cabal = ..." we override up in `haskellPackagesWithLibsReadyForStaticLinking`, |
| 641 | + # because that `Cabal` isn't used in all packages: |
| 642 | + # If a package doesn't explicitly depend on the `Cabal` package, then |
| 643 | + # for compiling its `Setup.hs` the Cabal package that comes with GHC |
| 644 | + # (that is in the default GHC package DB) is used instead, which |
| 645 | + # obviously doesn' thave our patches. |
643 | 646 | statify = drv: with pkgs.haskell.lib; pkgs.lib.foldl appendConfigureFlag (disableLibraryProfiling (disableSharedExecutables (useFixedCabal drv))) [ |
644 | 647 | # "--ghc-option=-fPIC" |
645 | 648 | "--enable-executable-static" # requires `useFixedCabal` |
|
703 | 706 | allStackageExecutables = |
704 | 707 | lib.filterAttrs (name: x: isStackageExecutable name) haskellPackages; |
705 | 708 |
|
| 709 | + workingStackageExecutables = |
| 710 | + builtins.removeAttrs allStackageExecutables [ |
| 711 | + # List of executables that don't work for reasons not yet investigated. |
| 712 | + # When changing this file, we should always check if this list grows or shrinks. |
| 713 | + "Agda" |
| 714 | + "Allure" |
| 715 | + "ALUT" |
| 716 | + "clash-ghc" |
| 717 | + "credential-store" |
| 718 | + "csg" |
| 719 | + "debug" |
| 720 | + "diagrams-builder" |
| 721 | + "dotenv" |
| 722 | + "ersatz" |
| 723 | + "filter-logger" |
| 724 | + "gtk3" |
| 725 | + "hamilton" |
| 726 | + "haskell-gi" |
| 727 | + "hquantlib" |
| 728 | + "ihaskell" |
| 729 | + "ipython-kernel" |
| 730 | + "jack" |
| 731 | + "LambdaHack" |
| 732 | + "language-puppet" |
| 733 | + "learn-physics" |
| 734 | + "lens-regex" |
| 735 | + "leveldb-haskell" |
| 736 | + "microformats2-parser" |
| 737 | + "mmark-cli" |
| 738 | + "odbc" |
| 739 | + "OpenAL" |
| 740 | + "rasterific-svg" |
| 741 | + "sdl2" |
| 742 | + "sdl2-gfx" |
| 743 | + "sdl2-image" |
| 744 | + "sdl2-mixer" |
| 745 | + "sdl2-ttf" |
| 746 | + "soxlib" |
| 747 | + "yesod-paginator" |
| 748 | + "yoga" |
| 749 | + "zeromq4-patterns" |
| 750 | + ]; |
706 | 751 |
|
707 | 752 | inherit normalPkgs; |
708 | 753 | inherit pkgs; |
|
0 commit comments