mpop: export more configuration flags

Introduce options to disable support for NLS, IDN and GSASL, and also add
option to use openssl instead of gnutls. While upstream marks openssl option as
discouraged, it works and it may be considered desirable to have one SSL
library in system instead of multiple ones.
This commit is contained in:
Dmitry Bogatov
2023-05-24 20:04:07 -04:00
committed by Yt
parent 105037c7cf
commit 21eb6c6ba7
+18 -10
View File
@@ -2,11 +2,17 @@
, stdenv
, fetchurl
, gnutls
, openssl
, gsasl
, libidn
, pkg-config
, Security
, nlsSupport ? true
, idnSupport ? true
, gsaslSupport ? true
, sslLibrary ? "gnutls"
}:
assert lib.assertOneOf "sslLibrary" sslLibrary ["gnutls" "openssl" "no"];
stdenv.mkDerivation rec {
pname = "mpop";
@@ -21,17 +27,19 @@ stdenv.mkDerivation rec {
pkg-config
];
buildInputs = [
gnutls
gsasl
libidn
] ++ lib.optionals stdenv.isDarwin [
Security
];
buildInputs =
lib.optional stdenv.isDarwin Security
++ lib.optional gsaslSupport gsasl
++ lib.optional idnSupport libidn
++ lib.optional (sslLibrary == "gnutls") gnutls
++ lib.optional (sslLibrary == "openssl") openssl;
configureFlags = lib.optionals stdenv.isDarwin [
"--with-macosx-keyring"
];
configureFlags = [
(lib.enableFeature nlsSupport "nls")
(lib.withFeature idnSupport "idn")
(lib.withFeature gsaslSupport "gsasl")
"--with-tls=${sslLibrary}"
] ++ lib.optional stdenv.isDarwin "--with-macosx-keyring";
meta = with lib;{
description = "POP3 mail retrieval agent";