pkgs/delta: fix RPATH and set interpreter
The patchelf package ships a setup hook that runs 'patchelf --shrink-rpath' on every ELF during fixup, which rewrites DT_RPATH as DT_RUNPATH. RUNPATH is not inherited by the bundled libs, so libXau.so.6 and friends were not found. Set dontPatchELF to keep the RPATH, and set the interpreter to the NixOS glibc instead of relying on /lib64.
This commit is contained in:
1 parent
b615811418
commit
11f1207418
1 file changed
+5
-2
@@ -55,8 +55,10 @@ stdenvNoCC.mkDerivation {
|
||||
|
||||
nativeBuildInputs = [ patchelf makeWrapper ];
|
||||
|
||||
# Keep the RPATH we set below (don't let fixup shrink it).
|
||||
dontShrinkRPath = true;
|
||||
# patchelf ships a setup hook that runs `patchelf --shrink-rpath` on every
|
||||
# ELF during fixup, which rewrites DT_RPATH as DT_RUNPATH. Disable it so the
|
||||
# RPATH we set below survives (RUNPATH is not inherited by the bundled libs).
|
||||
dontPatchELF = true;
|
||||
|
||||
unpackPhase = ''
|
||||
runHook preUnpack
|
||||
@@ -76,6 +78,7 @@ stdenvNoCC.mkDerivation {
|
||||
# bundled libs) instead of DT_RUNPATH (not inherited).
|
||||
patchelf \
|
||||
--force-rpath \
|
||||
--set-interpreter ${glibc}/lib/ld-linux-x86-64.so.2 \
|
||||
--set-rpath '$ORIGIN/../lib:${glibc}/lib' \
|
||||
$out/lib/delta/bin/delta
|
||||
|
||||
|
||||
Reference in new issue
Block a user