···
+
enableAutoCreate ? true,
+
enableCalalarmd ? true,
+
enableReplication ? true,
+
enableUnitTests ? true,
+
stdenv.mkDerivation (finalAttrs: {
+
src = fetchFromGitHub {
+
rev = "refs/tags/cyrus-imapd-${finalAttrs.version}";
+
hash = "sha256-dyybRqmrVX+ERGpToS5JjGC6S/B0t967dLCWfeUrLKA=";
+
++ lib.optionals stdenv.isLinux [ libcap ]
+
++ lib.optionals (enableHttp || enableCalalarmd || enableJMAP) [
+
++ lib.optionals enableJMAP [
+
++ lib.optionals enableXapian [
+
++ lib.optionals withMySQL [ libmysqlclient ]
+
++ lib.optionals withPgSQL [ postgresql ]
+
++ lib.optionals withSQLite [ sqlite ];
+
enableParallelBuilding = true;
+
# Darwin doesn't have libuuid, try to build without it
+
++ lib.optional (!stdenv.isDarwin) libuuid;
+
imapLibs = managesieveLibs ++ [ pcre2 ];
+
mkLibsString = lib.strings.concatMapStringsSep " " (l: "-L${lib.getLib l}/lib");
+
patchShebangs cunit/*.pl
+
patchShebangs imap/promdatagen
+
echo ${finalAttrs.version} > VERSION
+
substituteInPlace cunit/command.testc \
+
--replace-fail /usr/bin/touch ${lib.getExe' coreutils "touch"} \
+
--replace-fail /bin/echo ${lib.getExe' coreutils "echo"} \
+
--replace-fail /usr/bin/tr ${lib.getExe' coreutils "tr"} \
+
--replace-fail /bin/sh ${stdenv.shell}
+
# fix for https://github.com/cyrusimap/cyrus-imapd/issues/3893
+
substituteInPlace perl/imap/Makefile.PL.in \
+
--replace-fail '"$LIB_SASL' '"${mkLibsString imapLibs} -lpcre2-posix $LIB_SASL'
+
substituteInPlace perl/sieve/managesieve/Makefile.PL.in \
+
--replace-fail '"$LIB_SASL' '"${mkLibsString managesieveLibs} $LIB_SASL'
+
wrapProgram $out/bin/cyradm --set PERL5LIB $(find $out/lib/perl5 -type d | tr "\\n" ":")
+
"--with-pidfile=/run/cyrus/master.pid"
+
(lib.enableFeature enableAutoCreate "autocreate")
+
(lib.enableFeature enableSrs "srs")
+
(lib.enableFeature enableIdled "idled")
+
(lib.enableFeature enableMurder "murder")
+
(lib.enableFeature enableBackup "backup")
+
(lib.enableFeature enableReplication "replication")
+
(lib.enableFeature enableUnitTests "unit-tests")
+
(lib.enableFeature (enableHttp || enableCalalarmd || enableJMAP) "http")
+
(lib.enableFeature enableJMAP "jmap")
+
(lib.enableFeature enableNNTP "nntp")
+
(lib.enableFeature enableXapian "xapian")
+
(lib.enableFeature enableCalalarmd "calalarmd")
+
(lib.withFeature withZlib "zlib=${zlib}")
+
(lib.withFeature withOpenssl "openssl")
+
(lib.withFeature withLibcap "libcap=${libcap}")
+
(lib.withFeature withMySQL "mysql")
+
(lib.withFeature withPgSQL "pgsql")
+
(lib.withFeature withSQLite "sqlite")
+
checkInputs = [ cunit ];
+
versionCheckProgram = "${builtins.placeholder "out"}/libexec/master";
+
versionCheckProgramArg = "-V";
+
nativeInstallCheckInputs = [
+
homepage = "https://www.cyrusimap.org";
+
description = "Email, contacts and calendar server";
+
license = with lib.licenses; [ bsdOriginal ];
+
maintainers = with lib.maintainers; [
+
platforms = lib.platforms.unix;