diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2018-06-13 11:32:44 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2018-06-13 11:34:25 -0400 |
commit | 529a0f74edc0b9a0e7f4cdb8932ac0b53f5179a0 (patch) | |
tree | 436b7b443e81954190f7614127329e4985083b9d | |
parent | eeeaab8d5e0eb262555313cbb6aaecd772cdc296 (diff) | |
download | nixlib-529a0f74edc0b9a0e7f4cdb8932ac0b53f5179a0.tar nixlib-529a0f74edc0b9a0e7f4cdb8932ac0b53f5179a0.tar.gz nixlib-529a0f74edc0b9a0e7f4cdb8932ac0b53f5179a0.tar.bz2 nixlib-529a0f74edc0b9a0e7f4cdb8932ac0b53f5179a0.tar.lz nixlib-529a0f74edc0b9a0e7f4cdb8932ac0b53f5179a0.tar.xz nixlib-529a0f74edc0b9a0e7f4cdb8932ac0b53f5179a0.tar.zst nixlib-529a0f74edc0b9a0e7f4cdb8932ac0b53f5179a0.zip |
haskell generic-builder: Use separate setup db in more cases
Use for cross and GHCJS whether or not there are setup depends.
-rw-r--r-- | pkgs/development/haskell-modules/generic-builder.nix | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index 17bc8b479c76..1cc385864585 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -166,9 +166,11 @@ let "--configure-option=--host=${hostPlatform.config}" ] ++ crossCabalFlags); + useSeparateSetupDb = setupHaskellDepends != [] || isCross || isGhcjs; + setupCompileFlags = [ (optionalString (!coreSetup) "-${nativePackageDbFlag}=${ - if setupHaskellDepends != [] + if useSeparateSetupDb then "$setupPackageConfDir" else "$packageConfDir" }") @@ -268,7 +270,7 @@ stdenv.mkDerivation ({ echo "Build with ${ghc}." ${optionalString (hasActiveLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"} - '' + (optionalString (setupHaskellDepends != []) '' + '' + (optionalString useSeparateSetupDb '' setupPackageConfDir="$TMPDIR/setup-package.conf.d" mkdir -p $setupPackageConfDir '') + '' @@ -282,7 +284,7 @@ stdenv.mkDerivation ({ # dependencies for the build machine. # # pkgs* arrays defined in stdenv/setup.hs - + (optionalString (setupHaskellDepends != []) '' + + (optionalString useSeparateSetupDb '' for p in "''${pkgsBuildBuild[@]}" "''${pkgsBuildHost[@]}" "''${pkgsBuildTarget[@]}"; do ${buildPkgDb nativeGhc.name "$setupPackageConfDir"} done |