···1+# This setup hook calls patchelf to automatically remove unneeded
2+# directories from the RPATH of every library or executable in every
3+# output.
4+5+if [ -z "$dontPatchELF" ]; then
6+ addHook fixupOutput 'patchELF "$prefix"'
7+fi
8+9+patchELF() {
10+ header "patching ELF executables and libraries in $prefix"
11+ if [ -e "$prefix" ]; then
12+ find "$prefix" \( \
13+ \( -type f -a -name "*.so*" \) -o \
14+ \( -type f -a -perm +0100 \) \
15+ \) -print -exec patchelf --shrink-rpath '{}' \;
16+ fi
17+ stopNest
18+}
-17
pkgs/stdenv/generic/setup.sh
···702}
703704705-patchELF() {
706- # Patch all ELF executables and shared libraries.
707- header "patching ELF executables and libraries"
708- if [ -e "$prefix" ]; then
709- find "$prefix" \( \
710- \( -type f -a -name "*.so*" \) -o \
711- \( -type f -a -perm +0100 \) \
712- \) -print -exec patchelf --shrink-rpath '{}' \;
713- fi
714- stopNest
715-}
716-717-718patchShebangs() {
719 # Rewrite all script interpreter file names (`#! /path') under the
720 # specified directory tree to paths found in $PATH. E.g.,
···884 if [ -n "$stripAllList" ]; then
885 stripDirs "$stripAllList" "${stripAllFlags:--s}"
886 fi
887- fi
888-889- if [ "$havePatchELF" = 1 -a -z "$dontPatchELF" ]; then
890- patchELF "$prefix"
891 fi
892893 if [ -z "$dontPatchShebangs" ]; then
···702}
7037040000000000000705patchShebangs() {
706 # Rewrite all script interpreter file names (`#! /path') under the
707 # specified directory tree to paths found in $PATH. E.g.,
···871 if [ -n "$stripAllList" ]; then
872 stripDirs "$stripAllList" "${stripAllFlags:--s}"
873 fi
0000874 fi
875876 if [ -z "$dontPatchShebangs" ]; then