Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 gnutls, 6 openssl, 7 gsasl, 8 libidn, 9 pkg-config, 10 nlsSupport ? true, 11 idnSupport ? true, 12 gsaslSupport ? true, 13 sslLibrary ? "gnutls", 14}: 15assert lib.assertOneOf "sslLibrary" sslLibrary [ 16 "gnutls" 17 "openssl" 18 "no" 19]; 20 21stdenv.mkDerivation rec { 22 pname = "mpop"; 23 version = "1.4.21"; 24 25 src = fetchurl { 26 url = "https://marlam.de/${pname}/releases/${pname}-${version}.tar.xz"; 27 sha256 = "sha256-TKDR4NATZv4+DPSQ2I0VTfURJ4+1lWOHE748pnVmWFU="; 28 }; 29 30 nativeBuildInputs = [ 31 pkg-config 32 ]; 33 34 buildInputs = 35 lib.optional gsaslSupport gsasl 36 ++ lib.optional idnSupport libidn 37 ++ lib.optional (sslLibrary == "gnutls") gnutls 38 ++ lib.optional (sslLibrary == "openssl") openssl; 39 40 configureFlags = [ 41 (lib.enableFeature nlsSupport "nls") 42 (lib.withFeature idnSupport "idn") 43 (lib.withFeature gsaslSupport "gsasl") 44 "--with-tls=${sslLibrary}" 45 ] 46 ++ lib.optional stdenv.hostPlatform.isDarwin "--with-macosx-keyring"; 47 48 meta = with lib; { 49 description = "POP3 mail retrieval agent"; 50 homepage = "https://marlam.de/mpop"; 51 license = licenses.gpl3Plus; 52 platforms = platforms.unix; 53 }; 54}