Skip to content

Commit

Permalink
rust-overlay: Fix missing libz.so.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr authored and nbp committed Jul 2, 2020
1 parent e424ea2 commit ab9b53e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions rust-overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,19 @@ let
if [[ "$i" =~ .build-id ]]; then continue; fi
if ! isELF "$i"; then continue; fi
echo "setting interpreter of $i"
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
"$i" || true
if [[ -x "$i" ]]; then
# Handle executables
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${super.lib.makeLibraryPath [ self.zlib ]}:$out/lib" \
"$i" || true
else
# Handle libraries
patchelf \
--set-rpath "${super.lib.makeLibraryPath [ self.zlib ]}:$out/lib" \
"$i" || true
fi
done < <(find "$dir" -type f -print0)
}
Expand Down

0 comments on commit ab9b53e

Please sign in to comment.