[Nix-dev] [PATCH 4/4] ghc-6.10: fix build on Darwin

Peter Simons simons at cryp.to
Thu Oct 8 14:25:51 CEST 2009


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.
---
 pkgs/development/compilers/ghc/6.10.1-binary.nix |   12 +++---------
 1 files 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 2e1b5f2..dd6e789 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 "")
-- 
1.6.4.4




More information about the nix-dev mailing list