···87 then { system = elem; }
88 else { parsed = elem; };
89 in lib.matchAttrs pattern platform;
00000000000090}
···87 then { system = elem; }
88 else { parsed = elem; };
89 in lib.matchAttrs pattern platform;
90+91+ /* Check if a package is available on a given platform.
92+93+ A package is available on a platform if both
94+95+ 1. One of `meta.platforms` pattern matches the given platform.
96+97+ 2. None of `meta.badPlatforms` pattern matches the given platform.
98+ */
99+ availableOn = platform: pkg:
100+ lib.any (platformMatch platform) pkg.meta.platforms &&
101+ lib.all (elem: !platformMatch platform elem) (pkg.meta.badPlatforms or []);
102}
+4-4
lib/types.nix
···260 };
261 u8 = unsign 8 256;
262 u16 = unsign 16 65536;
263- # the biggest int a 64-bit Nix accepts is 2^63 - 1 (9223372036854775808), for a 32-bit Nix it is 2^31 - 1 (2147483647)
264- # the smallest int a 64-bit Nix accepts is -2^63 (-9223372036854775807), for a 32-bit Nix it is -2^31 (-2147483648)
265- # u32 = unsign 32 4294967296;
266 # u64 = unsign 64 18446744073709551616;
267268 s8 = sign 8 256;
269 s16 = sign 16 65536;
270- # s32 = sign 32 4294967296;
271 };
272273 # Alias of u16 for a port number
···260 };
261 u8 = unsign 8 256;
262 u16 = unsign 16 65536;
263+ # the biggest int Nix accepts is 2^63 - 1 (9223372036854775808)
264+ # the smallest int Nix accepts is -2^63 (-9223372036854775807)
265+ u32 = unsign 32 4294967296;
266 # u64 = unsign 64 18446744073709551616;
267268 s8 = sign 8 256;
269 s16 = sign 16 65536;
270+ s32 = sign 32 4294967296;
271 };
272273 # Alias of u16 for a port number
···1819, # If enabled, GHC will be built with the GPL-free but slower integer-simple
20 # library instead of the faster but GPLed integer-gmp library.
21- enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
2223, # If enabled, use -fPIC when compiling static libs.
24 enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
···1819, # If enabled, GHC will be built with the GPL-free but slower integer-simple
20 # library instead of the faster but GPLed integer-gmp library.
21+ enableIntegerSimple ? !(lib.meta.availableOn stdenv.hostPlatform gmp), gmp
2223, # If enabled, use -fPIC when compiling static libs.
24 enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
+1-1
pkgs/development/compilers/ghc/8.8.4.nix
···1819, # If enabled, GHC will be built with the GPL-free but slower integer-simple
20 # library instead of the faster but GPLed integer-gmp library.
21- enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
2223, # If enabled, use -fPIC when compiling static libs.
24 enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
···1819, # If enabled, GHC will be built with the GPL-free but slower integer-simple
20 # library instead of the faster but GPLed integer-gmp library.
21+ enableIntegerSimple ? !(lib.meta.availableOn stdenv.hostPlatform gmp), gmp
2223, # If enabled, use -fPIC when compiling static libs.
24 enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
+1-1
pkgs/development/compilers/ghc/9.0.1.nix
···1920, # If enabled, GHC will be built with the GPL-free but slower integer-simple
21 # library instead of the faster but GPLed integer-gmp library.
22- enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
2324, # If enabled, use -fPIC when compiling static libs.
25 enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
···1920, # If enabled, GHC will be built with the GPL-free but slower integer-simple
21 # library instead of the faster but GPLed integer-gmp library.
22+ enableIntegerSimple ? !(lib.meta.availableOn stdenv.hostPlatform gmp), gmp
2324, # If enabled, use -fPIC when compiling static libs.
25 enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
+1-1
pkgs/development/compilers/ghc/head.nix
···2223, # If enabled, GHC will be built with the GPL-free but slightly slower native
24 # bignum backend instead of the faster but GPLed gmp backend.
25- enableNativeBignum ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms)
26, gmp
2728, # If enabled, use -fPIC when compiling static libs.
···2223, # If enabled, GHC will be built with the GPL-free but slightly slower native
24 # bignum backend instead of the faster but GPLed gmp backend.
25+ enableNativeBignum ? !(lib.meta.availableOn stdenv.hostPlatform gmp)
26, gmp
2728, # If enabled, use -fPIC when compiling static libs.