2017-10-09 10:04:51 +02:00
|
|
|
{ stdenv, fetchurl, fetchpatch, autoreconfHook, dejagnu, gettext, pkgconfig
|
2017-07-23 12:28:43 +02:00
|
|
|
, gdbm, pam, readline, ncurses, gnutls, guile, texinfo, gnum4, sasl, fribidi, nettools
|
2019-12-19 02:05:41 +01:00
|
|
|
, python3, gss, libmysqlclient, system-sendmail }:
|
2009-09-11 11:38:25 +02:00
|
|
|
|
2018-08-08 23:37:29 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2020-11-14 21:55:16 +01:00
|
|
|
pname = "mailutils";
|
|
|
|
version = "3.10";
|
2009-09-11 11:38:25 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-11-14 21:55:16 +01:00
|
|
|
url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz";
|
|
|
|
sha256 = "17smrxjdgbbzbzakik30vj46q4iib85ksqhb82jr4vjp57akszh9";
|
2009-09-11 11:38:25 +02:00
|
|
|
};
|
|
|
|
|
2018-08-08 23:37:29 +02:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e '/chown root:mail/d' \
|
|
|
|
-e 's/chmod [24]755/chmod 0755/' \
|
|
|
|
*/Makefile{.in,.am}
|
2019-09-22 09:38:09 +02:00
|
|
|
sed -i 's:/usr/lib/mysql:${libmysqlclient}/lib/mysql:' configure.ac
|
2018-08-08 23:37:29 +02:00
|
|
|
sed -i 's/0\.18/0.19/' configure.ac
|
|
|
|
'';
|
|
|
|
|
2017-07-23 12:28:43 +02:00
|
|
|
nativeBuildInputs = [
|
2017-10-09 10:04:51 +02:00
|
|
|
autoreconfHook gettext pkgconfig
|
2018-08-08 23:37:29 +02:00
|
|
|
];
|
|
|
|
|
2017-07-23 12:28:43 +02:00
|
|
|
buildInputs = [
|
|
|
|
gdbm pam readline ncurses gnutls guile texinfo gnum4 sasl fribidi nettools
|
2019-12-19 02:05:41 +01:00
|
|
|
gss libmysqlclient python3
|
2017-07-23 12:28:43 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./fix-build-mb-len-max.patch
|
|
|
|
./path-to-cat.patch
|
2020-11-14 21:55:16 +01:00
|
|
|
# mailquota.c:277: undefined reference to `get_size'
|
|
|
|
# https://lists.gnu.org/archive/html/bug-mailutils/2020-08/msg00002.html
|
|
|
|
(fetchpatch {
|
|
|
|
url = "http://git.savannah.gnu.org/cgit/mailutils.git/patch/?id=37713b42a501892469234b90454731d8d8b7a3e6";
|
|
|
|
sha256 = "1mwj77nxvf4xvqf26yjs59jyksnizj0lmbymbzg4kmqynzq3zjny";
|
|
|
|
})
|
2020-11-14 22:05:34 +01:00
|
|
|
# Fix cross-compilation
|
|
|
|
# https://lists.gnu.org/archive/html/bug-mailutils/2020-11/msg00038.html
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://lists.gnu.org/archive/html/bug-mailutils/2020-11/txtiNjqcNpqOk.txt";
|
|
|
|
sha256 = "0ghzqb8qx2q8cffbvqzw19mivv7r5f16whplzhm7hdj0j2i6xf6s";
|
|
|
|
})
|
2017-07-23 12:28:43 +02:00
|
|
|
];
|
2016-02-12 04:58:56 +01:00
|
|
|
|
2018-04-03 12:38:18 +02:00
|
|
|
enableParallelBuilding = false;
|
2017-07-26 13:12:37 +02:00
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-gssapi"
|
|
|
|
"--with-gsasl"
|
|
|
|
"--with-mysql"
|
2019-01-16 13:13:27 +01:00
|
|
|
"--with-path-sendmail=${system-sendmail}/bin/sendmail"
|
2017-07-26 13:12:37 +02:00
|
|
|
];
|
|
|
|
|
2018-08-08 23:37:29 +02:00
|
|
|
readmsg-tests = let
|
|
|
|
p = "https://raw.githubusercontent.com/gentoo/gentoo/9c921e89d51876fd876f250324893fd90c019326/net-mail/mailutils/files";
|
|
|
|
in [
|
2017-07-23 12:28:43 +02:00
|
|
|
(fetchurl { url = "${p}/hdr.at"; sha256 = "0phpkqyhs26chn63wjns6ydx9468ng3ssbjbfhcvza8h78jlsd98"; })
|
|
|
|
(fetchurl { url = "${p}/nohdr.at"; sha256 = "1vkbkfkbqj6ml62s1am8i286hxwnpsmbhbnq0i2i0j1i7iwkk4b7"; })
|
|
|
|
(fetchurl { url = "${p}/twomsg.at"; sha256 = "15m29rg2xxa17xhx6jp4s2vwa9d4khw8092vpygqbwlhw68alk9g"; })
|
|
|
|
(fetchurl { url = "${p}/weed.at"; sha256 = "1101xakhc99f5gb9cs3mmydn43ayli7b270pzbvh7f9rbvh0d0nh"; })
|
|
|
|
];
|
2010-09-10 13:50:11 +02:00
|
|
|
|
2019-09-22 09:38:09 +02:00
|
|
|
NIX_CFLAGS_COMPILE = "-L${libmysqlclient}/lib/mysql -I${libmysqlclient}/include/mysql";
|
2017-10-09 10:04:51 +02:00
|
|
|
|
2018-08-08 23:37:29 +02:00
|
|
|
checkInputs = [ dejagnu ];
|
|
|
|
doCheck = false; # fails 1 out of a bunch of tests, looks like a bug
|
|
|
|
doInstallCheck = false; # fails
|
|
|
|
|
2017-07-23 12:28:43 +02:00
|
|
|
preCheck = ''
|
2017-10-09 10:04:51 +02:00
|
|
|
# Add missing test files
|
2017-07-23 12:28:43 +02:00
|
|
|
cp ${builtins.toString readmsg-tests} readmsg/tests/
|
|
|
|
for f in hdr.at nohdr.at twomsg.at weed.at; do
|
|
|
|
mv readmsg/tests/*-$f readmsg/tests/$f
|
|
|
|
done
|
|
|
|
# Disable comsat tests that fail without tty in the sandbox.
|
|
|
|
tty -s || echo > comsat/tests/testsuite.at
|
2017-07-26 13:12:37 +02:00
|
|
|
# Disable lmtp tests that require root spool.
|
|
|
|
echo > maidag/tests/lmtp.at
|
2017-07-23 12:28:43 +02:00
|
|
|
# Disable mda tests that require /etc/passwd to contain root.
|
|
|
|
grep -qo '^root:' /etc/passwd || echo > maidag/tests/mda.at
|
|
|
|
# Provide libraries for mhn.
|
|
|
|
export LD_LIBRARY_PATH=$(pwd)/lib/.libs
|
|
|
|
'';
|
2018-08-08 23:37:29 +02:00
|
|
|
|
2017-07-26 13:12:37 +02:00
|
|
|
postCheck = ''
|
|
|
|
unset LD_LIBRARY_PATH
|
|
|
|
'';
|
2009-09-11 11:38:25 +02:00
|
|
|
|
2015-05-27 21:56:04 +02:00
|
|
|
meta = with stdenv.lib; {
|
2014-08-24 16:21:08 +02:00
|
|
|
description = "Rich and powerful protocol-independent mail framework";
|
2009-09-11 11:38:25 +02:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
GNU Mailutils is a rich and powerful protocol-independent mail
|
|
|
|
framework. It contains a series of useful mail libraries, clients, and
|
|
|
|
servers. These are the primary mail utilities for the GNU system. The
|
|
|
|
central library is capable of handling electronic mail in various
|
|
|
|
mailbox formats and protocols, both local and remote. Specifically,
|
|
|
|
this project contains a POP3 server, an IMAP4 server, and a Sieve mail
|
|
|
|
filter. It also provides a POSIX `mailx' client, and a collection of
|
|
|
|
other handy tools.
|
|
|
|
|
|
|
|
The GNU Mailutils libraries supply an ample set of primitives for
|
|
|
|
handling electronic mail in programs written in C, C++, Python or
|
|
|
|
Scheme.
|
|
|
|
|
|
|
|
The utilities provided by Mailutils include imap4d and pop3d mail
|
|
|
|
servers, mail reporting utility comsatd, general-purpose mail delivery
|
|
|
|
agent maidag, mail filtering program sieve, and an implementation of MH
|
|
|
|
message handling system.
|
|
|
|
'';
|
|
|
|
|
2015-05-27 21:56:04 +02:00
|
|
|
license = with licenses; [
|
|
|
|
lgpl3Plus /* libraries */
|
|
|
|
gpl3Plus /* tools */
|
|
|
|
];
|
2009-09-11 11:38:25 +02:00
|
|
|
|
2017-07-23 12:28:43 +02:00
|
|
|
maintainers = with maintainers; [ orivej vrthra ];
|
2009-09-12 20:47:34 +02:00
|
|
|
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.gnu.org/software/mailutils/";
|
2009-09-12 21:54:08 +02:00
|
|
|
|
2009-09-12 22:53:21 +02:00
|
|
|
# Some of the dependencies fail to build on {cyg,dar}win.
|
2020-08-23 22:14:13 +02:00
|
|
|
platforms = platforms.gnu ++ platforms.unix;
|
2009-09-11 11:38:25 +02:00
|
|
|
};
|
|
|
|
}
|