1 # This setup hook calls patchelf to automatically remove unneeded
2 # directories from the RPATH of every library or executable in every
5 fixupOutputHooks
+=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi')
9 [ -e "$dir" ] ||
return 0
11 echo "shrinking RPATHs of ELF executables and libraries in $dir"
14 while IFS
= read -r -d $
'\0' i
; do
15 if [[ "$i" =~ .build-id
]]; then continue; fi
16 if ! isELF
"$i"; then continue; fi
18 patchelf
--shrink-rpath "$i" || true
19 done < <(find "$dir" -type f
-print0)