git.iko.soy/typeable/nixpkgs
on master help sign in
ghc: Handle flavors better
commit1978115c3b2dfcb33f78673677a0ef3ffa6a0565 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateSun 20 May 2018, 02:16 (9 years ago) parent9ce15ea
5 files changed+37−5
pkgs/development/compilers/ghc/7.10.3.nix+8−1 pkgs/development/compilers/ghc/8.0.2.nix+8−1 pkgs/development/compilers/ghc/8.2.2.nix+7−1 pkgs/development/compilers/ghc/8.4.2.nix+7−1 pkgs/development/compilers/ghc/head.nix+7−1
pkgs/development/compilers/ghc/7.10.3.nix+8−1
@@ -24,6 +24,10 @@
2424, # Whether to build dynamic libs for the standard library (on the target
2525 # platform). Static libs are always built.
2626 enableShared ? true
27+
28+, # What flavour to build. An empty string indicates no
29+ # specific flavour and falls back to ghc default values.
30+ ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross"
2731}:
2832
2933assert !enableIntegerSimple -> gmp != null;
@@ -42,11 +46,14 @@ let
4246 };
4347
4448 buildMK = ''
49+ BuildFlavour = ${ghcFlavour}
50+ ifneq \"\$(BuildFlavour)\" \"\"
51+ include mk/flavours/\$(BuildFlavour).mk
52+ endif
4553 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
4654 '' + stdenv.lib.optionalString enableIntegerSimple ''
4755 INTEGER_LIBRARY = integer-simple
4856 '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
49− BuildFlavour = perf-cross
5057 Stage1Only = YES
5158 HADDOCK_DOCS = NO
5259 '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
pkgs/development/compilers/ghc/8.0.2.nix+8−1
@@ -23,6 +23,10 @@
2323, # Whether to build dynamic libs for the standard library (on the target
2424 # platform). Static libs are always built.
2525 enableShared ? true
26+
27+, # What flavour to build. An empty string indicates no
28+ # specific flavour and falls back to ghc default values.
29+ ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross"
2630}:
2731
2832assert !enableIntegerSimple -> gmp != null;
@@ -36,11 +40,14 @@ let
3640 "${targetPlatform.config}-";
3741
3842 buildMK = ''
43+ BuildFlavour = ${ghcFlavour}
44+ ifneq \"\$(BuildFlavour)\" \"\"
45+ include mk/flavours/\$(BuildFlavour).mk
46+ endif
3947 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
4048 '' + stdenv.lib.optionalString enableIntegerSimple ''
4149 INTEGER_LIBRARY = integer-simple
4250 '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
43− BuildFlavour = perf-cross
4451 Stage1Only = YES
4552 HADDOCK_DOCS = NO
4653 '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
pkgs/development/compilers/ghc/8.2.2.nix+7−1
@@ -25,6 +25,9 @@
2525 # platform). Static libs are always built.
2626 enableShared ? true
2727
28+, # What flavour to build. An empty string indicates no
29+ # specific flavour and falls back to ghc default values.
30+ ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross"
2831, # Whether to backport https://phabricator.haskell.org/D4388 for
2932 # deterministic profiling symbol names, at the cost of a slightly
3033 # non-standard GHC API
@@ -42,11 +45,14 @@ let
4245 "${targetPlatform.config}-";
4346
4447 buildMK = ''
48+ BuildFlavour = ${ghcFlavour}
49+ ifneq \"\$(BuildFlavour)\" \"\"
50+ include mk/flavours/\$(BuildFlavour).mk
51+ endif
4552 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
4653 '' + stdenv.lib.optionalString enableIntegerSimple ''
4754 INTEGER_LIBRARY = integer-simple
4855 '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
49− BuildFlavour = perf-cross
5056 Stage1Only = YES
5157 HADDOCK_DOCS = NO
5258 BUILD_SPHINX_HTML = NO
pkgs/development/compilers/ghc/8.4.2.nix+7−1
@@ -24,6 +24,9 @@
2424 # platform). Static libs are always built.
2525 enableShared ? !targetPlatform.useAndroidPrebuilt
2626
27+, # What flavour to build. An empty string indicates no
28+ # specific flavour and falls back to ghc default values.
29+ ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross"
2730}:
2831
2932assert !enableIntegerSimple -> gmp != null;
@@ -37,11 +40,14 @@ let
3740 "${targetPlatform.config}-";
3841
3942 buildMK = ''
43+ BuildFlavour = ${ghcFlavour}
44+ ifneq \"\$(BuildFlavour)\" \"\"
45+ include mk/flavours/\$(BuildFlavour).mk
46+ endif
4047 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
4148 '' + stdenv.lib.optionalString enableIntegerSimple ''
4249 INTEGER_LIBRARY = integer-simple
4350 '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
44− BuildFlavour = perf-cross
4551 Stage1Only = YES
4652 HADDOCK_DOCS = NO
4753 BUILD_SPHINX_HTML = NO
pkgs/development/compilers/ghc/head.nix+7−1
@@ -25,6 +25,9 @@
2525 enableShared ? !targetPlatform.useAndroidPrebuilt
2626
2727, version ? "8.5.20180118"
28+, # What flavour to build. An empty string indicates no
29+ # specific flavour and falls back to ghc default values.
30+ ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross"
2831}:
2932
3033assert !enableIntegerSimple -> gmp != null;
@@ -38,11 +41,14 @@ let
3841 "${targetPlatform.config}-";
3942
4043 buildMK = ''
44+ BuildFlavour = ${ghcFlavour}
45+ ifneq \"\$(BuildFlavour)\" \"\"
46+ include mk/flavours/\$(BuildFlavour).mk
47+ endif
4148 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
4249 '' + stdenv.lib.optionalString enableIntegerSimple ''
4350 INTEGER_LIBRARY = integer-simple
4451 '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
45− BuildFlavour = perf-cross
4652 Stage1Only = YES
4753 HADDOCK_DOCS = NO
4854 BUILD_SPHINX_HTML = NO