forked from mirrors/nixpkgs
patchELF: Accept a directory argument
This commit is contained in:
parent
719f100491
commit
45a74943b1
|
@ -666,14 +666,15 @@ checkPhase() {
|
||||||
|
|
||||||
patchELF() {
|
patchELF() {
|
||||||
# Patch all ELF executables and shared libraries.
|
# Patch all ELF executables and shared libraries.
|
||||||
header "patching ELF executables and libraries"
|
local dir="$1"
|
||||||
if [ -e "$prefix" ]; then
|
if [ -e "$dir" ]; then
|
||||||
find "$prefix" \( \
|
header "patching ELF executables and libraries in $dir"
|
||||||
|
find "$dir" \( \
|
||||||
\( -type f -a -name "*.so*" \) -o \
|
\( -type f -a -name "*.so*" \) -o \
|
||||||
\( -type f -a -perm +0100 \) \
|
\( -type f -a -perm +0100 \) \
|
||||||
\) -print -exec patchelf --shrink-rpath {} \;
|
\) -print -exec patchelf --shrink-rpath {} \;
|
||||||
fi
|
|
||||||
stopNest
|
stopNest
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -682,8 +683,8 @@ patchShebangs() {
|
||||||
# specified directory tree to paths found in $PATH. E.g.,
|
# specified directory tree to paths found in $PATH. E.g.,
|
||||||
# /bin/sh will be rewritten to /nix/store/<hash>-some-bash/bin/sh.
|
# /bin/sh will be rewritten to /nix/store/<hash>-some-bash/bin/sh.
|
||||||
# Interpreters that are already in the store are left untouched.
|
# Interpreters that are already in the store are left untouched.
|
||||||
header "patching script interpreter paths"
|
|
||||||
local dir="$1"
|
local dir="$1"
|
||||||
|
header "patching script interpreter paths in $dir"
|
||||||
local f
|
local f
|
||||||
for f in $(find "$dir" -type f -perm +0100); do
|
for f in $(find "$dir" -type f -perm +0100); do
|
||||||
local oldPath=$(sed -ne '1 s,^#![ ]*\([^ ]*\).*$,\1,p' "$f")
|
local oldPath=$(sed -ne '1 s,^#![ ]*\([^ ]*\).*$,\1,p' "$f")
|
||||||
|
|
Loading…
Reference in a new issue