···
50
+
enableAutoCreate ? true,
51
+
enableBackup ? true,
52
+
enableCalalarmd ? true,
56
+
enableMurder ? true,
58
+
enableReplication ? true,
60
+
enableUnitTests ? true,
61
+
enableXapian ? true,
69
+
stdenv.mkDerivation (finalAttrs: {
70
+
pname = "cyrus-imapd";
73
+
src = fetchFromGitHub {
74
+
owner = "cyrusimap";
75
+
repo = "cyrus-imapd";
76
+
rev = "refs/tags/cyrus-imapd-${finalAttrs.version}";
77
+
hash = "sha256-dyybRqmrVX+ERGpToS5JjGC6S/B0t967dLCWfeUrLKA=";
80
+
nativeBuildInputs = [
103
+
++ lib.optionals stdenv.isLinux [ libcap ]
104
+
++ lib.optionals (enableHttp || enableCalalarmd || enableJMAP) [
111
+
++ lib.optionals enableJMAP [
115
+
++ lib.optionals enableXapian [
119
+
++ lib.optionals withMySQL [ libmysqlclient ]
120
+
++ lib.optionals withPgSQL [ postgresql ]
121
+
++ lib.optionals withSQLite [ sqlite ];
123
+
enableParallelBuilding = true;
132
+
# Darwin doesn't have libuuid, try to build without it
133
+
++ lib.optional (!stdenv.isDarwin) libuuid;
134
+
imapLibs = managesieveLibs ++ [ pcre2 ];
135
+
mkLibsString = lib.strings.concatMapStringsSep " " (l: "-L${lib.getLib l}/lib");
138
+
patchShebangs cunit/*.pl
139
+
patchShebangs imap/promdatagen
140
+
patchShebangs tools/*
142
+
echo ${finalAttrs.version} > VERSION
144
+
substituteInPlace cunit/command.testc \
145
+
--replace-fail /usr/bin/touch ${lib.getExe' coreutils "touch"} \
146
+
--replace-fail /bin/echo ${lib.getExe' coreutils "echo"} \
147
+
--replace-fail /usr/bin/tr ${lib.getExe' coreutils "tr"} \
148
+
--replace-fail /bin/sh ${stdenv.shell}
150
+
# fix for https://github.com/cyrusimap/cyrus-imapd/issues/3893
151
+
substituteInPlace perl/imap/Makefile.PL.in \
152
+
--replace-fail '"$LIB_SASL' '"${mkLibsString imapLibs} -lpcre2-posix $LIB_SASL'
153
+
substituteInPlace perl/sieve/managesieve/Makefile.PL.in \
154
+
--replace-fail '"$LIB_SASL' '"${mkLibsString managesieveLibs} $LIB_SASL'
158
+
wrapProgram $out/bin/cyradm --set PERL5LIB $(find $out/lib/perl5 -type d | tr "\\n" ":")
162
+
"--with-pidfile=/run/cyrus/master.pid"
163
+
(lib.enableFeature enableAutoCreate "autocreate")
164
+
(lib.enableFeature enableSrs "srs")
165
+
(lib.enableFeature enableIdled "idled")
166
+
(lib.enableFeature enableMurder "murder")
167
+
(lib.enableFeature enableBackup "backup")
168
+
(lib.enableFeature enableReplication "replication")
169
+
(lib.enableFeature enableUnitTests "unit-tests")
170
+
(lib.enableFeature (enableHttp || enableCalalarmd || enableJMAP) "http")
171
+
(lib.enableFeature enableJMAP "jmap")
172
+
(lib.enableFeature enableNNTP "nntp")
173
+
(lib.enableFeature enableXapian "xapian")
174
+
(lib.enableFeature enableCalalarmd "calalarmd")
175
+
(lib.withFeature withZlib "zlib=${zlib}")
176
+
(lib.withFeature withOpenssl "openssl")
177
+
(lib.withFeature withLibcap "libcap=${libcap}")
178
+
(lib.withFeature withMySQL "mysql")
179
+
(lib.withFeature withPgSQL "pgsql")
180
+
(lib.withFeature withSQLite "sqlite")
183
+
checkInputs = [ cunit ];
186
+
versionCheckProgram = "${builtins.placeholder "out"}/libexec/master";
187
+
versionCheckProgramArg = "-V";
188
+
nativeInstallCheckInputs = [
191
+
doInstallCheck = true;
194
+
homepage = "https://www.cyrusimap.org";
195
+
description = "Email, contacts and calendar server";
196
+
license = with lib.licenses; [ bsdOriginal ];
197
+
mainProgram = "cyrus";
198
+
maintainers = with lib.maintainers; [
202
+
platforms = lib.platforms.unix;