patch-nupkgs: patch executables only

This commit is contained in:
David McFarland 2024-04-03 20:05:07 -03:00
parent b3b68a6687
commit ff5be75ede
1 changed files with 3 additions and 1 deletions

View File

@ -44,7 +44,9 @@ in writeShellScriptBin "patch-nupkgs" ''
echo "Patching package $x"
pushd "$x"
for p in $(find -type f); do
if [[ "$p" != *.nix-patched ]] && isELF "$p"; then
if [[ "$p" != *.nix-patched ]] \
&& isELF "$p" \
&& patchelf --print-interpreter "$p" &>/dev/null; then
tmp="$p".$$.nix-patched
# if this fails to copy then another process must have patched it
cp --reflink=auto "$p" "$tmp" || continue