|
20 | 20 | hasPrefix (toString origSrc + toString dir) path;
|
21 | 21 | } + dir;
|
22 | 22 |
|
23 |
| - recRecurseIntoAttrs = with pkgs; pred: x: if pred x then recurseIntoAttrs (lib.mapAttrs (n: v: if n == "buildPackages" then v else recRecurseIntoAttrs pred v) x) else x; |
24 |
| - pkgSet = recRecurseIntoAttrs (x: with pkgs; lib.isAttrs x && !lib.isDerivation x) |
25 |
| - # we are only intersted in listing the project packages |
26 |
| - (pkgs.lib.filterAttrs (with pkgs.haskell-nix.haskellLib; (n: p: p != null && (isLocalPackage p && isProjectPackage p) || n == "shellFor")) |
27 |
| - # from our project which is based on a cabal project. |
28 |
| - (pkgs.haskell-nix.cabalProject { |
29 |
| - src = pkgs.haskell-nix.haskellLib.cleanGit { inherit src; }; |
30 |
| - ghc = pkgs.buildPackages.haskell-nix.compiler.${haskellCompiler}; |
31 |
| - modules = [ |
32 |
| - # Allow reinstallation of Win32 |
33 |
| - { nonReinstallablePkgs = |
34 |
| - [ "rts" "ghc-heap" "ghc-prim" "integer-gmp" "integer-simple" "base" |
35 |
| - "deepseq" "array" "ghc-boot-th" "pretty" "template-haskell" |
36 |
| - # ghcjs custom packages |
37 |
| - "ghcjs-prim" "ghcjs-th" |
38 |
| - "ghc-boot" |
39 |
| - "ghc" "array" "binary" "bytestring" "containers" |
40 |
| - "filepath" "ghc-boot" "ghc-compact" "ghc-prim" |
41 |
| - # "ghci" "haskeline" |
42 |
| - "hpc" |
43 |
| - "mtl" "parsec" "text" "transformers" |
44 |
| - "xhtml" |
45 |
| - # "stm" "terminfo" |
46 |
| - ]; |
47 |
| - } |
48 |
| - { |
49 |
| - # Packages we wish to ignore version bounds of. |
50 |
| - # This is similar to jailbreakCabal, however it |
51 |
| - # does not require any messing with cabal files. |
52 |
| - #doCheck = false; |
53 |
| - packages.katip.doExactConfig = true; |
54 |
| - packages.ekg.components.library.enableSeparateDataOutput = true; |
55 |
| - packages.cardano-node.configureFlags = [ "--ghc-option=-Werror" ]; |
56 |
| - packages.cardano-node.doCheck = true; |
57 |
| - packages.cardano-config.configureFlags = [ "--ghc-option=-Werror" ]; |
58 |
| - packages.cardano-config.doCheck = true; |
59 |
| - enableLibraryProfiling = profiling; |
60 |
| - } |
61 |
| - (pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isWindows { |
62 |
| - # Disable cabal-doctest tests by turning off custom setups |
63 |
| - packages.comonad.package.buildType = pkgs.lib.mkForce "Simple"; |
64 |
| - packages.distributive.package.buildType = pkgs.lib.mkForce "Simple"; |
65 |
| - packages.lens.package.buildType = pkgs.lib.mkForce "Simple"; |
66 |
| - packages.nonempty-vector.package.buildType = pkgs.lib.mkForce "Simple"; |
67 |
| - packages.semigroupoids.package.buildType = pkgs.lib.mkForce "Simple"; |
| 23 | + pkg-set = pkgs.haskell-nix.cabalProject { |
| 24 | + src = pkgs.haskell-nix.haskellLib.cleanGit { inherit src; }; |
| 25 | + ghc = pkgs.buildPackages.haskell-nix.compiler.${haskellCompiler}; |
| 26 | + modules = [ |
68 | 27 |
|
69 |
| - # Make sure we use a buildPackages version of happy |
70 |
| - packages.pretty-show.components.library.build-tools = [ pkgs.buildPackages.haskell-nix.haskellPackages.happy ]; |
| 28 | + # Allow reinstallation of Win32 |
| 29 | + { nonReinstallablePkgs = |
| 30 | + [ "rts" "ghc-heap" "ghc-prim" "integer-gmp" "integer-simple" "base" |
| 31 | + "deepseq" "array" "ghc-boot-th" "pretty" "template-haskell" |
| 32 | + # ghcjs custom packages |
| 33 | + "ghcjs-prim" "ghcjs-th" |
| 34 | + "ghc-boot" |
| 35 | + "ghc" "array" "binary" "bytestring" "containers" |
| 36 | + "filepath" "ghc-boot" "ghc-compact" "ghc-prim" |
| 37 | + # "ghci" "haskeline" |
| 38 | + "hpc" |
| 39 | + "mtl" "parsec" "text" "transformers" |
| 40 | + "xhtml" |
| 41 | + # "stm" "terminfo" |
| 42 | + ]; |
| 43 | + } |
| 44 | + { |
| 45 | + # Packages we wish to ignore version bounds of. |
| 46 | + # This is similar to jailbreakCabal, however it |
| 47 | + # does not require any messing with cabal files. |
| 48 | + packages.katip.doExactConfig = true; |
71 | 49 |
|
72 |
| - # Remove hsc2hs build-tool dependencies (suitable version will be available as part of the ghc derivation) |
73 |
| - packages.Win32.components.library.build-tools = pkgs.lib.mkForce []; |
74 |
| - packages.terminal-size.components.library.build-tools = pkgs.lib.mkForce []; |
75 |
| - packages.network.components.library.build-tools = pkgs.lib.mkForce []; |
76 |
| - }) |
77 |
| - ]; |
78 |
| - # TODO add flags to packages (like cs-ledger) so we can turn off tests that will |
79 |
| - # not build for windows on a per package bases (rather than using --disable-tests). |
80 |
| - configureArgs = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isWindows "--disable-tests"; |
81 |
| - })); |
82 |
| - in pkgSet |
| 50 | + # split data output for ekg to reduce closure size |
| 51 | + packages.ekg.components.library.enableSeparateDataOutput = true; |
| 52 | + packages.cardano-node.configureFlags = [ "--ghc-option=-Werror" ]; |
| 53 | + packages.cardano-config.configureFlags = [ "--ghc-option=-Werror" ]; |
| 54 | + enableLibraryProfiling = profiling; |
| 55 | + |
| 56 | + # some packages are missing identifier.name: |
| 57 | + packages.Win32.package.identifier.name = "Win32"; |
| 58 | + packages.file-embed-lzma.package.identifier.name = "file-embed-lzma"; |
| 59 | + packages.singletons.package.identifier.name = "singletons"; |
| 60 | + } |
| 61 | + (pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isWindows { |
| 62 | + # Disable cabal-doctest tests by turning off custom setups |
| 63 | + packages.comonad.package.buildType = pkgs.lib.mkForce "Simple"; |
| 64 | + packages.distributive.package.buildType = pkgs.lib.mkForce "Simple"; |
| 65 | + packages.lens.package.buildType = pkgs.lib.mkForce "Simple"; |
| 66 | + packages.nonempty-vector.package.buildType = pkgs.lib.mkForce "Simple"; |
| 67 | + packages.semigroupoids.package.buildType = pkgs.lib.mkForce "Simple"; |
| 68 | + |
| 69 | + # Make sure we use a buildPackages version of happy |
| 70 | + packages.pretty-show.components.library.build-tools = [ pkgs.buildPackages.haskell-nix.haskellPackages.happy ]; |
| 71 | + |
| 72 | + # Remove hsc2hs build-tool dependencies (suitable version will be available as part of the ghc derivation) |
| 73 | + packages.Win32.components.library.build-tools = pkgs.lib.mkForce []; |
| 74 | + packages.terminal-size.components.library.build-tools = pkgs.lib.mkForce []; |
| 75 | + packages.network.components.library.build-tools = pkgs.lib.mkForce []; |
| 76 | + }) |
| 77 | + ]; |
| 78 | + # TODO add flags to packages (like cs-ledger) so we can turn off tests that will |
| 79 | + # not build for windows on a per package bases (rather than using --disable-tests). |
| 80 | + configureArgs = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isWindows "--disable-tests"; |
| 81 | + }; |
| 82 | +in pkg-set |
0 commit comments