git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #40973 from NixOS/revert-40929-cross-ghc-for-master

Revert "ghc, haskell infra: #40642 direct to master"

commit83baf1e977759e1b26db2100afb597f8bf55aa6f authorPeter Simons <simons@cryp.to> dateWed 23 May 2018, 09:40 (9 years ago) parent9530d715db3a9d
8 files changed+50−143
pkgs/development/compilers/ghc/7.10.3.nix+3−13 pkgs/development/compilers/ghc/8.0.2.nix+3−16 pkgs/development/compilers/ghc/8.2.2.nix+7−14 pkgs/development/compilers/ghc/8.4.2.nix+11−22 pkgs/development/compilers/ghc/head.nix+8−20 pkgs/development/haskell-modules/configuration-nix.nix+1−1 pkgs/development/haskell-modules/generic-builder.nix+17−55 pkgs/development/haskell-modules/lib.nix−2
pkgs/development/compilers/ghc/7.10.3.nix+3−13
@@ -24,10 +24,6 @@
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"
3127}:
3228
3329assert !enableIntegerSimple -> gmp != null;
@@ -46,14 +42,11 @@ let
4642 };
4743
4844 buildMK = ''
49− BuildFlavour = ${ghcFlavour}
50− ifneq \"\$(BuildFlavour)\" \"\"
51− include mk/flavours/\$(BuildFlavour).mk
52− endif
5345 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
5446 '' + stdenv.lib.optionalString enableIntegerSimple ''
5547 INTEGER_LIBRARY = integer-simple
5648 '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
49+ BuildFlavour = perf-cross
5750 Stage1Only = YES
5851 HADDOCK_DOCS = NO
5952 '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
@@ -75,6 +68,7 @@ let
7568 targetCC = builtins.head toolsForTarget;
7669
7770in
71+
7872stdenv.mkDerivation rec {
7973 version = "7.10.3";
8074 name = "${targetPrefix}ghc-${version}";
@@ -93,8 +87,6 @@ stdenv.mkDerivation rec {
9387 ./relocation.patch
9488 ];
9589
96− postPatch = "patchShebangs .";
97−
9890 # GHC is a bit confused on its cross terminology.
9991 preConfigure = ''
10092 for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
@@ -111,7 +103,6 @@ stdenv.mkDerivation rec {
111103 export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
112104 export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
113105 export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
114−
115106 echo -n "${buildMK}" > mk/build.mk
116107 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
117108 '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
@@ -144,8 +135,7 @@ stdenv.mkDerivation rec {
144135 crossConfig = true;
145136
146137 nativeBuildInputs = [
147− perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42
148− ghc hscolour
138+ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour
149139 ];
150140
151141 # For building runtime libs
pkgs/development/compilers/ghc/8.0.2.nix+3−16
@@ -23,10 +23,6 @@
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"
3026}:
3127
3228assert !enableIntegerSimple -> gmp != null;
@@ -40,14 +36,11 @@ let
4036 "${targetPlatform.config}-";
4137
4238 buildMK = ''
43− BuildFlavour = ${ghcFlavour}
44− ifneq \"\$(BuildFlavour)\" \"\"
45− include mk/flavours/\$(BuildFlavour).mk
46− endif
4739 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
4840 '' + stdenv.lib.optionalString enableIntegerSimple ''
4941 INTEGER_LIBRARY = integer-simple
5042 '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
43+ BuildFlavour = perf-cross
5144 Stage1Only = YES
5245 HADDOCK_DOCS = NO
5346 '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
@@ -94,8 +87,6 @@ stdenv.mkDerivation rec {
9487 ++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch
9588 ++ stdenv.lib.optional stdenv.isDarwin ./backport-dylib-command-size-limit.patch;
9689
97− postPatch = "patchShebangs .";
98−
9990 # GHC is a bit confused on its cross terminology.
10091 preConfigure = ''
10192 for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
@@ -112,7 +103,6 @@ stdenv.mkDerivation rec {
112103 export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
113104 export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
114105 export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
115−
116106 echo -n "${buildMK}" > mk/build.mk
117107 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
118108 '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
@@ -144,10 +134,7 @@ stdenv.mkDerivation rec {
144134 # masss-rebuild.
145135 crossConfig = true;
146136
147− nativeBuildInputs = [
148− perl sphinx
149− ghc hscolour
150− ];
137+ nativeBuildInputs = [ ghc perl hscolour sphinx ];
151138
152139 # For building runtime libs
153140 depsBuildTarget = toolsForTarget;
@@ -167,7 +154,7 @@ stdenv.mkDerivation rec {
167154 # zsh and other shells are smart about `{ghc}` but bash isn't, and doesn't
168155 # treat that as a unary `{x,y,z,..}` repetition.
169156 postInstall = ''
170− paxmark m $out/lib/${name}/bin/*
157+ paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
171158
172159 # Install the bash completion file.
173160 install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
pkgs/development/compilers/ghc/8.2.2.nix+7−14
@@ -23,11 +23,10 @@
2323
2424, # Whether to build dynamic libs for the standard library (on the target
2525 # platform). Static libs are always built.
26− 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"
26+ enableShared ?
27+ !(targetPlatform.isDarwin
28+ # On iOS, dynamic linking is not supported
29+ && (targetPlatform.isAarch64 || targetPlatform.isAarch32))
3130, # Whether to backport https://phabricator.haskell.org/D4388 for
3231 # deterministic profiling symbol names, at the cost of a slightly
3332 # non-standard GHC API
@@ -45,14 +44,11 @@ let
4544 "${targetPlatform.config}-";
4645
4746 buildMK = ''
48− BuildFlavour = ${ghcFlavour}
49− ifneq \"\$(BuildFlavour)\" \"\"
50− include mk/flavours/\$(BuildFlavour).mk
51− endif
5247 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
5348 '' + stdenv.lib.optionalString enableIntegerSimple ''
5449 INTEGER_LIBRARY = integer-simple
5550 '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
51+ BuildFlavour = perf-cross
5652 Stage1Only = YES
5753 HADDOCK_DOCS = NO
5854 BUILD_SPHINX_HTML = NO
@@ -157,10 +153,7 @@ stdenv.mkDerivation rec {
157153 # masss-rebuild.
158154 crossConfig = true;
159155
160− nativeBuildInputs = [
161− autoconf autoreconfHook automake perl python3 sphinx
162− ghc alex happy hscolour
163− ];
156+ nativeBuildInputs = [ alex autoconf autoreconfHook automake ghc happy hscolour perl python3 sphinx ];
164157
165158 # For building runtime libs
166159 depsBuildTarget = toolsForTarget;
@@ -182,7 +175,7 @@ stdenv.mkDerivation rec {
182175 # zsh and other shells are smart about `{ghc}` but bash isn't, and doesn't
183176 # treat that as a unary `{x,y,z,..}` repetition.
184177 postInstall = ''
185− paxmark m $out/lib/${name}/bin/*
178+ paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
186179
187180 # Install the bash completion file.
188181 install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
pkgs/development/compilers/ghc/8.4.2.nix+11−22
@@ -3,7 +3,7 @@
33
44# build-tools
55, bootPkgs, alex, happy
6−, autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3, m4
6+, autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3
77
88, libffi, libiconv ? null, ncurses
99
@@ -15,21 +15,16 @@
1515
1616, # If enabled, GHC will be built with the GPL-free but slower integer-simple
1717 # library instead of the faster but GPLed integer-gmp library.
18− enableIntegerSimple ? false, gmp ? null
18+ enableIntegerSimple ? false, gmp ? null, m4
1919
2020, # If enabled, use -fPIC when compiling static libs.
2121 enableRelocatedStaticLibs ? targetPlatform != hostPlatform
2222
2323, # Whether to build dynamic libs for the standard library (on the target
2424 # platform). Static libs are always built.
25− enableShared ? !targetPlatform.isWindows && !targetPlatform.useAndroidPrebuilt
25+ enableShared ? !targetPlatform.useAndroidPrebuilt
2626
27−, # Whetherto build terminfo.
28− enableTerminfo ? !targetPlatform.isWindows
29−
30−, # What flavour to build. An empty string indicates no
31− # specific flavour and falls back to ghc default values.
32− ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross"
27+, version ? "8.4.2"
3328}:
3429
3530assert !enableIntegerSimple -> gmp != null;
@@ -43,14 +38,11 @@ let
4338 "${targetPlatform.config}-";
4439
4540 buildMK = ''
46− BuildFlavour = ${ghcFlavour}
47− ifneq \"\$(BuildFlavour)\" \"\"
48− include mk/flavours/\$(BuildFlavour).mk
49− endif
5041 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
5142 '' + stdenv.lib.optionalString enableIntegerSimple ''
5243 INTEGER_LIBRARY = integer-simple
5344 '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
45+ BuildFlavour = perf-cross
5446 Stage1Only = YES
5547 HADDOCK_DOCS = NO
5648 BUILD_SPHINX_HTML = NO
@@ -63,9 +55,9 @@ let
6355 '';
6456
6557 # Splicer will pull out correct variations
66− libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
58+ libDeps = platform: [ ncurses ]
6759 ++ stdenv.lib.optional (!enableIntegerSimple) gmp
68− ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
60+ ++ stdenv.lib.optional (platform.libc != "glibc") libiconv;
6961
7062 toolsForTarget =
7163 if hostPlatform == buildPlatform then
@@ -77,7 +69,7 @@ let
7769
7870in
7971stdenv.mkDerivation rec {
80− version = "8.4.2";
72+ inherit version;
8173 name = "${targetPrefix}ghc-${version}";
8274
8375 src = fetchurl {
@@ -134,7 +126,7 @@ stdenv.mkDerivation rec {
134126 "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
135127 ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [
136128 "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
137− ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
129+ ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc") [
138130 "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
139131 ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
140132 "--enable-bootstrap-with-devel-snapshot"
@@ -152,10 +144,7 @@ stdenv.mkDerivation rec {
152144 # masss-rebuild.
153145 crossConfig = true;
154146
155− nativeBuildInputs = [
156− perl autoconf automake m4 python3
157− ghc alex happy
158− ];
147+ nativeBuildInputs = [ ghc perl autoconf automake m4 happy alex python3 ];
159148
160149 # For building runtime libs
161150 depsBuildTarget = toolsForTarget;
@@ -177,7 +166,7 @@ stdenv.mkDerivation rec {
177166 # zsh and other shells are smart about `{ghc}` but bash isn't, and doesn't
178167 # treat that as a unary `{x,y,z,..}` repetition.
179168 postInstall = ''
180− paxmark m $out/lib/${name}/bin/*
169+ paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
181170
182171 # Install the bash completion file.
183172 install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
pkgs/development/compilers/ghc/head.nix+8−20
@@ -3,7 +3,7 @@
33
44# build-tools
55, bootPkgs, alex, happy
6−, autoconf, automake, coreutils, fetchgit, perl, python3, m4
6+, autoconf, automake, coreutils, fetchgit, perl, python3
77
88, libffi, libiconv ? null, ncurses
99
@@ -22,15 +22,9 @@
2222
2323, # Whether to build dynamic libs for the standard library (on the target
2424 # platform). Static libs are always built.
25− enableShared ? !targetPlatform.isWindows && !targetPlatform.useAndroidPrebuilt
26−
27−, # Whetherto build terminfo.
28− enableTerminfo ? !targetPlatform.isWindows
25+ enableShared ? !targetPlatform.useAndroidPrebuilt
2926
3027, version ? "8.5.20180118"
31−, # What flavour to build. An empty string indicates no
32− # specific flavour and falls back to ghc default values.
33− ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross"
3428}:
3529
3630assert !enableIntegerSimple -> gmp != null;
@@ -44,14 +38,11 @@ let
4438 "${targetPlatform.config}-";
4539
4640 buildMK = ''
47− BuildFlavour = ${ghcFlavour}
48− ifneq \"\$(BuildFlavour)\" \"\"
49− include mk/flavours/\$(BuildFlavour).mk
50− endif
5141 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
5242 '' + stdenv.lib.optionalString enableIntegerSimple ''
5343 INTEGER_LIBRARY = integer-simple
5444 '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
45+ BuildFlavour = perf-cross
5546 Stage1Only = YES
5647 HADDOCK_DOCS = NO
5748 BUILD_SPHINX_HTML = NO
@@ -64,9 +55,9 @@ let
6455 '';
6556
6657 # Splicer will pull out correct variations
67− libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
58+ libDeps = platform: [ ncurses ]
6859 ++ stdenv.lib.optional (!enableIntegerSimple) gmp
69− ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
60+ ++ stdenv.lib.optional (platform.libc != "glibc") libiconv;
7061
7162 toolsForTarget =
7263 if hostPlatform == buildPlatform then
@@ -132,7 +123,7 @@ stdenv.mkDerivation rec {
132123 "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
133124 ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [
134125 "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
135− ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
126+ ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc") [
136127 "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
137128 ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
138129 "--enable-bootstrap-with-devel-snapshot"
@@ -150,10 +141,7 @@ stdenv.mkDerivation rec {
150141 # masss-rebuild.
151142 crossConfig = true;
152143
153− nativeBuildInputs = [
154− perl autoconf automake m4 python3
155− ghc alex happy
156− ];
144+ nativeBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
157145
158146 # For building runtime libs
159147 depsBuildTarget = toolsForTarget;
@@ -175,7 +163,7 @@ stdenv.mkDerivation rec {
175163 # zsh and other shells are smart about `{ghc}` but bash isn't, and doesn't
176164 # treat that as a unary `{x,y,z,..}` repetition.
177165 postInstall = ''
178− paxmark m $out/lib/${name}/bin/*
166+ paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
179167
180168 # Install the bash completion file.
181169 install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
pkgs/development/haskell-modules/configuration-nix.nix+1−1
@@ -128,7 +128,7 @@ self: super: builtins.intersectAttrs super {
128128
129129 # Prevents needing to add security_tool as a build tool to all of x509-system's
130130 # dependencies.
131− x509-system = if pkgs.stdenv.targetPlatform.isDarwin && !pkgs.stdenv.cc.nativeLibc
131+ x509-system = if pkgs.stdenv.isDarwin && !pkgs.stdenv.cc.nativeLibc
132132 then let inherit (pkgs.darwin) security_tool;
133133 in pkgs.lib.overrideDerivation (addBuildDepend super.x509-system security_tool) (drv: {
134134 postPatch = (drv.postPatch or "") + ''
pkgs/development/haskell-modules/generic-builder.nix+17−55
@@ -19,7 +19,6 @@ in
1919, buildTarget ? ""
2020, buildTools ? [], libraryToolDepends ? [], executableToolDepends ? [], testToolDepends ? [], benchmarkToolDepends ? []
2121, configureFlags ? []
22−, buildFlags ? []
2322, description ? ""
2423, doCheck ? !isCross && (stdenv.lib.versionOlder "7.4" ghc.version)
2524, doBenchmark ? false
@@ -32,7 +31,7 @@ in
3231, enableSharedExecutables ? false
3332, enableSharedLibraries ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version)
3433, enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin
35−, enableStaticLibraries ? !hostPlatform.isWindows
34+, enableStaticLibraries ? true
3635, enableHsc2hsViaAsm ? hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4"
3736, extraLibraries ? [], librarySystemDepends ? [], executableSystemDepends ? []
3837, homepage ? "http://hackage.haskell.org/package/${pname}"
@@ -69,10 +68,6 @@ in
6968
7069assert editedCabalFile != null -> revision != null;
7170
72−# --enable-static does not work on windows. This is a bug in GHC.
73−# --enable-static will pass -staticlib to ghc, which only works for mach-o and elf.
74−assert hostPlatform.isWindows -> enableStaticLibraries == false;
75−
7671let
7772
7873 inherit (stdenv.lib) optional optionals optionalString versionOlder versionAtLeast
@@ -131,8 +126,6 @@ let
131126 crossCabalFlagsString =
132127 stdenv.lib.optionalString isCross (" " + stdenv.lib.concatStringsSep " " crossCabalFlags);
133128
134− buildFlagsString = optionalString (buildFlags != []) (" " + concatStringsSep " " buildFlags);
135−
136129 defaultConfigureFlags = [
137130 "--verbose" "--prefix=$out" "--libdir=\\$prefix/lib/\\$compiler" "--libsubdir=\\$pkgid"
138131 (optionalString enableSeparateDataOutput "--datadir=$data/share/${ghc.name}")
@@ -176,22 +169,18 @@ let
176169 optionals doCheck testPkgconfigDepends ++ optionals doBenchmark benchmarkPkgconfigDepends;
177170
178171 nativeBuildInputs = [ ghc nativeGhc removeReferencesTo ] ++ optional (allPkgconfigDepends != []) pkgconfig ++
179− setupHaskellDepends ++
180172 buildTools ++ libraryToolDepends ++ executableToolDepends;
181173 propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends;
182− otherBuildInputs = extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++
174+ otherBuildInputs = setupHaskellDepends ++ extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++
183175 optionals (allPkgconfigDepends != []) allPkgconfigDepends ++
184176 optionals doCheck (testDepends ++ testHaskellDepends ++ testSystemDepends ++ testToolDepends) ++
185177 optionals doBenchmark (benchmarkDepends ++ benchmarkHaskellDepends ++ benchmarkSystemDepends ++ benchmarkToolDepends);
186−
187178 allBuildInputs = propagatedBuildInputs ++ otherBuildInputs;
188179
189180 haskellBuildInputs = stdenv.lib.filter isHaskellPkg allBuildInputs;
190181 systemBuildInputs = stdenv.lib.filter isSystemPkg allBuildInputs;
191182
192− # When not cross compiling, also include Setup.hs dependencies.
193− ghcEnv = ghc.withPackages (p:
194− haskellBuildInputs ++ stdenv.lib.optional (!isCross) setupHaskellDepends);
183+ ghcEnv = ghc.withPackages (p: haskellBuildInputs);
195184
196185 setupCommand = "./Setup";
197186
@@ -201,22 +190,6 @@ let
201190
202191 nativeGhcCommand = "${nativeGhc.targetPrefix}ghc";
203192
204− buildPkgDb = ghcName: ''
205− if [ -d "$p/lib/${ghcName}/package.conf.d" ]; then
206− cp -f "$p/lib/${ghcName}/package.conf.d/"*.conf $packageConfDir/
207− continue
208− fi
209− if [ -d "$p/include" ]; then
210− configureFlags+=" --extra-include-dirs=$p/include"
211− fi
212− if [ -d "$p/lib" ]; then
213− configureFlags+=" --extra-lib-dirs=$p/lib"
214− fi
215− if [[ -d "$p/Library/Frameworks" ]]; then
216− configureFlags+=" --extra-framework-dirs=$p/Library/Frameworks"
217− fi
218− '';
219−
220193in
221194
222195assert allPkgconfigDepends != [] -> pkgconfig != null;
@@ -257,37 +230,30 @@ stdenv.mkDerivation ({
257230 echo "Build with ${ghc}."
258231 ${optionalString (hasActiveLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"}
259232
260− '' + (optionalString (setupHaskellDepends != []) ''
261− setupPackageConfDir="$TMPDIR/setup-package.conf.d"
262− mkdir -p $setupPackageConfDir
263− '') + ''
264233 packageConfDir="$TMPDIR/package.conf.d"
265234 mkdir -p $packageConfDir
266235
267236 setupCompileFlags="${concatStringsSep " " setupCompileFlags}"
268237 configureFlags="${concatStringsSep " " defaultConfigureFlags} $configureFlags"
269− ''
270− # We build the Setup.hs on the *build* machine, and as such should only add
271− # dependencies for the build machine.
272− #
273− # pkgs* arrays defined in stdenv/setup.hs
274− + (optionalString (setupHaskellDepends != []) ''
275− for p in "''${pkgsBuildBuild[@]}" "''${pkgsBuildHost[@]}" "''${pkgsBuildTarget[@]}"; do
276− ${buildPkgDb nativeGhc.name}
277− done
278− ${nativeGhcCommand}-pkg --${nativePackageDbFlag}="$setupPackageConfDir" recache
279− '')
280238
281− # For normal components
282− + ''
239+ # host.*Pkgs defined in stdenv/setup.hs
283240 for p in "''${pkgsHostHost[@]}" "''${pkgsHostTarget[@]}"; do
284− ${buildPkgDb ghc.name}
241+ if [ -d "$p/lib/${ghc.name}/package.conf.d" ]; then
242+ cp -f "$p/lib/${ghc.name}/package.conf.d/"*.conf $packageConfDir/
243+ continue
244+ fi
245+ if [ -d "$p/include" ]; then
246+ configureFlags+=" --extra-include-dirs=$p/include"
247+ fi
248+ if [ -d "$p/lib" ]; then
249+ configureFlags+=" --extra-lib-dirs=$p/lib"
250+ fi
285251 done
286252 ''
287253 # only use the links hack if we're actually building dylibs. otherwise, the
288254 # "dynamic-library-dirs" point to nonexistent paths, and the ln command becomes
289255 # "ln -s $out/lib/links", which tries to recreate the links dir and fails
290− + (optionalString (stdenv.isDarwin && (enableSharedLibraries || enableSharedExecutables)) ''
256+ + (optionalString (stdenv.isDarwin && enableSharedLibraries) ''
291257 # Work around a limit in the macOS Sierra linker on the number of paths
292258 # referenced by any one dynamic library:
293259 #
@@ -316,11 +282,7 @@ stdenv.mkDerivation ({
316282 done
317283
318284 echo setupCompileFlags: $setupCompileFlags
319− ${optionalString (setupHaskellDepends != [])
320− ''
321− echo GHC_PACKAGE_PATH="$setupPackageConfDir:"
322− GHC_PACKAGE_PATH="$setupPackageConfDir:" ''
323− }${nativeGhcCommand} $setupCompileFlags --make -o Setup -odir $TMPDIR -hidir $TMPDIR $i
285+ ${nativeGhcCommand} $setupCompileFlags --make -o Setup -odir $TMPDIR -hidir $TMPDIR $i
324286
325287 runHook postCompileBuildDriver
326288 '';
@@ -348,7 +310,7 @@ stdenv.mkDerivation ({
348310
349311 buildPhase = ''
350312 runHook preBuild
351− ${setupCommand} build ${buildTarget}${crossCabalFlagsString}${buildFlagsString}
313+ ${setupCommand} build ${buildTarget}${crossCabalFlagsString}
352314 runHook postBuild
353315 '';
354316
pkgs/development/haskell-modules/lib.nix−2
@@ -131,8 +131,6 @@ rec {
131131 */
132132 appendConfigureFlag = drv: x: overrideCabal drv (drv: { configureFlags = (drv.configureFlags or []) ++ [x]; });
133133
134− appendBuildFlag = drv: x: overrideCabal drv (drv: { buildFlags = (drv.buildFlags or []) ++ [x]; });
135− appendBuildFlags = drv: xs: overrideCabal drv (drv: { buildFlags = (drv.buildFlags or []) ++ xs; });
136134 /* removeConfigureFlag drv x is a Haskell package like drv, but with
137135 all cabal configure arguments that are equal to x removed.
138136