mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-29 06:45:54 +03:00
shishi: replace mkFlag with lib.enableFeature and lib.withFeature
This commit is contained in:
parent
b912253a5d
commit
72848cc78e
@ -6,14 +6,6 @@
|
||||
}:
|
||||
|
||||
let
|
||||
mkFlag = trueStr: falseStr: cond: name: val: "--"
|
||||
+ (if cond then trueStr else falseStr)
|
||||
+ name
|
||||
+ lib.optionalString (val != null && cond != false) "=${val}";
|
||||
mkEnable = mkFlag "enable-" "disable-";
|
||||
mkWith = mkFlag "with-" "without-";
|
||||
mkOther = mkFlag "" "" true;
|
||||
|
||||
shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;
|
||||
|
||||
optPam = shouldUsePkg pam;
|
||||
@ -37,19 +29,19 @@ stdenv.mkDerivation rec {
|
||||
buildInputs = [ libgcrypt libgpg-error libtasn1 optPam optLibidn optGnutls ];
|
||||
|
||||
configureFlags = [
|
||||
(mkOther "sysconfdir" "/etc")
|
||||
(mkOther "localstatedir" "/var")
|
||||
(mkEnable true "libgcrypt" null)
|
||||
(mkEnable (optPam != null) "pam" null)
|
||||
(mkEnable true "ipv6" null)
|
||||
(mkWith (optLibidn != null) "stringprep" null)
|
||||
(mkEnable (optGnutls != null) "starttls" null)
|
||||
(mkEnable true "des" null)
|
||||
(mkEnable true "3des" null)
|
||||
(mkEnable true "aes" null)
|
||||
(mkEnable true "md" null)
|
||||
(mkEnable false "null" null)
|
||||
(mkEnable true "arcfour" null)
|
||||
"--sysconfdir=/etc"
|
||||
"--localstatedir=/var"
|
||||
(enableFeature true "libgcrypt")
|
||||
(enableFeature (optPam != null) "pam")
|
||||
(enableFeature true "ipv6")
|
||||
(withFeature (optLibidn != null) "stringprep")
|
||||
(enableFeature (optGnutls != null) "starttls")
|
||||
(enableFeature true "des")
|
||||
(enableFeature true "3des")
|
||||
(enableFeature true "aes")
|
||||
(enableFeature true "md")
|
||||
(enableFeature false "null")
|
||||
(enableFeature true "arcfour")
|
||||
];
|
||||
|
||||
NIX_CFLAGS_COMPILE
|
||||
|
Loading…
Reference in New Issue
Block a user