From 21eb6c6ba74dcbe3ea5926ee46287300fb066630 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Fri, 11 Nov 2022 20:23:46 -0500 Subject: [PATCH] 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. --- pkgs/applications/networking/mpop/default.nix | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/networking/mpop/default.nix b/pkgs/applications/networking/mpop/default.nix index 1d15ed3c2658..efc782e83283 100644 --- a/pkgs/applications/networking/mpop/default.nix +++ b/pkgs/applications/networking/mpop/default.nix @@ -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";