Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove meta.available checks #45727

Merged
merged 6 commits into from
Sep 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/kexec.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ pkgs, lib, ... }:

{
config = lib.mkIf (pkgs.kexectools.meta.available) {
config = lib.mkIf (lib.any (lib.meta.platformMatch pkgs.stdenv.hostPlatform) pkgs.kexectools.meta.platform) {
environment.systemPackages = [ pkgs.kexectools ];

systemd.services."prepare-kexec" =
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/7.10.3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

, # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(gmp.meta.available or false), gmp
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp

, # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/8.0.2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

, # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(gmp.meta.available or false), gmp
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp

, # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/8.2.2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

, # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(gmp.meta.available or false), gmp
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp

, # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/8.4.3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

, # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(gmp.meta.available or false), gmp
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp

, # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/8.6.1.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

, # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(gmp.meta.available or false), gmp
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp

, # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/head.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

, # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(gmp.meta.available or false), gmp
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp

, # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
Expand Down
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
6 changes: 3 additions & 3 deletions pkgs/os-specific/linux/apparmor/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{ stdenv, fetchurl, fetchpatch, makeWrapper, autoreconfHook
{ stdenv, lib, fetchurl, fetchpatch, makeWrapper, autoreconfHook
, pkgconfig, which
, flex, bison
, linuxHeaders ? stdenv.cc.libc.linuxHeaders
, gawk
, withPerl ? stdenv.hostPlatform == stdenv.buildPlatform && perl.meta.available or false, perl
, withPython ? stdenv.hostPlatform == stdenv.buildPlatform && python.meta.available or false, python
, withPerl ? stdenv.hostPlatform == stdenv.buildPlatform && lib.any (lib.meta.platformMatch stdenv.hostPlatform) perl.meta.platforms, perl
, withPython ? stdenv.hostPlatform == stdenv.buildPlatform && lib.any (lib.meta.platformMatch stdenv.hostPlatform) python.meta.platforms, python
, swig
, ncurses
, pam
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
6 changes: 3 additions & 3 deletions pkgs/os-specific/linux/systemd/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, fetchpatch, pkgconfig, intltool, gperf, libcap, kmod
{ stdenv, lib, fetchFromGitHub, fetchpatch, pkgconfig, intltool, gperf, libcap, kmod
, xz, pam, acl, libuuid, m4, utillinux, libffi
, glib, kbd, libxslt, coreutils, libgcrypt, libgpgerror, libidn2, libapparmor
, audit, lz4, bzip2, libmicrohttpd, pcre2
Expand All @@ -10,8 +10,8 @@
, getent
, buildPackages
, withSelinux ? false, libselinux
, withLibseccomp ? libseccomp.meta.available, libseccomp
, withKexectools ? kexectools.meta.available, kexectools
, withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp
, withKexectools ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) kexectools.meta.platforms, kexectools
}:

let
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
2 changes: 1 addition & 1 deletion pkgs/tools/package-management/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
, storeDir ? "/nix/store"
, stateDir ? "/nix/var"
, confDir ? "/etc"
, withLibseccomp ? libseccomp.meta.available, libseccomp
, withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp
, withAWS ? stdenv.isLinux || stdenv.isDarwin, aws-sdk-cpp
}:

Expand Down