summary refs log tree commit diff
path: root/pkgs/stdenv/generic/check-meta.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/stdenv/generic/check-meta.nix')
-rw-r--r--pkgs/stdenv/generic/check-meta.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix
index 113b95f3ab0..2f4ff62f767 100644
--- a/pkgs/stdenv/generic/check-meta.nix
+++ b/pkgs/stdenv/generic/check-meta.nix
@@ -165,6 +165,7 @@ let
     isFcitxEngine = bool;
     isIbusEngine = bool;
     isGutenprint = bool;
+    badPlatforms = platforms;
   };
 
   checkMetaAttr = k: v:
@@ -174,7 +175,8 @@ let
   checkMeta = meta: if shouldCheckMeta then lib.remove null (lib.mapAttrsToList checkMetaAttr meta) else [];
 
   checkPlatform = attrs:
-    lib.any (lib.meta.platformMatch hostPlatform) attrs.meta.platforms;
+    (!(attrs ? meta.platforms) || lib.any (lib.meta.platformMatch hostPlatform) attrs.meta.platforms) &&
+    (!(attrs ? meta.badPlatforms && lib.any (lib.meta.platformMatch hostPlatform) attrs.meta.badPlatforms));
 
   # Check if a derivation is valid, that is whether it passes checks for
   # e.g brokenness or license.
@@ -189,7 +191,7 @@ let
       { valid = false; reason = "blacklisted"; errormsg = "has a blacklisted license (‘${showLicense attrs.meta.license}’)"; }
     else if !allowBroken && attrs.meta.broken or false then
       { valid = false; reason = "broken"; errormsg = "is marked as broken"; }
-    else if !allowUnsupportedSystem && !allowBroken && attrs.meta.platforms or null != null && !(checkPlatform attrs) then
+    else if !allowUnsupportedSystem && !allowBroken && !(checkPlatform attrs) then
       { valid = false; reason = "broken"; errormsg = "is not supported on ‘${hostPlatform.config}’"; }
     else if !(hasAllowedInsecure attrs) then
       { valid = false; reason = "insecure"; errormsg = "is marked as insecure"; }