···51 dotnetRestore "$project"
52 done
5354+ echo "Fixing up native binaries..."
55+ # Find all native binaries and nuget libraries, and fix them up,
56+ # by setting the proper interpreter and rpath to some commonly used libraries
57+ for binary in $(find "$HOME/.nuget/packages/" -type f -executable); do
58+ if patchelf --print-interpreter "$binary" >/dev/null 2>/dev/null; then
59+ echo "Found binary: $binary, fixing it up..."
60+ patchelf --set-interpreter "$(cat "@dynamicLinker@")" "$binary"
61+62+ # This makes sure that if the binary requires some specific runtime dependencies, it can find it.
63+ # This fixes dotnet-built binaries like crossgen2
64+ patchelf \
65+ --add-needed libicui18n.so \
66+ --add-needed libicuuc.so \
67+ --add-needed libz.so \
68+ --add-needed libssl.so \
69+ "$binary"
70+71+ patchelf --set-rpath "@libPath@" "$binary"
72+ fi
73+ done
74+75 runHook postConfigure
7677 echo "Finished dotnetConfigureHook"