treewide: Make shouldUsePackages
copypasta use meta.available
The old way depended on old list-of-strings `meta.platforms`, and was not good for cross.
This commit is contained in:
parent
eeb8419c6a
commit
79d8353b5e
@ -15,7 +15,7 @@ let
|
|||||||
mkWith = mkFlag "with-" "without-";
|
mkWith = mkFlag "with-" "without-";
|
||||||
mkOther = mkFlag "" "" true;
|
mkOther = mkFlag "" "" true;
|
||||||
|
|
||||||
shouldUsePkg = pkg: if pkg != null && any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
|
shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
|
||||||
|
|
||||||
optLz4 = shouldUsePkg lz4;
|
optLz4 = shouldUsePkg lz4;
|
||||||
optSnappy = shouldUsePkg snappy;
|
optSnappy = shouldUsePkg snappy;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
let
|
let
|
||||||
inherit (python2Packages) python dbus-python;
|
inherit (python2Packages) python dbus-python;
|
||||||
shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
|
shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
|
||||||
|
|
||||||
libOnly = prefix == "lib";
|
libOnly = prefix == "lib";
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
|
shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
|
||||||
|
|
||||||
optAlsaLib = shouldUsePkg alsaLib;
|
optAlsaLib = shouldUsePkg alsaLib;
|
||||||
optDb = shouldUsePkg db;
|
optDb = shouldUsePkg db;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
|
shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
|
||||||
|
|
||||||
libOnly = prefix == "lib";
|
libOnly = prefix == "lib";
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ let
|
|||||||
mkWith = mkFlag "with-" "without-";
|
mkWith = mkFlag "with-" "without-";
|
||||||
mkOther = mkFlag "" "" true;
|
mkOther = mkFlag "" "" true;
|
||||||
|
|
||||||
shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
|
shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
|
||||||
|
|
||||||
optPam = shouldUsePkg pam;
|
optPam = shouldUsePkg pam;
|
||||||
optLibidn = shouldUsePkg libidn;
|
optLibidn = shouldUsePkg libidn;
|
||||||
|
@ -37,8 +37,7 @@ with stdenv.lib;
|
|||||||
let
|
let
|
||||||
|
|
||||||
shouldUsePkg = pkg_: let pkg = (builtins.tryEval pkg_).value;
|
shouldUsePkg = pkg_: let pkg = (builtins.tryEval pkg_).value;
|
||||||
in if lib.any (x: x == system) (pkg.meta.platforms or [])
|
in if pkg.meta.available or false then pkg else null;
|
||||||
then pkg else null;
|
|
||||||
|
|
||||||
optYasm = shouldUsePkg yasm;
|
optYasm = shouldUsePkg yasm;
|
||||||
optFcgi = shouldUsePkg fcgi;
|
optFcgi = shouldUsePkg fcgi;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user