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
This commit is contained in:
Peter Simons 2009-10-19 09:17:40 +00:00
parent f947a05759
commit 6b28b25453
1 changed files with 3 additions and 9 deletions

View File

@ -53,6 +53,7 @@ stdenv.mkDerivation rec {
'' else ""); '' else "");
configurePhase = '' configurePhase = ''
${if stdenv.isDarwin then "export DYLD_LIBRARY_PATH=${gmp}/lib" else ""}
cp $(type -P pwd) utils/pwd/pwd cp $(type -P pwd) utils/pwd/pwd
./configure --prefix=$out --with-gmp-libraries=${gmp}/lib --with-gmp-includes=${gmp}/include ./configure --prefix=$out --with-gmp-libraries=${gmp}/lib --with-gmp-includes=${gmp}/include
''; '';
@ -71,19 +72,12 @@ stdenv.mkDerivation rec {
postInstall = postInstall =
(if stdenv.isDarwin then (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 mv $out/bin $out/bin-orig
mkdir $out/bin mkdir $out/bin
for i in $(cd $out/bin-orig && ls); do for i in $(cd $out/bin-orig && ls); do
echo "#! $SHELL -e" >> $out/bin/$i 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 chmod +x $out/bin/$i
done done
'' else "") '' else "")