treewide: Make `shouldUsePackages` copypasta use meta.available
The old way depended on old list-of-strings `meta.platforms`, and was
not good for cross.
commit79d8353b5e4bb98f1b51ab32b9b26df81bb7e106
authorJohn Ericson <John.Ericson@Obsidian.Systems>
dateFri 9 Mar 2018, 17:58 (9 years ago)
parenteeb8419
pkgs/development/libraries/wiredtiger/default.nix+1−1
@@ -15,7 +15,7 @@ let
1515 mkWith = mkFlag "with-" "without-";
1616 mkOther = mkFlag "" "" true;
1717
18− shouldUsePkg = pkg: if pkg != null && any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
18+ shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
1919
2020 optLz4 = shouldUsePkg lz4;
2121 optSnappy = shouldUsePkg snappy;
pkgs/misc/jackaudio/default.nix+1−1
@@ -15,7 +15,7 @@
1515with stdenv.lib;
1616let
1717 inherit (python2Packages) python dbus-python;
18− shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
18+ shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
1919
2020 libOnly = prefix == "lib";
2121
pkgs/misc/jackaudio/jack1.nix+1−1
@@ -5,7 +5,7 @@
55}:
66
77let
8− shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
8+ shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
99
1010 optAlsaLib = shouldUsePkg alsaLib;
1111 optDb = shouldUsePkg db;
pkgs/os-specific/linux/ffado/default.nix+1−1
@@ -11,7 +11,7 @@
1111
1212let
1313
14− shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
14+ shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
1515
1616 libOnly = prefix == "lib";
1717
pkgs/servers/shishi/default.nix+1−1
@@ -14,7 +14,7 @@ let
1414 mkWith = mkFlag "with-" "without-";
1515 mkOther = mkFlag "" "" true;
1616
17− shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
17+ shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
1818
1919 optPam = shouldUsePkg pam;
2020 optLibidn = shouldUsePkg libidn;
pkgs/tools/filesystems/ceph/generic.nix+1−2
@@ -37,8 +37,7 @@ with stdenv.lib;
3737let
3838
3939 shouldUsePkg = pkg_: let pkg = (builtins.tryEval pkg_).value;
40− in if lib.any (x: x == system) (pkg.meta.platforms or [])
41− then pkg else null;
40+ in if pkg.meta.available or false then pkg else null;
4241
4342 optYasm = shouldUsePkg yasm;
4443 optFcgi = shouldUsePkg fcgi;