diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-06-23 00:32:22 +0200 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-06-23 00:32:22 +0200 |
commit | 6402b188ddd100b3cd6afe7b8a3e553365203f43 (patch) | |
tree | 676b85e4a6ffee092e413e723f7dce8ba01bb48f /nixpkgs/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix | |
parent | 5a1826585861b32ce2509c0643e793196d81893e (diff) | |
parent | d603719ec6e294f034936c0d0dc06f689d91b6c3 (diff) | |
download | nixlib-6402b188ddd100b3cd6afe7b8a3e553365203f43.tar nixlib-6402b188ddd100b3cd6afe7b8a3e553365203f43.tar.gz nixlib-6402b188ddd100b3cd6afe7b8a3e553365203f43.tar.bz2 nixlib-6402b188ddd100b3cd6afe7b8a3e553365203f43.tar.lz nixlib-6402b188ddd100b3cd6afe7b8a3e553365203f43.tar.xz nixlib-6402b188ddd100b3cd6afe7b8a3e553365203f43.tar.zst nixlib-6402b188ddd100b3cd6afe7b8a3e553365203f43.zip |
Merge remote-tracking branch 'nixpkgs/nixos-unstable'
Diffstat (limited to 'nixpkgs/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix')
-rw-r--r-- | nixpkgs/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix | 75 |
1 files changed, 28 insertions, 47 deletions
diff --git a/nixpkgs/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix b/nixpkgs/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix index 7012ff36a4a5..b9c51a743c6a 100644 --- a/nixpkgs/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix +++ b/nixpkgs/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix @@ -4,30 +4,21 @@ , coreutils , zlib , openssl -, callPackage , makeSetupHook -, makeWrapper +, dotnetCorePackages + # Passed from ../default.nix , dotnet-sdk -, dotnet-test-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 = callPackage ({ }: - makeSetupHook { + dotnetConfigureHook = makeSetupHook + { name = "dotnet-configure-hook"; - propagatedBuildInputs = [ dotnet-sdk nuget-source ]; substitutions = { - nugetSource = nuget-source; + runtimeId = lib.escapeShellArg runtimeId; dynamicLinker = "${stdenv.cc}/nix-support/dynamic-linker"; libPath = lib.makeLibraryPath [ stdenv.cc.cc.lib @@ -36,54 +27,44 @@ in zlib openssl ]; - inherit runtimeId; }; - } ./dotnet-configure-hook.sh) { }; + } + ./dotnet-configure-hook.sh; - dotnetBuildHook = callPackage ({ }: - makeSetupHook { + dotnetBuildHook = makeSetupHook + { name = "dotnet-build-hook"; - propagatedBuildInputs = [ dotnet-sdk ]; substitutions = { - inherit buildType runtimeId; + runtimeId = lib.escapeShellArg runtimeId; }; - } ./dotnet-build-hook.sh) { }; + } + ./dotnet-build-hook.sh; - dotnetCheckHook = callPackage ({ }: - makeSetupHook { + dotnetCheckHook = makeSetupHook + { name = "dotnet-check-hook"; - propagatedBuildInputs = [ dotnet-test-sdk ]; 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) { }; + } + ./dotnet-check-hook.sh; - dotnetInstallHook = callPackage ({ }: - makeSetupHook { + dotnetInstallHook = makeSetupHook + { name = "dotnet-install-hook"; - propagatedBuildInputs = [ dotnet-sdk ]; substitutions = { - inherit buildType runtimeId; + runtimeId = lib.escapeShellArg runtimeId; }; - } ./dotnet-install-hook.sh) { }; + } + ./dotnet-install-hook.sh; - dotnetFixupHook = callPackage ({ }: - makeSetupHook { + dotnetFixupHook = makeSetupHook + { name = "dotnet-fixup-hook"; - propagatedBuildInputs = [ dotnet-runtime ]; 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) { }; + } + ./dotnet-fixup-hook.sh; } |