about summary refs log tree commit diff
path: root/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix')
-rw-r--r--pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix36
1 files changed, 8 insertions, 28 deletions
diff --git a/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix b/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix
index 44091604f5c2c..b9c51a743c6a6 100644
--- a/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix
+++ b/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix
@@ -4,28 +4,21 @@
 , coreutils
 , zlib
 , openssl
-, callPackage
 , makeSetupHook
-, makeWrapper
+, dotnetCorePackages
+  # Passed from ../default.nix
 , dotnet-sdk
-, disabledTests
-, nuget-source
 , dotnet-runtime
-, runtimeDeps
-, buildType
-, runtimeId
 }:
-assert (builtins.isString runtimeId);
-
 let
-  libraryPath = lib.makeLibraryPath runtimeDeps;
+  runtimeId = dotnetCorePackages.systemToDotnetRid stdenv.hostPlatform.system;
 in
 {
   dotnetConfigureHook = makeSetupHook
     {
       name = "dotnet-configure-hook";
       substitutions = {
-        nugetSource = nuget-source;
+        runtimeId = lib.escapeShellArg runtimeId;
         dynamicLinker = "${stdenv.cc}/nix-support/dynamic-linker";
         libPath = lib.makeLibraryPath [
           stdenv.cc.cc.lib
@@ -34,7 +27,6 @@ in
           zlib
           openssl
         ];
-        inherit runtimeId;
       };
     }
     ./dotnet-configure-hook.sh;
@@ -43,7 +35,7 @@ in
     {
       name = "dotnet-build-hook";
       substitutions = {
-        inherit buildType runtimeId;
+        runtimeId = lib.escapeShellArg runtimeId;
       };
     }
     ./dotnet-build-hook.sh;
@@ -52,15 +44,7 @@ in
     {
       name = "dotnet-check-hook";
       substitutions = {
-        inherit buildType runtimeId libraryPath;
-        disabledTests = lib.optionalString (disabledTests != [ ])
-          (
-            let
-              escapedNames = lib.lists.map (n: lib.replaceStrings [ "," ] [ "%2C" ] n) disabledTests;
-              filters = lib.lists.map (n: "FullyQualifiedName!=${n}") escapedNames;
-            in
-            "${lib.concatStringsSep "&" filters}"
-          );
+        runtimeId = lib.escapeShellArg runtimeId;
       };
     }
     ./dotnet-check-hook.sh;
@@ -69,7 +53,7 @@ in
     {
       name = "dotnet-install-hook";
       substitutions = {
-        inherit buildType runtimeId;
+        runtimeId = lib.escapeShellArg runtimeId;
       };
     }
     ./dotnet-install-hook.sh;
@@ -79,11 +63,7 @@ in
       name = "dotnet-fixup-hook";
       substitutions = {
         dotnetRuntime = dotnet-runtime;
-        runtimeDeps = libraryPath;
-        shell = stdenv.shell;
-        which = "${which}/bin/which";
-        dirname = "${coreutils}/bin/dirname";
-        realpath = "${coreutils}/bin/realpath";
+        wrapperPath = lib.makeBinPath [ which coreutils ];
       };
     }
     ./dotnet-fixup-hook.sh;