Move RPATH shrinking from stdenv to a setup hook provided by patchelf
This commit is contained in:
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "c99f84d124347340c36707089ec8f70530abd56e7827c54d506eb4cc097a17e7";
|
||||
};
|
||||
|
||||
setupHook = [ ./setup-hook.sh ];
|
||||
|
||||
meta = {
|
||||
homepage = http://nixos.org/patchelf.html;
|
||||
license = "GPL";
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# This setup hook calls patchelf to automatically remove unneeded
|
||||
# directories from the RPATH of every library or executable in every
|
||||
# output.
|
||||
|
||||
if [ -z "$dontPatchELF" ]; then
|
||||
addHook fixupOutput 'patchELF "$prefix"'
|
||||
fi
|
||||
|
||||
patchELF() {
|
||||
header "patching ELF executables and libraries in $prefix"
|
||||
if [ -e "$prefix" ]; then
|
||||
find "$prefix" \( \
|
||||
\( -type f -a -name "*.so*" \) -o \
|
||||
\( -type f -a -perm +0100 \) \
|
||||
\) -print -exec patchelf --shrink-rpath '{}' \;
|
||||
fi
|
||||
stopNest
|
||||
}
|
||||
Reference in New Issue
Block a user