summary refs log tree commit diff
path: root/pkgs/build-support/dotnet/build-dotnet-module/default.nix
diff options
context:
space:
mode:
authorDavid McFarland <corngood@gmail.com>2022-09-24 09:45:02 -0300
committerDavid McFarland <corngood@gmail.com>2022-10-02 16:09:27 -0300
commitf716d092e257cdbc3811c1b3afa9cade01f6aa5d (patch)
tree887f936adcf577cfb0078f08defee71fcdcb1eea /pkgs/build-support/dotnet/build-dotnet-module/default.nix
parentb9f528897f930fd28d93a75bde512d172a876f2b (diff)
downloadnixpkgs-f716d092e257cdbc3811c1b3afa9cade01f6aa5d.tar
nixpkgs-f716d092e257cdbc3811c1b3afa9cade01f6aa5d.tar.gz
nixpkgs-f716d092e257cdbc3811c1b3afa9cade01f6aa5d.tar.bz2
nixpkgs-f716d092e257cdbc3811c1b3afa9cade01f6aa5d.tar.lz
nixpkgs-f716d092e257cdbc3811c1b3afa9cade01f6aa5d.tar.xz
nixpkgs-f716d092e257cdbc3811c1b3afa9cade01f6aa5d.tar.zst
nixpkgs-f716d092e257cdbc3811c1b3afa9cade01f6aa5d.zip
build-dotnet-module: limit package platforms by sdk support
Diffstat (limited to 'pkgs/build-support/dotnet/build-dotnet-module/default.nix')
-rw-r--r--pkgs/build-support/dotnet/build-dotnet-module/default.nix11
1 files changed, 7 insertions, 4 deletions
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; };
 })