1 { buildPackages, pkgsBuildTarget, pkgs, newScope, stdenv }:
4 # These are attributes in compiler and packages that don't support integer-simple.
5 integerSimpleExcludes = [
10 "ghc8107BinaryMinimal"
26 nativeBignumIncludes = [
36 haskellLibUncomposable = import ../development/haskell-modules/lib {
41 callPackage = newScope {
42 haskellLib = haskellLibUncomposable.compose;
43 overrides = pkgs.haskell.packageOverrides;
46 bootstrapPackageSet = self: super: {
47 mkDerivation = drv: super.mkDerivation (drv // {
50 enableExecutableProfiling = false;
51 enableLibraryProfiling = false;
52 enableSharedExecutables = false;
53 enableSharedLibraries = false;
57 # Use this rather than `rec { ... }` below for sake of overlays.
58 inherit (pkgs.haskell) compiler packages;
61 lib = haskellLibUncomposable;
63 package-list = callPackage ../development/haskell-modules/package-list.nix {};
67 ghc865Binary = callPackage ../development/compilers/ghc/8.6.5-binary.nix {
68 llvmPackages = pkgs.llvmPackages_6;
71 ghc8102Binary = callPackage ../development/compilers/ghc/8.10.2-binary.nix {
72 llvmPackages = pkgs.llvmPackages_9;
75 ghc8102BinaryMinimal = callPackage ../development/compilers/ghc/8.10.2-binary.nix {
76 llvmPackages = pkgs.llvmPackages_9;
80 ghc8107Binary = callPackage ../development/compilers/ghc/8.10.7-binary.nix {
81 llvmPackages = pkgs.llvmPackages_12;
84 ghc8107BinaryMinimal = callPackage ../development/compilers/ghc/8.10.7-binary.nix {
85 llvmPackages = pkgs.llvmPackages_12;
89 ghc924Binary = callPackage ../development/compilers/ghc/9.2.4-binary.nix {
90 llvmPackages = pkgs.llvmPackages_12;
92 ghc924BinaryMinimal = callPackage ../development/compilers/ghc/9.2.4-binary.nix {
93 llvmPackages = pkgs.llvmPackages_12;
97 ghc884 = callPackage ../development/compilers/ghc/8.8.4.nix {
99 # aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar
100 # 8.10.2 is needed as using 8.10.7 is broken due to RTS-incompatibilities
101 if stdenv.isAarch64 then
102 packages.ghc8102BinaryMinimal
103 # Musl bindists do not exist for ghc 8.6.5, so we use 8.10.* for them
104 else if stdenv.hostPlatform.isMusl then
105 packages.ghc8102Binary
107 packages.ghc865Binary;
108 inherit (buildPackages.python3Packages) sphinx;
109 buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_7;
110 llvmPackages = pkgs.llvmPackages_7;
113 ghc8107 = callPackage ../development/compilers/ghc/8.10.7.nix {
115 # aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar
116 # the oldest ghc with aarch64-darwin support is 8.10.5
117 # Musl bindists do not exist for ghc 8.6.5, so we use 8.10.* for them
118 if stdenv.hostPlatform.isAarch then
119 packages.ghc8107BinaryMinimal
120 else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
121 # to my (@a-m-joseph) knowledge there are no newer official binaries for this platform
122 packages.ghc865Binary
124 packages.ghc8107Binary;
125 inherit (buildPackages.python3Packages) sphinx;
126 # Need to use apple's patched xattr until
127 # https://github.com/xattr/xattr/issues/44 and
128 # https://github.com/xattr/xattr/issues/55 are solved.
129 inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
130 buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_12;
131 llvmPackages = pkgs.llvmPackages_12;
134 ghc902 = callPackage ../development/compilers/ghc/9.0.2.nix {
136 # aarch64 ghc8107Binary exceeds max output size on hydra
137 # the oldest ghc with aarch64-darwin support is 8.10.5
138 if stdenv.hostPlatform.isAarch then
139 packages.ghc8107BinaryMinimal
140 else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
143 packages.ghc8107Binary;
144 inherit (buildPackages.python3Packages) sphinx;
145 inherit (buildPackages.darwin) autoSignDarwinBinariesHook xattr;
146 buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_12;
147 llvmPackages = pkgs.llvmPackages_12;
150 ghc924 = callPackage ../development/compilers/ghc/9.2.4.nix {
152 # aarch64 ghc8107Binary exceeds max output size on hydra
153 if stdenv.hostPlatform.isAarch then
154 packages.ghc8107BinaryMinimal
155 else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
158 packages.ghc8107Binary;
159 inherit (buildPackages.python3Packages) sphinx;
160 # Need to use apple's patched xattr until
161 # https://github.com/xattr/xattr/issues/44 and
162 # https://github.com/xattr/xattr/issues/55 are solved.
163 inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
164 buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_12;
165 llvmPackages = pkgs.llvmPackages_12;
168 ghc942 = callPackage ../development/compilers/ghc/9.4.2.nix {
170 # Building with 9.2 is broken due to
171 # https://gitlab.haskell.org/ghc/ghc/-/issues/21914
172 # Use 8.10 as a workaround where possible to keep bootstrap path short.
174 # On ARM text won't build with GHC 8.10.*
175 if stdenv.hostPlatform.isAarch then
176 # TODO(@sternenseemann): package bindist
178 # No suitable bindists for powerpc64le
179 else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
182 packages.ghc8107Binary;
183 inherit (buildPackages.python3Packages) sphinx;
184 # Need to use apple's patched xattr until
185 # https://github.com/xattr/xattr/issues/44 and
186 # https://github.com/xattr/xattr/issues/55 are solved.
187 inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
188 # Support range >= 10 && < 14
189 buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_12;
190 llvmPackages = pkgs.llvmPackages_12;
193 ghcHEAD = callPackage ../development/compilers/ghc/head.nix {
195 # For GHC 9.2.3 and 9.2.4 no armv7l bindists are available.
196 if stdenv.hostPlatform.isAarch32 then
198 else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
200 else if stdenv.isAarch64 then
201 packages.ghc924BinaryMinimal
203 packages.ghc924Binary;
204 inherit (buildPackages.python3Packages) sphinx;
205 # Need to use apple's patched xattr until
206 # https://github.com/xattr/xattr/issues/44 and
207 # https://github.com/xattr/xattr/issues/55 are solved.
208 inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
209 # 2022-08-04: Support range >= 10 && < 14
210 buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_12;
211 llvmPackages = pkgs.llvmPackages_12;
214 ghcjs = compiler.ghcjs810;
215 ghcjs810 = callPackage ../development/compilers/ghcjs/8.10 {
216 bootPkgs = packages.ghc810;
217 ghcjsSrcJson = ../development/compilers/ghcjs/8.10/git.json;
218 stage0 = ../development/compilers/ghcjs/8.10/stage0.nix;
221 # The integer-simple attribute set contains all the GHC compilers
222 # build with integer-simple instead of integer-gmp.
224 integerSimpleGhcNames = pkgs.lib.filter
225 (name: ! builtins.elem name integerSimpleExcludes)
226 (pkgs.lib.attrNames compiler);
227 in pkgs.recurseIntoAttrs (pkgs.lib.genAttrs
228 integerSimpleGhcNames
229 (name: compiler.${name}.override { enableIntegerSimple = true; }));
231 # Starting from GHC 9, integer-{simple,gmp} is replaced by ghc-bignum
232 # with "native" and "gmp" backends.
234 nativeBignumGhcNames = pkgs.lib.filter
235 (name: builtins.elem name nativeBignumIncludes)
236 (pkgs.lib.attrNames compiler);
237 in pkgs.recurseIntoAttrs (pkgs.lib.genAttrs
239 (name: compiler.${name}.override { enableNativeBignum = true; }));
242 # Default overrides that are applied to all package sets.
243 packageOverrides = self : super : {};
245 # Always get compilers from `buildPackages`
246 packages = let bh = buildPackages.haskell; in rec {
248 ghc865Binary = callPackage ../development/haskell-modules {
249 buildHaskellPackages = bh.packages.ghc865Binary;
250 ghc = bh.compiler.ghc865Binary;
251 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.6.x.nix { };
252 packageSetConfig = bootstrapPackageSet;
254 ghc8102Binary = callPackage ../development/haskell-modules {
255 buildHaskellPackages = bh.packages.ghc8102Binary;
256 ghc = bh.compiler.ghc8102Binary;
257 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
258 packageSetConfig = bootstrapPackageSet;
260 ghc8102BinaryMinimal = callPackage ../development/haskell-modules {
261 buildHaskellPackages = bh.packages.ghc8102BinaryMinimal;
262 ghc = bh.compiler.ghc8102BinaryMinimal;
263 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
264 packageSetConfig = bootstrapPackageSet;
266 ghc8107Binary = callPackage ../development/haskell-modules {
267 buildHaskellPackages = bh.packages.ghc8107Binary;
268 ghc = bh.compiler.ghc8107Binary;
269 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
270 packageSetConfig = bootstrapPackageSet;
272 ghc8107BinaryMinimal = callPackage ../development/haskell-modules {
273 buildHaskellPackages = bh.packages.ghc8107BinaryMinimal;
274 ghc = bh.compiler.ghc8107BinaryMinimal;
275 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
276 packageSetConfig = bootstrapPackageSet;
278 ghc924Binary = callPackage ../development/haskell-modules {
279 buildHaskellPackages = bh.packages.ghc924Binary;
280 ghc = bh.compiler.ghc924Binary;
281 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.2.x.nix { };
282 packageSetConfig = bootstrapPackageSet;
284 ghc924BinaryMinimal = callPackage ../development/haskell-modules {
285 buildHaskellPackages = bh.packages.ghc924BinaryMinimal;
286 ghc = bh.compiler.ghc924BinaryMinimal;
287 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.2.x.nix { };
288 packageSetConfig = bootstrapPackageSet;
290 ghc884 = callPackage ../development/haskell-modules {
291 buildHaskellPackages = bh.packages.ghc884;
292 ghc = bh.compiler.ghc884;
293 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.8.x.nix { };
296 ghc8107 = callPackage ../development/haskell-modules {
297 buildHaskellPackages = bh.packages.ghc8107;
298 ghc = bh.compiler.ghc8107;
299 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
302 ghc902 = callPackage ../development/haskell-modules {
303 buildHaskellPackages = bh.packages.ghc902;
304 ghc = bh.compiler.ghc902;
305 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.0.x.nix { };
308 ghc924 = callPackage ../development/haskell-modules {
309 buildHaskellPackages = bh.packages.ghc924;
310 ghc = bh.compiler.ghc924;
311 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.2.x.nix { };
314 ghc942 = callPackage ../development/haskell-modules {
315 buildHaskellPackages = bh.packages.ghc942;
316 ghc = bh.compiler.ghc942;
317 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.4.x.nix { };
320 ghcHEAD = callPackage ../development/haskell-modules {
321 buildHaskellPackages = bh.packages.ghcHEAD;
322 ghc = bh.compiler.ghcHEAD;
323 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { };
326 ghcjs = packages.ghcjs810;
327 ghcjs810 = callPackage ../development/haskell-modules rec {
328 buildHaskellPackages = ghc.bootPkgs;
329 ghc = bh.compiler.ghcjs810;
330 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
331 packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { };
334 # The integer-simple attribute set contains package sets for all the GHC compilers
335 # using integer-simple instead of integer-gmp.
338 integerSimpleGhcNames = pkgs.lib.filter
339 (name: ! builtins.elem name integerSimpleExcludes)
340 (pkgs.lib.attrNames packages);
342 pkgs.lib.genAttrs integerSimpleGhcNames
344 packages.${name}.override (oldAttrs: {
345 ghc = bh.compiler.integer-simple.${name};
346 buildHaskellPackages = bh.packages.integer-simple.${name};
348 pkgs.lib.composeExtensions
349 (oldAttrs.overrides or (_: _: {}))
350 (_: _: { integer-simple = null; });
356 nativeBignumGhcNames = pkgs.lib.filter
357 (name: builtins.elem name nativeBignumIncludes)
358 (pkgs.lib.attrNames compiler);
360 pkgs.lib.genAttrs nativeBignumGhcNames
362 packages.${name}.override {
363 ghc = bh.compiler.native-bignum.${name};
364 buildHaskellPackages = bh.packages.native-bignum.${name};