Fix use of isDarwin conditionals.

This commit is contained in:
Judah Jacobson 2017-05-05 09:53:08 -07:00
parent 7131e06214
commit 2caa7b88ae
2 changed files with 38 additions and 42 deletions

View File

@ -228,8 +228,7 @@ stdenv.mkDerivation ({
configureFlags+=" --extra-lib-dirs=$p/lib"
fi
done
if "${if stdenv.isDarwin then "true" else "false"}"; then
'' + (optionalString stdenv.isDarwin ''
# Work around a limit in the Mac OS X Sierra linker on the number of paths
# referenced by any one dynamic library:
#
@ -245,8 +244,7 @@ stdenv.mkDerivation ({
for f in $packageConfDir/*.conf; do
sed -i "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," $f
done
fi
'') + ''
${ghcCommand}-pkg --${packageDbFlag}="$packageConfDir" recache
runHook postSetupCompilerEnvironment

View File

@ -96,9 +96,8 @@ symlinkJoin {
makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag}=${packageCfgDir}"
fi
done
'' + (lib.optionalString stdenv.isDarwin ''
# Work around a linker limit in Mac OS X Sierra (see generic-builder.nix):
if "${if stdenv.isDarwin then "true" else "false"}"; then
local packageConfDir="$out/lib/${ghc.name}/package.conf.d";
local dynamicLinksDir="$out/lib/links"
mkdir -p $dynamicLinksDir
@ -118,8 +117,7 @@ symlinkJoin {
sed "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," $f-tmp > $f
rm $f-tmp
done
fi
'') + ''
${lib.optionalString hasLibraries "$out/bin/${ghcCommand}-pkg recache"}
${# ghcjs will read the ghc_libdir file when resolving plugins.
lib.optionalString (isGhcjs && ghcLibdir != null) ''