autoPatchelfHook: Make easier to run autoPatchelf
The autoPatchelf main function which is run against all of the outputs was pretty much tailored towards this specific setup-hook and was relying on $prefix to be set globally. So if you wanted to run autoPatchelf manually - let's say during buildPhase - you would have needed to run it like this: prefix=/some/directory autoPatchelf This is now more intuitive and all you need to do is run the following: autoPatchelf /some/directory Signed-off-by: aszlig <aszlig@nix.build>
This commit is contained in:
parent
3ae0407d3c
commit
d03e4ffdbf
@ -153,7 +153,7 @@ autoPatchelf() {
|
|||||||
# Add all shared objects of the current output path to the start of
|
# Add all shared objects of the current output path to the start of
|
||||||
# cachedDependencies so that it's choosen first in findDependency.
|
# cachedDependencies so that it's choosen first in findDependency.
|
||||||
cachedDependencies+=(
|
cachedDependencies+=(
|
||||||
$(find "$prefix" \! -type d \( -name '*.so' -o -name '*.so.*' \))
|
$(find "$@" \! -type d \( -name '*.so' -o -name '*.so.*' \))
|
||||||
)
|
)
|
||||||
local elffile
|
local elffile
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ autoPatchelf() {
|
|||||||
LANG=C readelf -l "$file" | grep -q "^ *INTERP\\>" || continue
|
LANG=C readelf -l "$file" | grep -q "^ *INTERP\\>" || continue
|
||||||
fi
|
fi
|
||||||
autoPatchelfFile "$file"
|
autoPatchelfFile "$file"
|
||||||
done < <(find "$prefix" -type f -print0)
|
done < <(find "$@" -type f -print0)
|
||||||
}
|
}
|
||||||
|
|
||||||
# XXX: This should ultimately use fixupOutputHooks but we currently don't have
|
# XXX: This should ultimately use fixupOutputHooks but we currently don't have
|
||||||
@ -181,5 +181,5 @@ autoPatchelf() {
|
|||||||
# behaviour as fixupOutputHooks because the setup hook for patchelf is run in
|
# behaviour as fixupOutputHooks because the setup hook for patchelf is run in
|
||||||
# fixupOutput and the postFixup hook runs later.
|
# fixupOutput and the postFixup hook runs later.
|
||||||
postFixupHooks+=(
|
postFixupHooks+=(
|
||||||
'for output in $outputs; do prefix="${!output}" autoPatchelf; done'
|
'autoPatchelf $(for output in $outputs; do echo "${!output}"; done)'
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user