From 39773cc073737663884c9f3568c314ebf35f1739 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Sat, 14 May 2022 12:40:32 -0400 Subject: [PATCH] util-linux: make dependencies on pam and libcap optional Introduce new boolean arguments "pamSupport" and "capabilitiesSupport" that control whether "pam" and "libcap" are compiled in. These flags are true by default, so this commit does not cause any rebuilds. --- pkgs/os-specific/linux/util-linux/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix index efd75ce9b3f..51eb20ecacd 100644 --- a/pkgs/os-specific/linux/util-linux/default.nix +++ b/pkgs/os-specific/linux/util-linux/default.nix @@ -1,6 +1,10 @@ -{ lib, stdenv, fetchurl, pkg-config, zlib, shadow, libcap_ng +{ lib, stdenv, fetchurl, pkg-config, zlib, shadow +, capabilitiesSupport ? true +, libcap_ng , ncursesSupport ? true -, ncurses, pam +, ncurses +, pamSupport ? true +, pam , systemdSupport ? stdenv.isLinux && !stdenv.hostPlatform.isStatic , systemd , nlsSupport ? true @@ -59,7 +63,9 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ pkg-config ]; - buildInputs = [ zlib pam libcap_ng ] + buildInputs = [ zlib ] + ++ lib.optionals pamSupport [ pam ] + ++ lib.optionals capabilitiesSupport [ libcap_ng ] ++ lib.optionals ncursesSupport [ ncurses ] ++ lib.optionals systemdSupport [ systemd ];