lol
1{ buildPackages, pkgs, newScope, stdenv }:
2
3let
4 # These are attributes in compiler and packages that don't support integer-simple.
5 integerSimpleExcludes = [
6 "ghc865Binary"
7 "ghc8102Binary"
8 "ghc8102BinaryMinimal"
9 "ghc8107Binary"
10 "ghc8107BinaryMinimal"
11 "ghcjs"
12 "ghcjs810"
13 "integer-simple"
14 "native-bignum"
15 "ghcHEAD"
16 ];
17
18 nativeBignumIncludes = [
19 "ghcHEAD"
20 ];
21
22 haskellLibUncomposable = import ../development/haskell-modules/lib.nix {
23 inherit (pkgs) lib;
24 inherit pkgs;
25 };
26
27 callPackage = newScope {
28 haskellLib = haskellLibUncomposable.compose;
29 overrides = pkgs.haskell.packageOverrides;
30 };
31
32 bootstrapPackageSet = self: super: {
33 mkDerivation = drv: super.mkDerivation (drv // {
34 doCheck = false;
35 doHaddock = false;
36 enableExecutableProfiling = false;
37 enableLibraryProfiling = false;
38 enableSharedExecutables = false;
39 enableSharedLibraries = false;
40 });
41 };
42
43 # Use this rather than `rec { ... }` below for sake of overlays.
44 inherit (pkgs.haskell) compiler packages;
45
46in {
47 lib = haskellLibUncomposable;
48
49 package-list = callPackage ../development/haskell-modules/package-list.nix {};
50
51 compiler = {
52
53 ghc865Binary = callPackage ../development/compilers/ghc/8.6.5-binary.nix { };
54
55 ghc8102Binary = callPackage ../development/compilers/ghc/8.10.2-binary.nix {
56 llvmPackages = pkgs.llvmPackages_9;
57 };
58
59 ghc8102BinaryMinimal = callPackage ../development/compilers/ghc/8.10.2-binary.nix {
60 llvmPackages = pkgs.llvmPackages_9;
61 minimal = true;
62 };
63
64 ghc8107Binary = callPackage ../development/compilers/ghc/8.10.7-binary.nix {
65 llvmPackages = pkgs.llvmPackages_11;
66 };
67
68 ghc8107BinaryMinimal = callPackage ../development/compilers/ghc/8.10.7-binary.nix {
69 llvmPackages = pkgs.llvmPackages_11;
70 minimal = true;
71 };
72
73 ghc884 = callPackage ../development/compilers/ghc/8.8.4.nix {
74 bootPkgs =
75 # aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar
76 # Musl bindists do not exist for ghc 8.6.5, so we use 8.10.* for them
77 if stdenv.isAarch64 || stdenv.hostPlatform.isMusl then
78 packages.ghc8102BinaryMinimal
79 else
80 packages.ghc865Binary;
81 inherit (buildPackages.python3Packages) sphinx;
82 buildLlvmPackages = buildPackages.llvmPackages_7;
83 llvmPackages = pkgs.llvmPackages_7;
84 };
85 ghc8107 = callPackage ../development/compilers/ghc/8.10.7.nix {
86 bootPkgs =
87 # aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar
88 # the oldest ghc with aarch64-darwin support is 8.10.5
89 # Musl bindists do not exist for ghc 8.6.5, so we use 8.10.* for them
90 if stdenv.isAarch64 || stdenv.isAarch32 then
91 packages.ghc8107BinaryMinimal
92 else
93 packages.ghc8107Binary;
94 inherit (buildPackages.python3Packages) sphinx;
95 # Need to use apple's patched xattr until
96 # https://github.com/xattr/xattr/issues/44 and
97 # https://github.com/xattr/xattr/issues/55 are solved.
98 inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
99 buildLlvmPackages = buildPackages.llvmPackages_9;
100 llvmPackages = pkgs.llvmPackages_9;
101 };
102 ghc901 = callPackage ../development/compilers/ghc/9.0.1.nix {
103 bootPkgs =
104 # aarch64 ghc8107Binary exceeds max output size on hydra
105 # the oldest ghc with aarch64-darwin support is 8.10.5
106 if stdenv.isAarch64 || stdenv.isAarch32 then
107 packages.ghc8107BinaryMinimal
108 else
109 packages.ghc8107Binary;
110 inherit (buildPackages.python3Packages) sphinx;
111 inherit (buildPackages.darwin) autoSignDarwinBinariesHook;
112 buildLlvmPackages = buildPackages.llvmPackages_10;
113 llvmPackages = pkgs.llvmPackages_10;
114 };
115 ghc921 = callPackage ../development/compilers/ghc/9.2.1.nix {
116 bootPkgs =
117 # aarch64 ghc8107Binary exceeds max output size on hydra
118 if stdenv.isAarch64 || stdenv.isAarch32 then
119 packages.ghc8107BinaryMinimal
120 else
121 packages.ghc8107Binary;
122 inherit (buildPackages.python3Packages) sphinx;
123 # Need to use apple's patched xattr until
124 # https://github.com/xattr/xattr/issues/44 and
125 # https://github.com/xattr/xattr/issues/55 are solved.
126 inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
127 buildLlvmPackages = buildPackages.llvmPackages_10;
128 llvmPackages = pkgs.llvmPackages_10;
129 };
130 ghcHEAD = callPackage ../development/compilers/ghc/head.nix {
131 bootPkgs = packages.ghc8107Binary;
132 inherit (buildPackages.python3Packages) sphinx;
133 # Need to use apple's patched xattr until
134 # https://github.com/xattr/xattr/issues/44 and
135 # https://github.com/xattr/xattr/issues/55 are solved.
136 inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
137 buildLlvmPackages = buildPackages.llvmPackages_10;
138 llvmPackages = pkgs.llvmPackages_10;
139 libffi = pkgs.libffi;
140 };
141
142 ghcjs = compiler.ghcjs810;
143 ghcjs810 = callPackage ../development/compilers/ghcjs/8.10 {
144 bootPkgs = packages.ghc8107;
145 ghcjsSrcJson = ../development/compilers/ghcjs/8.10/git.json;
146 stage0 = ../development/compilers/ghcjs/8.10/stage0.nix;
147 };
148
149 # The integer-simple attribute set contains all the GHC compilers
150 # build with integer-simple instead of integer-gmp.
151 integer-simple = let
152 integerSimpleGhcNames = pkgs.lib.filter
153 (name: ! builtins.elem name integerSimpleExcludes)
154 (pkgs.lib.attrNames compiler);
155 in pkgs.recurseIntoAttrs (pkgs.lib.genAttrs
156 integerSimpleGhcNames
157 (name: compiler.${name}.override { enableIntegerSimple = true; }));
158
159 # Starting from GHC 9, integer-{simple,gmp} is replaced by ghc-bignum
160 # with "native" and "gmp" backends.
161 native-bignum = let
162 nativeBignumGhcNames = pkgs.lib.filter
163 (name: builtins.elem name nativeBignumIncludes)
164 (pkgs.lib.attrNames compiler);
165 in pkgs.recurseIntoAttrs (pkgs.lib.genAttrs
166 nativeBignumGhcNames
167 (name: compiler.${name}.override { enableNativeBignum = true; }));
168 };
169
170 # Default overrides that are applied to all package sets.
171 packageOverrides = self : super : {};
172
173 # Always get compilers from `buildPackages`
174 packages = let bh = buildPackages.haskell; in {
175
176 ghc865Binary = callPackage ../development/haskell-modules {
177 buildHaskellPackages = bh.packages.ghc865Binary;
178 ghc = bh.compiler.ghc865Binary;
179 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.6.x.nix { };
180 packageSetConfig = bootstrapPackageSet;
181 };
182 ghc8102Binary = callPackage ../development/haskell-modules {
183 buildHaskellPackages = bh.packages.ghc8102Binary;
184 ghc = bh.compiler.ghc8102Binary;
185 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
186 packageSetConfig = bootstrapPackageSet;
187 };
188 ghc8102BinaryMinimal = callPackage ../development/haskell-modules {
189 buildHaskellPackages = bh.packages.ghc8102BinaryMinimal;
190 ghc = bh.compiler.ghc8102BinaryMinimal;
191 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
192 packageSetConfig = bootstrapPackageSet;
193 };
194 ghc8107Binary = callPackage ../development/haskell-modules {
195 buildHaskellPackages = bh.packages.ghc8107Binary;
196 ghc = bh.compiler.ghc8107Binary;
197 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
198 packageSetConfig = bootstrapPackageSet;
199 };
200 ghc8107BinaryMinimal = callPackage ../development/haskell-modules {
201 buildHaskellPackages = bh.packages.ghc8107BinaryMinimal;
202 ghc = bh.compiler.ghc8107BinaryMinimal;
203 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
204 packageSetConfig = bootstrapPackageSet;
205 };
206 ghc884 = callPackage ../development/haskell-modules {
207 buildHaskellPackages = bh.packages.ghc884;
208 ghc = bh.compiler.ghc884;
209 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.8.x.nix { };
210 };
211 ghc8107 = callPackage ../development/haskell-modules {
212 buildHaskellPackages = bh.packages.ghc8107;
213 ghc = bh.compiler.ghc8107;
214 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
215 };
216 ghc901 = callPackage ../development/haskell-modules {
217 buildHaskellPackages = bh.packages.ghc901;
218 ghc = bh.compiler.ghc901;
219 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.0.x.nix { };
220 };
221 ghc921 = callPackage ../development/haskell-modules {
222 buildHaskellPackages = bh.packages.ghc921;
223 ghc = bh.compiler.ghc921;
224 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.2.x.nix { };
225 };
226 ghcHEAD = callPackage ../development/haskell-modules {
227 buildHaskellPackages = bh.packages.ghcHEAD;
228 ghc = bh.compiler.ghcHEAD;
229 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { };
230 };
231
232 ghcjs = packages.ghcjs810;
233 ghcjs810 = callPackage ../development/haskell-modules rec {
234 buildHaskellPackages = ghc.bootPkgs;
235 ghc = bh.compiler.ghcjs810;
236 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
237 packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { };
238 };
239
240 # The integer-simple attribute set contains package sets for all the GHC compilers
241 # using integer-simple instead of integer-gmp.
242 integer-simple = let
243 integerSimpleGhcNames = pkgs.lib.filter
244 (name: ! builtins.elem name integerSimpleExcludes)
245 (pkgs.lib.attrNames packages);
246 in pkgs.lib.genAttrs integerSimpleGhcNames (name: packages.${name}.override {
247 ghc = bh.compiler.integer-simple.${name};
248 buildHaskellPackages = bh.packages.integer-simple.${name};
249 overrides = _self : _super : {
250 integer-simple = null;
251 integer-gmp = null;
252 };
253 });
254
255 native-bignum = let
256 nativeBignumGhcNames = pkgs.lib.filter
257 (name: builtins.elem name nativeBignumIncludes)
258 (pkgs.lib.attrNames compiler);
259 in pkgs.lib.genAttrs nativeBignumGhcNames (name: packages.${name}.override {
260 ghc = bh.compiler.native-bignum.${name};
261 buildHaskellPackages = bh.packages.native-bignum.${name};
262 overrides = _self : _super : {
263 integer-gmp = null;
264 };
265 });
266 };
267}