From c37b93bd52f3f5a0dd6ba2a41823c56e7f31f71e Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 9 May 2018 16:13:38 -0500 Subject: [PATCH] treewide: remove lib.meta.enableIfAvailable --- lib/meta.nix | 2 -- pkgs/os-specific/linux/systemd/default.nix | 12 +++++++----- pkgs/tools/package-management/nix/default.nix | 5 +++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/meta.nix b/lib/meta.nix index 8516cc1cd6f1..199030c103af 100644 --- a/lib/meta.nix +++ b/lib/meta.nix @@ -86,6 +86,4 @@ rec { then { system = elem; } else { parsed = elem; }; in lib.matchAttrs pattern platform; - - enableIfAvailable = p: if p.meta.available or true then [ p ] else []; } diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 58a1c7ca7147..c1f139d42a64 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -1,9 +1,9 @@ { stdenv, fetchFromGitHub, fetchpatch, pkgconfig, intltool, gperf, libcap, kmod , zlib, xz, pam, acl, cryptsetup, libuuid, m4, utillinux, libffi , glib, kbd, libxslt, coreutils, libgcrypt, libgpgerror, libidn2, libapparmor -, audit, lz4, bzip2, kexectools, libmicrohttpd +, audit, lz4, bzip2, libmicrohttpd , linuxHeaders ? stdenv.cc.libc.linuxHeaders -, libseccomp, iptables, gnu-efi +, iptables, gnu-efi , autoreconfHook, gettext, docbook_xsl, docbook_xml_dtd_42, docbook_xml_dtd_45 , ninja, meson, python3Packages, glibcLocales , patchelf @@ -11,6 +11,8 @@ , hostPlatform , buildPackages , withSelinux ? false, libselinux +, withLibseccomp ? libseccomp.meta.available, libseccomp +, withKexectools ? kexectools.meta.available, kexectools }: let @@ -42,13 +44,13 @@ in stdenv.mkDerivation rec { [ linuxHeaders libcap kmod xz pam acl /* cryptsetup */ libuuid glib libgcrypt libgpgerror libidn2 libmicrohttpd ] ++ - stdenv.lib.meta.enableIfAvailable kexectools ++ - stdenv.lib.meta.enableIfAvailable libseccomp ++ + stdenv.lib.optional withKexectools kexectools ++ + stdenv.lib.optional withLibseccomp libseccomp ++ [ libffi audit lz4 bzip2 libapparmor iptables gnu-efi # This is actually native, but we already pull it from buildPackages pythonLxmlEnv - ] ++ stdenv.lib.optionals withSelinux [ libselinux ]; + ] ++ stdenv.lib.optional withSelinux libselinux; #dontAddPrefix = true; diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 1d15bd11b7fa..8f503d12935e 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -1,11 +1,12 @@ { lib, stdenv, fetchurl, fetchFromGitHub, perl, curl, bzip2, sqlite, openssl ? null, xz , pkgconfig, boehmgc, perlPackages, libsodium, aws-sdk-cpp, brotli, boost , autoreconfHook, autoconf-archive, bison, flex, libxml2, libxslt, docbook5, docbook5_xsl -, libseccomp, busybox-sandbox-shell +, busybox-sandbox-shell , hostPlatform, buildPlatform , storeDir ? "/nix/store" , stateDir ? "/nix/var" , confDir ? "/etc" +, withLibseccomp ? libseccomp.meta.available, libseccomp }: let @@ -30,7 +31,7 @@ let buildInputs = [ curl openssl sqlite xz bzip2 ] ++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium ++ lib.optionals is20 [ brotli ] # Since 1.12 - ++ lib.meta.enableIfAvailable libseccomp + ++ lib.optional withLibseccomp libseccomp ++ lib.optional ((stdenv.isLinux || stdenv.isDarwin) && is20) (aws-sdk-cpp.override { apis = ["s3"];