From 6b28b254532e6b05e3a72bb97c63168c35c180bc Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Mon, 19 Oct 2009 09:17:40 +0000 Subject: [PATCH] ghc-6.10: fix build on Darwin The initial MacOS X binaries have been linked to libgmp.dylib using some mad path in /opt that's now hard-coded into the program. Consequently, $DYLD_LIBRARY_PATH must contain the place where libgmp really is for those binaries to run correctly. Tested on i386-apple-darwin9.7.0. svn path=/nixpkgs/trunk/; revision=17873 --- pkgs/development/compilers/ghc/6.10.1-binary.nix | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pkgs/development/compilers/ghc/6.10.1-binary.nix b/pkgs/development/compilers/ghc/6.10.1-binary.nix index 2e1b5f2973d2..dd6e7890e1df 100644 --- a/pkgs/development/compilers/ghc/6.10.1-binary.nix +++ b/pkgs/development/compilers/ghc/6.10.1-binary.nix @@ -53,6 +53,7 @@ stdenv.mkDerivation rec { '' else ""); configurePhase = '' + ${if stdenv.isDarwin then "export DYLD_LIBRARY_PATH=${gmp}/lib" else ""} cp $(type -P pwd) utils/pwd/pwd ./configure --prefix=$out --with-gmp-libraries=${gmp}/lib --with-gmp-includes=${gmp}/include ''; @@ -71,19 +72,12 @@ stdenv.mkDerivation rec { postInstall = (if stdenv.isDarwin then '' - ensureDir $out/frameworks/GMP.framework/Versions/A - ln -s ${gmp}/lib/libgmp.dylib $out/frameworks/GMP.framework/GMP - ln -s ${gmp}/lib/libgmp.dylib $out/frameworks/GMP.framework/Versions/A/GMP - # !!! fix this - ensureDir $out/frameworks/GNUeditline.framework/Versions/A - ln -s ${libedit}/lib/libeditline.dylib $out/frameworks/GNUeditline.framework/GNUeditline - ln -s ${libedit}/lib/libeditline.dylib $out/frameworks/GNUeditline.framework/Versions/A/GNUeditline - mv $out/bin $out/bin-orig mkdir $out/bin for i in $(cd $out/bin-orig && ls); do echo "#! $SHELL -e" >> $out/bin/$i - echo "DYLD_FRAMEWORK_PATH=$out/frameworks exec $out/bin-orig/$i -framework-path $out/frameworks \"\$@\"" >> $out/bin/$i + echo "export DYLD_LIBRARY_PATH=\"${gmp}/lib:${libedit}/lib\"" >> $out/bin/$i + echo "exec $out/bin-orig/$i \"\$@\"" >> $out/bin/$i chmod +x $out/bin/$i done '' else "")