Merge pull request #114374 from oxalica/lib/platform-support-check

lib.meta: introduce `availableOn` to check package availability on given platform
This commit is contained in:
Silvan Mosberger
2021-05-08 03:54:36 +02:00
committed by GitHub
14 changed files with 27 additions and 15 deletions
+1 -1
View File
@@ -15,7 +15,7 @@
with lib;
let
inherit (python3Packages) python dbus-python;
shouldUsePkg = pkg: if pkg != null && lib.any (lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;
shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;
libOnly = prefix == "lib";
+1 -1
View File
@@ -5,7 +5,7 @@
}:
let
shouldUsePkg = pkg: if pkg != null && lib.any (lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;
shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;
optAlsaLib = shouldUsePkg alsaLib;
optDb = shouldUsePkg db;