meta: Add badPlatforms attribute for platform blacklisting.
This commit is contained in:
parent
4ba76fadeb
commit
b0482248fe
@ -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"; }
|
||||
|
Loading…
Reference in New Issue
Block a user