diff --git a/pkgs/development/compilers/ghc/7.0.4-binary.nix b/pkgs/development/compilers/ghc/7.0.4-binary.nix index bb592a6cfe33..c518c67d16b1 100644 --- a/pkgs/development/compilers/ghc/7.0.4-binary.nix +++ b/pkgs/development/compilers/ghc/7.0.4-binary.nix @@ -106,15 +106,10 @@ stdenv.mkDerivation rec { -exec patchelf --set-rpath "${libPath}" {} \; '' + stdenv.lib.optionalString stdenv.isDarwin '' # not enough room in the object files for the full path to libiconv :( - ln -s ${libiconv}/lib/libiconv.dylib $out/bin - ln -s ${libiconv}/lib/libiconv.dylib $out/lib/ghc-${version}/libiconv.dylib - - fix () { - install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $1 - } - - for file in ghc-cabal ghc-pwd ghc-stage2 ghc-pkg haddock hsc2hs hpc; do - fix $(find "$out" -type f -name $file) + for exe in $(find "$out" -type f -executable); do + isScript $exe && continue + ln -fs ${libiconv}/lib/libiconv.dylib $(dirname $exe)/libiconv.dylib + install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $exe done for file in $(find "$out" -name setup-config); do diff --git a/pkgs/development/compilers/ghc/7.4.2-binary.nix b/pkgs/development/compilers/ghc/7.4.2-binary.nix index 65a3d2a7f730..3cb28e2c8207 100644 --- a/pkgs/development/compilers/ghc/7.4.2-binary.nix +++ b/pkgs/development/compilers/ghc/7.4.2-binary.nix @@ -107,15 +107,10 @@ stdenv.mkDerivation rec { -exec patchelf --set-rpath "${libPath}" {} \; '' + stdenv.lib.optionalString stdenv.isDarwin '' # not enough room in the object files for the full path to libiconv :( - ln -s ${libiconv}/lib/libiconv.dylib $out/bin - ln -s ${libiconv}/lib/libiconv.dylib $out/lib/ghc-${version}/libiconv.dylib - - fix () { - install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $1 - } - - for file in ghc-cabal ghc-pwd ghc-stage2 ghc-pkg haddock hsc2hs hpc; do - fix $(find "$out" -type f -name $file) + for exe in $(find "$out" -type f -executable); do + isScript $exe && continue + ln -fs ${libiconv}/lib/libiconv.dylib $(dirname $exe)/libiconv.dylib + install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $exe done for file in $(find "$out" -name setup-config); do