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.

authored by Dmitry Bogatov and committed by Yt 21eb6c6b 105037c7

+18 -10
+18 -10
pkgs/applications/networking/mpop/default.nix
··· 2 2 , stdenv 3 3 , fetchurl 4 4 , gnutls 5 + , openssl 5 6 , gsasl 6 7 , libidn 7 8 , pkg-config 8 9 , Security 10 + , nlsSupport ? true 11 + , idnSupport ? true 12 + , gsaslSupport ? true 13 + , sslLibrary ? "gnutls" 9 14 }: 15 + assert lib.assertOneOf "sslLibrary" sslLibrary ["gnutls" "openssl" "no"]; 10 16 11 17 stdenv.mkDerivation rec { 12 18 pname = "mpop"; ··· 21 27 pkg-config 22 28 ]; 23 29 24 - buildInputs = [ 25 - gnutls 26 - gsasl 27 - libidn 28 - ] ++ lib.optionals stdenv.isDarwin [ 29 - Security 30 - ]; 30 + buildInputs = 31 + lib.optional stdenv.isDarwin Security 32 + ++ lib.optional gsaslSupport gsasl 33 + ++ lib.optional idnSupport libidn 34 + ++ lib.optional (sslLibrary == "gnutls") gnutls 35 + ++ lib.optional (sslLibrary == "openssl") openssl; 31 36 32 - configureFlags = lib.optionals stdenv.isDarwin [ 33 - "--with-macosx-keyring" 34 - ]; 37 + configureFlags = [ 38 + (lib.enableFeature nlsSupport "nls") 39 + (lib.withFeature idnSupport "idn") 40 + (lib.withFeature gsaslSupport "gsasl") 41 + "--with-tls=${sslLibrary}" 42 + ] ++ lib.optional stdenv.isDarwin "--with-macosx-keyring"; 35 43 36 44 meta = with lib;{ 37 45 description = "POP3 mail retrieval agent";