Commit 21eb6c6b authored by Dmitry Bogatov's avatar Dmitry Bogatov Committed by Yt
Browse files

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.
parent 105037c7
Loading
Loading
Loading
Loading
+18 −10
Original line number Diff line number Diff line
@@ -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";