python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / top-level / haskell-packages.nix
blob44ffc7335c34937556c8ab5e611867f38dd75a71
1 { buildPackages, pkgsBuildTarget, pkgs, newScope, stdenv }:
3 let
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     "ghc924Binary"
12     "ghc924BinaryMinimal"
13     "ghcjs"
14     "ghcjs810"
15     "integer-simple"
16     "native-bignum"
17     "ghc902"
18     "ghc90"
19     "ghc924"
20     "ghc92"
21     "ghc942"
22     "ghc94"
23     "ghcHEAD"
24   ];
26   nativeBignumIncludes = [
27     "ghc90"
28     "ghc902"
29     "ghc92"
30     "ghc924"
31     "ghc94"
32     "ghc942"
33     "ghcHEAD"
34   ];
36   haskellLibUncomposable = import ../development/haskell-modules/lib {
37     inherit (pkgs) lib;
38     inherit pkgs;
39   };
41   callPackage = newScope {
42     haskellLib = haskellLibUncomposable.compose;
43     overrides = pkgs.haskell.packageOverrides;
44   };
46   bootstrapPackageSet = self: super: {
47     mkDerivation = drv: super.mkDerivation (drv // {
48       doCheck = false;
49       doHaddock = false;
50       enableExecutableProfiling = false;
51       enableLibraryProfiling = false;
52       enableSharedExecutables = false;
53       enableSharedLibraries = false;
54     });
55   };
57   # Use this rather than `rec { ... }` below for sake of overlays.
58   inherit (pkgs.haskell) compiler packages;
60 in {
61   lib = haskellLibUncomposable;
63   package-list = callPackage ../development/haskell-modules/package-list.nix {};
65   compiler = rec {
67     ghc865Binary = callPackage ../development/compilers/ghc/8.6.5-binary.nix {
68       llvmPackages = pkgs.llvmPackages_6;
69     };
71     ghc8102Binary = callPackage ../development/compilers/ghc/8.10.2-binary.nix {
72       llvmPackages = pkgs.llvmPackages_9;
73     };
75     ghc8102BinaryMinimal = callPackage ../development/compilers/ghc/8.10.2-binary.nix {
76       llvmPackages = pkgs.llvmPackages_9;
77       minimal = true;
78     };
80     ghc8107Binary = callPackage ../development/compilers/ghc/8.10.7-binary.nix {
81       llvmPackages = pkgs.llvmPackages_12;
82     };
84     ghc8107BinaryMinimal = callPackage ../development/compilers/ghc/8.10.7-binary.nix {
85       llvmPackages = pkgs.llvmPackages_12;
86       minimal = true;
87     };
89     ghc924Binary = callPackage ../development/compilers/ghc/9.2.4-binary.nix {
90       llvmPackages = pkgs.llvmPackages_12;
91     };
92     ghc924BinaryMinimal = callPackage ../development/compilers/ghc/9.2.4-binary.nix {
93       llvmPackages = pkgs.llvmPackages_12;
94       minimal = true;
95     };
97     ghc884 = callPackage ../development/compilers/ghc/8.8.4.nix {
98       bootPkgs =
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
106         else
107           packages.ghc865Binary;
108       inherit (buildPackages.python3Packages) sphinx;
109       buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_7;
110       llvmPackages = pkgs.llvmPackages_7;
111     };
112     ghc88 = ghc884;
113     ghc8107 = callPackage ../development/compilers/ghc/8.10.7.nix {
114       bootPkgs =
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
123         else
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;
132     };
133     ghc810 = ghc8107;
134     ghc902 = callPackage ../development/compilers/ghc/9.0.2.nix {
135       bootPkgs =
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
141           packages.ghc810
142         else
143           packages.ghc8107Binary;
144       inherit (buildPackages.python3Packages) sphinx;
145       inherit (buildPackages.darwin) autoSignDarwinBinariesHook xattr;
146       buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_12;
147       llvmPackages = pkgs.llvmPackages_12;
148     };
149     ghc90 = ghc902;
150     ghc924 = callPackage ../development/compilers/ghc/9.2.4.nix {
151       bootPkgs =
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
156           packages.ghc810
157         else
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;
166     };
167     ghc92 = ghc924;
168     ghc942 = callPackage ../development/compilers/ghc/9.4.2.nix {
169       bootPkgs =
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
177           packages.ghc902
178         # No suitable bindists for powerpc64le
179         else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
180           packages.ghc902
181         else
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;
191     };
192     ghc94 = ghc942;
193     ghcHEAD = callPackage ../development/compilers/ghc/head.nix {
194       bootPkgs =
195         # For GHC 9.2.3 and 9.2.4 no armv7l bindists are available.
196         if stdenv.hostPlatform.isAarch32 then
197           packages.ghc924
198         else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
199           packages.ghc924
200         else if stdenv.isAarch64 then
201           packages.ghc924BinaryMinimal
202         else
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;
212     };
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;
219     };
221     # The integer-simple attribute set contains all the GHC compilers
222     # build with integer-simple instead of integer-gmp.
223     integer-simple = let
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.
233     native-bignum = let
234       nativeBignumGhcNames = pkgs.lib.filter
235         (name: builtins.elem name nativeBignumIncludes)
236         (pkgs.lib.attrNames compiler);
237     in pkgs.recurseIntoAttrs (pkgs.lib.genAttrs
238       nativeBignumGhcNames
239       (name: compiler.${name}.override { enableNativeBignum = true; }));
240   };
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;
253     };
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;
259     };
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;
265     };
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;
271     };
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;
277     };
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;
283     };
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;
289     };
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 { };
294     };
295     ghc88 = ghc884;
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 { };
300     };
301     ghc810 = ghc8107;
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 { };
306     };
307     ghc90 = ghc902;
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 { };
312     };
313     ghc92 = ghc924;
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 { };
318     };
319     ghc94= ghc942;
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 { };
324     };
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 { };
332     };
334     # The integer-simple attribute set contains package sets for all the GHC compilers
335     # using integer-simple instead of integer-gmp.
336     integer-simple =
337       let
338         integerSimpleGhcNames = pkgs.lib.filter
339           (name: ! builtins.elem name integerSimpleExcludes)
340           (pkgs.lib.attrNames packages);
341       in
342       pkgs.lib.genAttrs integerSimpleGhcNames
343         (name:
344           packages.${name}.override (oldAttrs: {
345             ghc = bh.compiler.integer-simple.${name};
346             buildHaskellPackages = bh.packages.integer-simple.${name};
347             overrides =
348               pkgs.lib.composeExtensions
349                 (oldAttrs.overrides or (_: _: {}))
350                 (_: _: { integer-simple = null; });
351           })
352         );
354     native-bignum =
355       let
356         nativeBignumGhcNames = pkgs.lib.filter
357           (name: builtins.elem name nativeBignumIncludes)
358           (pkgs.lib.attrNames compiler);
359       in
360       pkgs.lib.genAttrs nativeBignumGhcNames
361         (name:
362           packages.${name}.override {
363             ghc = bh.compiler.native-bignum.${name};
364             buildHaskellPackages = bh.packages.native-bignum.${name};
365           }
366         );
367   };