Merge pull request #2743 from jwiegley/rpath
Correctly patch the rpath for GHC-built executables on Darwin
This commit is contained in:
commit
0df8ca2b52
@ -197,6 +197,9 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version;
|
|||||||
${optionalString (self.enableSharedExecutables && self.stdenv.isLinux) ''
|
${optionalString (self.enableSharedExecutables && self.stdenv.isLinux) ''
|
||||||
configureFlags+=" --ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.ghc.name}/${self.pname}-${self.version}";
|
configureFlags+=" --ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.ghc.name}/${self.pname}-${self.version}";
|
||||||
''}
|
''}
|
||||||
|
${optionalString (self.enableSharedExecutables && self.stdenv.isDarwin) ''
|
||||||
|
configureFlags+=" --ghc-option=-optl=-Wl,-headerpad_max_install_names";
|
||||||
|
''}
|
||||||
|
|
||||||
echo "configure flags: $extraConfigureFlags $configureFlags"
|
echo "configure flags: $extraConfigureFlags $configureFlags"
|
||||||
./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \
|
./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \
|
||||||
@ -256,6 +259,13 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version;
|
|||||||
ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
|
ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
${optionalString (self.enableSharedExecutables && self.isExecutable && self.stdenv.isDarwin) ''
|
||||||
|
for exe in $out/bin/* ; do
|
||||||
|
install_name_tool -add_rpath \
|
||||||
|
$out/lib/${ghc.ghc.name}/${self.pname}-${self.version} $exe
|
||||||
|
done
|
||||||
|
''}
|
||||||
|
|
||||||
eval "$postInstall"
|
eval "$postInstall"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user