mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
dotnetCorePackages.patchNupkgs: explicitly reference patchelf
This commit is contained in:
parent
7f726285b0
commit
65b556ed83
@ -7,6 +7,7 @@
|
||||
, libuuid
|
||||
, openssl
|
||||
, lttng-ust_2_12
|
||||
, patchelf
|
||||
, writeShellScriptBin
|
||||
}:
|
||||
|
||||
@ -43,23 +44,23 @@ in writeShellScriptBin "patch-nupkgs" (''
|
||||
find "$x" -type f -print0 | while IFS= read -rd "" p; do
|
||||
if [[ "$p" != *.nix-patched ]] \
|
||||
&& isELF "$p" \
|
||||
&& patchelf --print-interpreter "$p" &>/dev/null; then
|
||||
&& ${patchelf}/bin/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
|
||||
echo "Patchelfing $p as $tmp"
|
||||
patchelf \
|
||||
${patchelf}/bin/patchelf \
|
||||
--set-interpreter "${stdenv.cc.bintools.dynamicLinker}" \
|
||||
"$tmp" ||:
|
||||
# This makes sure that if the binary requires some specific runtime dependencies, it can find it.
|
||||
# This fixes dotnet-built binaries like crossgen2
|
||||
patchelf \
|
||||
${patchelf}/bin/patchelf \
|
||||
--add-needed libicui18n.so \
|
||||
--add-needed libicuuc.so \
|
||||
--add-needed libz.so \
|
||||
--add-needed libssl.so \
|
||||
"$tmp"
|
||||
patchelf \
|
||||
${patchelf}/bin/patchelf \
|
||||
--add-rpath "${binaryRPath}" \
|
||||
"$tmp" ||:
|
||||
mv "$tmp" "$p"
|
||||
|
Loading…
Reference in New Issue
Block a user