treewide: Use makeLibraryPath in 'patchelf --set-rpath' calls

This commit is contained in:
Tuomas Tynkkynen 2016-08-23 00:04:39 +03:00
parent d559c07bbe
commit 51ad423716
10 changed files with 11 additions and 11 deletions

View File

@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
interpreter=$(echo ${stdenv.glibc.out}/lib/ld-linux*.so.2)
libCairo=$out/eclipse/libcairo-swt.so
patchelf --set-interpreter $interpreter $out/eclipse/eclipse
[ -f $libCairo ] && patchelf --set-rpath ${freetype}/lib:${fontconfig}/lib:${libX11}/lib:${libXrender}/lib:${zlib}/lib $libCairo
[ -f $libCairo ] && patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ freetype fontconfig libX11 libXrender zlib ]} $libCairo
# Create wrapper script. Pass -configuration to store
# settings in ~/.eclipse/org.eclipse.platform_<version> rather
@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
makeWrapper $out/eclipse/eclipse $out/bin/eclipse \
--prefix PATH : ${jdk}/bin \
--prefix LD_LIBRARY_PATH : ${glib}/lib:${gtk.out}/lib:${libXtst}/lib${stdenv.lib.optionalString (webkitgtk2 != null) ":${webkitgtk2}/lib"} \
--prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath ([ glib gtk libXtst ] ++ stdenv.lib.optional (webkitgtk2 != null) webkitgtk2)} \
--add-flags "-configuration \$HOME/.eclipse/''${productId}_$productVersion/configuration"
# Create desktop item.

View File

@ -75,7 +75,7 @@ stdenv.mkDerivation {
for i in lib/VBoxOGL*.so
do
patchelf --set-rpath $out/lib:${dbus.lib}/lib:${libXcomposite.out}/lib:${libXdamage.out}/lib:${libXext.out}/lib:${libXfixes.out}/lib $i
patchelf --set-rpath ${lib.makeLibraryPath [ "$out" dbus libXcomposite libXdamage libXext libXfixes ]} $i
done
# FIXME: Virtualbox 4.3.22 moved VBoxClient-all (required by Guest Additions

View File

@ -34,7 +34,7 @@ stdenv.mkDerivation {
for f in $(find $out); do
if [ -f "$f" ] && patchelf "$f" 2> /dev/null; then
patchelf --set-interpreter ${getLib glibc}/lib/ld-linux.so.2 \
--set-rpath $out/lib:${getLib gcc}/lib:${ncurses.out}/lib \
--set-rpath ${stdenv.lib.makeLibraryPath [ "$out" gcc ncurses ]} \
"$f" || true
fi
done

View File

@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
(if stdenv.isLinux then ''
find . -type f -perm -0100 \
-exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${libedit}/lib:${ncurses5.out}/lib:${gmp.out}/lib" {} \;
--set-rpath "${lib.makeLibraryPath [ libedit ncurses5 gmp ]}" {} \;
for prog in ld ar gcc strip ranlib; do
find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
done

View File

@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
stdenv.lib.optionalString stdenv.isLinux ''
find . -type f -perm -0100 \
-exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${ncurses5.out}/lib:${gmp.out}/lib" {} \;
--set-rpath "${stdenv.lib.makeLibraryPath [ ncurses5 gmp ]}" {} \;
sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
for prog in ld ar gcc strip ranlib; do

View File

@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
ln -sv "${ncurses5.out}/lib/libncurses.so" "$out/lib/libncurses${stdenv.lib.optionalString stdenv.is64bit "w"}.so.5"
find . -type f -perm -0100 \
-exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "$out/lib:${gmp.out}/lib" {} \;
--set-rpath "${stdenv.lib.makeLibraryPath [ "$out" gmp ]}" {} \;
sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
for prog in ld ar gcc strip ranlib; do

View File

@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
\( -type f -a -name "*.so*" \) -o \
\( -type f -a -perm -0100 \) \
\) -exec patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-*so.? \
--set-rpath ${zlib.out}/lib:${ncurses.out}/lib {} \;
--set-rpath ${stdenv.lib.makeLibraryPath [ zlib ncurses ]} {} \;
# fix ineffective PROGDIR / MYNDKDIR determination
for i in ndk-build ndk-gdb ndk-gdb-py
do

View File

@ -50,7 +50,7 @@ buildPythonPackage rec {
function fixRunPath {
p=$(patchelf --print-rpath $1)
patchelf --set-rpath "$p:${cudatoolkit}/lib:${clblas}/lib:${nvidia_x11}/lib" $1
patchelf --set-rpath "$p:${stdenv.lib.makeLibraryPath [ cudatoolkit clblas nvidia_x11 ]}" $1
}
fixRunPath Install/lib/libgpuarray.so

View File

@ -25,7 +25,7 @@ stdenv.mkDerivation {
cp -r * $out/res
patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 \
--set-rpath ${stdenv.cc.cc.lib}/lib:${libX11}/lib:${mesa}/lib \
--set-rpath ${stdenv.lib.makeLibraryPath [ stdenv.cc.cc libX11 mesa ]} \
"$out/res/Tibia"
# We've patchelf'd the files. The main Tibia binary is a bit

View File

@ -52,7 +52,7 @@ in stdenv.mkDerivation rec {
mkdir -p $out/lib/sane
my_patchelf \
--set-rpath $(cat $NIX_CC/nix-support/orig-cc)/lib:${stdenv.glibc}/lib:${libusb}/lib:${libxml2}/lib \
--set-rpath $(cat $NIX_CC/nix-support/orig-cc)/lib:${stdenv.lib.makeLibraryPath [ stdenv.glibc libusb libxml2 ] } \
- ${arch}/libsane-smfp.so*
install -m755 ${arch}/libsane-smfp.so* $out/lib/sane
ln -s libsane-smfp.so.1.0.1 $out/lib/sane/libsane-smfp.so.1