Skip to content

Commit

Permalink
treewide: Replace meta.available checks in shouldUsePackages copypasta
Browse files Browse the repository at this point in the history
This reverts commit 79d8353.

This sort of code breaks config.{allowBroken, allowUnsupportedSystem} =
true by making them do unpredictable things.
  • Loading branch information
dezgeg committed Sep 28, 2018
1 parent 50d0360 commit 5e84926
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkgs/development/libraries/wiredtiger/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let
mkEnable = mkFlag "enable-" "disable-";
mkWith = mkFlag "with-" "without-";

shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;

optLz4 = shouldUsePkg lz4;
optSnappy = shouldUsePkg snappy;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/misc/jackaudio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
with stdenv.lib;
let
inherit (python2Packages) python dbus-python;
shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;

libOnly = prefix == "lib";

Expand Down
2 changes: 1 addition & 1 deletion pkgs/misc/jackaudio/jack1.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}:

let
shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;

optAlsaLib = shouldUsePkg alsaLib;
optDb = shouldUsePkg db;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/os-specific/linux/ffado/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

let

shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;

libOnly = prefix == "lib";

Expand Down
2 changes: 1 addition & 1 deletion pkgs/servers/shishi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let
mkWith = mkFlag "with-" "without-";
mkOther = mkFlag "" "" true;

shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;

optPam = shouldUsePkg pam;
optLibidn = shouldUsePkg libidn;
Expand Down
3 changes: 2 additions & 1 deletion pkgs/tools/filesystems/ceph/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ with stdenv.lib;
let

shouldUsePkg = pkg_: let pkg = (builtins.tryEval pkg_).value;
in if pkg.meta.available or false then pkg else null;
in if lib.any (lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms
then pkg else null;

optYasm = shouldUsePkg yasm;
optFcgi = shouldUsePkg fcgi;
Expand Down

0 comments on commit 5e84926

Please sign in to comment.