diff options
author | Judah Jacobson <judah@users.noreply.github.com> | 2017-05-05 09:53:08 -0700 |
---|---|---|
committer | Judah Jacobson <judah@users.noreply.github.com> | 2017-05-05 09:53:08 -0700 |
commit | 2caa7b88ae52caccac9c1b07c52af0080e9417c3 (patch) | |
tree | b7f30dd2ae9c79ca9b5ff92eff3d7d992ab588e3 /pkgs/development/haskell-modules/with-packages-wrapper.nix | |
parent | 7131e06214560625cc85b89d93df3764d223a6e6 (diff) | |
download | nixlib-2caa7b88ae52caccac9c1b07c52af0080e9417c3.tar nixlib-2caa7b88ae52caccac9c1b07c52af0080e9417c3.tar.gz nixlib-2caa7b88ae52caccac9c1b07c52af0080e9417c3.tar.bz2 nixlib-2caa7b88ae52caccac9c1b07c52af0080e9417c3.tar.lz nixlib-2caa7b88ae52caccac9c1b07c52af0080e9417c3.tar.xz nixlib-2caa7b88ae52caccac9c1b07c52af0080e9417c3.tar.zst nixlib-2caa7b88ae52caccac9c1b07c52af0080e9417c3.zip |
Fix use of `isDarwin` conditionals.
Diffstat (limited to 'pkgs/development/haskell-modules/with-packages-wrapper.nix')
-rw-r--r-- | pkgs/development/haskell-modules/with-packages-wrapper.nix | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix index bcbfa32bb1eb..147a021ff534 100644 --- a/pkgs/development/haskell-modules/with-packages-wrapper.nix +++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix @@ -96,30 +96,28 @@ 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 - # Clean up the old links that may have been (transitively) included by - # symlinkJoin: - rm -f $dynamicLinksDir/* - for d in $(grep dynamic-library-dirs $packageConfDir/*|awk '{print $2}'); do - ln -s $d/*.dylib $dynamicLinksDir - done - for f in $packageConfDir/*.conf; do - # Initially, $f is a symlink to a read-only file in one of the inputs - # (as a result of this symlinkJoin derivation). - # Replace it with a copy whose dynamic-library-dirs points to - # $dynamicLinksDir - cp $f $f-tmp - rm $f - sed "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," $f-tmp > $f - rm $f-tmp - done - fi - + local packageConfDir="$out/lib/${ghc.name}/package.conf.d"; + local dynamicLinksDir="$out/lib/links" + mkdir -p $dynamicLinksDir + # Clean up the old links that may have been (transitively) included by + # symlinkJoin: + rm -f $dynamicLinksDir/* + for d in $(grep dynamic-library-dirs $packageConfDir/*|awk '{print $2}'); do + ln -s $d/*.dylib $dynamicLinksDir + done + for f in $packageConfDir/*.conf; do + # Initially, $f is a symlink to a read-only file in one of the inputs + # (as a result of this symlinkJoin derivation). + # Replace it with a copy whose dynamic-library-dirs points to + # $dynamicLinksDir + cp $f $f-tmp + rm $f + sed "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," $f-tmp > $f + rm $f-tmp + done + '') + '' ${lib.optionalString hasLibraries "$out/bin/${ghcCommand}-pkg recache"} ${# ghcjs will read the ghc_libdir file when resolving plugins. lib.optionalString (isGhcjs && ghcLibdir != null) '' |