patch-nupkgs: add references to dynamically loaded libs

This is what we do in buildDotnetModule. Eventually I'd like to use this
script there as well.
This commit is contained in:
David McFarland 2024-04-03 20:05:46 -03:00
parent ff5be75ede
commit 9b13927fd0
1 changed files with 8 additions and 0 deletions

View File

@ -54,6 +54,14 @@ in writeShellScriptBin "patch-nupkgs" ''
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 \
--add-needed libicui18n.so \
--add-needed libicuuc.so \
--add-needed libz.so \
--add-needed libssl.so \
"$tmp"
patchelf \
--add-rpath "${binaryRPath}" \
"$tmp" ||: