Commit bd934093 authored by David McFarland's avatar David McFarland
Browse files

dotnet: patch apphost as well as singlefilehost

This fixes library loading in self-contained builds.
parent 81693c96
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ assert if type == "sdk" then packages != null else true;
, writeShellScript
, mkNugetDeps
, callPackage
, dotnetCorePackages
}:

let
@@ -44,6 +45,8 @@ let

  mkCommon = callPackage ./common.nix {};

  targetRid = dotnetCorePackages.systemToDotnetRid stdenv.targetPlatform.system;

in
mkCommon type rec {
  inherit pname version;
@@ -88,21 +91,21 @@ mkCommon type rec {

  # Tell autoPatchelf about runtime dependencies.
  # (postFixup phase is run before autoPatchelfHook.)
  postFixup = lib.optionalString stdenv.isLinux ''
  postFixup = lib.optionalString stdenv.targetPlatform.isLinux ''
    patchelf \
      --add-needed libicui18n.so \
      --add-needed libicuuc.so \
      $out/shared/Microsoft.NETCore.App/*/libcoreclr.so \
      $out/shared/Microsoft.NETCore.App/*/*System.Globalization.Native.so \
      $out/packs/Microsoft.NETCore.App.Host.linux-x64/*/runtimes/linux-x64/native/singlefilehost
      $out/packs/Microsoft.NETCore.App.Host.${targetRid}/*/runtimes/${targetRid}/native/*host
    patchelf \
      --add-needed libgssapi_krb5.so \
      $out/shared/Microsoft.NETCore.App/*/*System.Net.Security.Native.so \
      $out/packs/Microsoft.NETCore.App.Host.linux-x64/*/runtimes/linux-x64/native/singlefilehost
      $out/packs/Microsoft.NETCore.App.Host.${targetRid}/*/runtimes/${targetRid}/native/*host
    patchelf \
      --add-needed libssl.so \
      $out/shared/Microsoft.NETCore.App/*/*System.Security.Cryptography.Native.OpenSsl.so \
      $out/packs/Microsoft.NETCore.App.Host.linux-x64/*/runtimes/linux-x64/native/singlefilehost
      $out/packs/Microsoft.NETCore.App.Host.${targetRid}/*/runtimes/${targetRid}/native/*host
  '';

  passthru = {