···11+# This setup hook calls patchelf to automatically remove unneeded
22+# directories from the RPATH of every library or executable in every
33+# output.
44+55+if [ -z "$dontPatchELF" ]; then
66+ addHook fixupOutput 'patchELF "$prefix"'
77+fi
88+99+patchELF() {
1010+ header "patching ELF executables and libraries in $prefix"
1111+ if [ -e "$prefix" ]; then
1212+ find "$prefix" \( \
1313+ \( -type f -a -name "*.so*" \) -o \
1414+ \( -type f -a -perm +0100 \) \
1515+ \) -print -exec patchelf --shrink-rpath '{}' \;
1616+ fi
1717+ stopNest
1818+}
-17
pkgs/stdenv/generic/setup.sh
···702702}
703703704704705705-patchELF() {
706706- # Patch all ELF executables and shared libraries.
707707- header "patching ELF executables and libraries"
708708- if [ -e "$prefix" ]; then
709709- find "$prefix" \( \
710710- \( -type f -a -name "*.so*" \) -o \
711711- \( -type f -a -perm +0100 \) \
712712- \) -print -exec patchelf --shrink-rpath '{}' \;
713713- fi
714714- stopNest
715715-}
716716-717717-718705patchShebangs() {
719706 # Rewrite all script interpreter file names (`#! /path') under the
720707 # specified directory tree to paths found in $PATH. E.g.,
···884871 if [ -n "$stripAllList" ]; then
885872 stripDirs "$stripAllList" "${stripAllFlags:--s}"
886873 fi
887887- fi
888888-889889- if [ "$havePatchELF" = 1 -a -z "$dontPatchELF" ]; then
890890- patchELF "$prefix"
891874 fi
892875893876 if [ -z "$dontPatchShebangs" ]; then