Merge pull request #126557 from r-burns/autogen

[staging] autogen: fix patchelf invocation to remove generic build path from rpath
This commit is contained in:
Ryan Burns 2021-11-02 10:30:22 -07:00 committed by GitHub
commit 2d78d6e01b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,9 +86,9 @@ stdenv.mkDerivation rec {
done
'' + lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
# remove /build/** from RPATHs
# remove build directory (/build/**, or /tmp/nix-build-**) from RPATHs
for f in "$bin"/bin/*; do
local nrp="$(patchelf --print-rpath "$f" | sed -E 's@(:|^)/build/[^:]*:@\1@g')"
local nrp="$(patchelf --print-rpath "$f" | sed -E 's@(:|^)'$NIX_BUILD_TOP'[^:]*:@\1@g')"
patchelf --set-rpath "$nrp" "$f"
done
'';