From d03e4ffdbf9849f7e928c7a95be76aac69780c55 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 19 Nov 2018 17:18:27 +0100 Subject: 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 --- pkgs/build-support/setup-hooks/auto-patchelf.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkgs/build-support/setup-hooks') diff --git a/pkgs/build-support/setup-hooks/auto-patchelf.sh b/pkgs/build-support/setup-hooks/auto-patchelf.sh index d1ae317ff9a4..59e9a933211f 100644 --- a/pkgs/build-support/setup-hooks/auto-patchelf.sh +++ b/pkgs/build-support/setup-hooks/auto-patchelf.sh @@ -153,7 +153,7 @@ autoPatchelf() { # Add all shared objects of the current output path to the start of # cachedDependencies so that it's choosen first in findDependency. cachedDependencies+=( - $(find "$prefix" \! -type d \( -name '*.so' -o -name '*.so.*' \)) + $(find "$@" \! -type d \( -name '*.so' -o -name '*.so.*' \)) ) local elffile @@ -169,7 +169,7 @@ autoPatchelf() { LANG=C readelf -l "$file" | grep -q "^ *INTERP\\>" || continue fi 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 @@ -181,5 +181,5 @@ autoPatchelf() { # behaviour as fixupOutputHooks because the setup hook for patchelf is run in # fixupOutput and the postFixup hook runs later. postFixupHooks+=( - 'for output in $outputs; do prefix="${!output}" autoPatchelf; done' + 'autoPatchelf $(for output in $outputs; do echo "${!output}"; done)' ) -- cgit 1.4.1