mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
Merge pull request #210908 from Yarny0/auto-patchelf
autoPatchelfHook: fix symlink handling
This commit is contained in:
commit
aa7cfc3aed
@ -131,7 +131,14 @@ def populate_cache(initial: List[Path], recursive: bool =False) -> None:
|
||||
if not path.is_file():
|
||||
continue
|
||||
|
||||
# As an optimisation, resolve the symlinks here, as the target is unique
|
||||
# XXX: (layus, 2022-07-25) is this really an optimisation in all cases ?
|
||||
# It could make the rpath bigger or break the fragile precedence of $out.
|
||||
resolved = path.resolve()
|
||||
# Do not use resolved paths when names do not match
|
||||
if resolved.name != path.name:
|
||||
resolved = path
|
||||
|
||||
try:
|
||||
with open_elf(path) as elf:
|
||||
osabi = get_osabi(elf)
|
||||
|
@ -159,16 +159,6 @@ let
|
||||
ln --symbolic --force --no-target-directory "$out/$(cut -b 7- <<< "$target")" "$link"
|
||||
done
|
||||
'';
|
||||
|
||||
# since 7b9fd5d1c9802131ca0a01ff08a3ff64379d2df4
|
||||
# autopatchelf misses to add $out/lib to rpath;
|
||||
# we have to call autopatchelf manually as it would
|
||||
# run too late and overwrite our rpath otherwise
|
||||
dontAutoPatchelf = true;
|
||||
postFixup = ''
|
||||
autoPatchelf $out
|
||||
patchelf --add-rpath $out/lib $out/lib/*
|
||||
'';
|
||||
};
|
||||
|
||||
binPath = lib.makeBinPath ([ acl gnugrep procps ]
|
||||
|
Loading…
Reference in New Issue
Block a user