From f716d092e257cdbc3811c1b3afa9cade01f6aa5d Mon Sep 17 00:00:00 2001 From: David McFarland Date: Sat, 24 Sep 2022 09:45:02 -0300 Subject: build-dotnet-module: limit package platforms by sdk support --- pkgs/build-support/dotnet/build-dotnet-module/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'pkgs/build-support/dotnet/build-dotnet-module/default.nix') diff --git a/pkgs/build-support/dotnet/build-dotnet-module/default.nix b/pkgs/build-support/dotnet/build-dotnet-module/default.nix index 54d03bc242b..286c0e87efc 100644 --- a/pkgs/build-support/dotnet/build-dotnet-module/default.nix +++ b/pkgs/build-support/dotnet/build-dotnet-module/default.nix @@ -83,6 +83,11 @@ } @ args: let + platforms = + if args ? meta.platforms + then lib.intersectLists args.meta.platforms dotnet-sdk.meta.platforms + else dotnet-sdk.meta.platforms; + inherit (callPackage ./hooks { inherit dotnet-sdk dotnet-test-sdk disabledTests nuget-source dotnet-runtime runtimeDeps buildType; }) dotnetConfigureHook dotnetBuildHook dotnetCheckHook dotnetInstallHook dotnetFixupHook; @@ -165,7 +170,7 @@ stdenvNoCC.mkDerivation (args // { in builtins.filter (flag: !(hasRid flag)) (dotnetFlags ++ dotnetRestoreFlags); - runtimeIds = map (system: dotnet-sdk.systemToDotnetRid system) (args.meta.platforms or dotnet-sdk.meta.platforms); + runtimeIds = map (system: dotnet-sdk.systemToDotnetRid system) platforms; in writeShellScript "fetch-${pname}-deps" '' set -euo pipefail @@ -254,7 +259,5 @@ stdenvNoCC.mkDerivation (args // { ''; } // args.passthru or { }; - meta = { - platforms = dotnet-sdk.meta.platforms; - } // args.meta or { }; + meta = (args.meta or { }) // { inherit platforms; }; }) -- cgit 1.4.1