treewide: Replace meta.available checks in shouldUsePackages copypasta

This reverts commit 79d8353b5e.

This sort of code breaks config.{allowBroken, allowUnsupportedSystem} =
true by making them do unpredictable things.
This commit is contained in:
Tuomas Tynkkynen
2018-09-28 15:01:00 +03:00
parent 50d0360888
commit 5e84926a66
6 changed files with 7 additions and 6 deletions
@@ -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;