From 11f1207418d43921a59931bc0f85a8397dadb4d0 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Fri, 25 Sep 2026 15:10:04 -0400 Subject: [PATCH] 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. --- pkgs/delta/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/delta/default.nix b/pkgs/delta/default.nix index a566170..459a180 100644 --- a/pkgs/delta/default.nix +++ b/pkgs/delta/default.nix @@ -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