2022-02-10 20:34:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, autoreconfHook
|
|
|
|
, dejagnu
|
|
|
|
, gettext
|
|
|
|
, gnum4
|
|
|
|
, pkg-config
|
|
|
|
, texinfo
|
|
|
|
, fribidi
|
|
|
|
, gdbm
|
|
|
|
, gnutls
|
|
|
|
, gss
|
|
|
|
, guile
|
|
|
|
, libmysqlclient
|
|
|
|
, mailcap
|
|
|
|
, nettools
|
|
|
|
, pam
|
|
|
|
, readline
|
|
|
|
, ncurses
|
|
|
|
, python3
|
|
|
|
, sasl
|
|
|
|
, system-sendmail
|
2022-10-30 15:09:59 +00:00
|
|
|
, libxcrypt
|
2023-04-12 12:48:02 +00:00
|
|
|
, mkpasswd
|
2023-02-22 10:55:15 +00:00
|
|
|
|
|
|
|
, pythonSupport ? true
|
|
|
|
, guileSupport ? true
|
2022-02-10 20:34:41 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-11-21 19:51:51 +00:00
|
|
|
pname = "mailutils";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "3.16";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-11-21 19:51:51 +00:00
|
|
|
url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz";
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-BB0VjTCMA3YYQ4jpyTbPqEGlHNwl1Nt1mEp3Gj+gAsA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
separateDebugInfo = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e '/chown root:mail/d' \
|
|
|
|
-e 's/chmod [24]755/chmod 0755/' \
|
|
|
|
*/Makefile{.in,.am}
|
|
|
|
sed -i 's:/usr/lib/mysql:${libmysqlclient}/lib/mysql:' configure.ac
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2022-02-10 20:34:41 +00:00
|
|
|
autoreconfHook
|
|
|
|
gettext
|
|
|
|
gnum4
|
|
|
|
pkg-config
|
|
|
|
texinfo
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2022-02-10 20:34:41 +00:00
|
|
|
fribidi
|
|
|
|
gdbm
|
|
|
|
gnutls
|
|
|
|
gss
|
|
|
|
libmysqlclient
|
|
|
|
mailcap
|
|
|
|
ncurses
|
|
|
|
pam
|
|
|
|
readline
|
|
|
|
sasl
|
2022-10-30 15:09:59 +00:00
|
|
|
libxcrypt
|
2023-02-22 10:55:15 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [ nettools ]
|
|
|
|
++ lib.optionals pythonSupport [ python3 ]
|
|
|
|
++ lib.optionals guileSupport [ guile ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
./fix-build-mb-len-max.patch
|
|
|
|
./path-to-cat.patch
|
2020-11-21 19:51:51 +00: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";
|
|
|
|
})
|
2023-04-12 12:48:02 +00:00
|
|
|
# https://github.com/NixOS/nixpkgs/issues/223967
|
|
|
|
# https://lists.gnu.org/archive/html/bug-mailutils/2023-04/msg00000.html
|
|
|
|
./don-t-use-descrypt-password-in-the-test-suite.patch
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
enableParallelBuilding = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-gssapi"
|
|
|
|
"--with-gsasl"
|
|
|
|
"--with-mysql"
|
|
|
|
"--with-path-sendmail=${system-sendmail}/bin/sendmail"
|
2022-01-13 20:06:32 +00:00
|
|
|
"--with-mail-rc=/etc/mail.rc"
|
2022-02-10 20:34:41 +00:00
|
|
|
"DEFAULT_CUPS_CONFDIR=${mailcap}/etc" # provides mime.types to mimeview
|
2023-02-22 10:55:15 +00:00
|
|
|
] ++ lib.optional (!pythonSupport) "--without-python"
|
|
|
|
++ lib.optional (!guileSupport) "--without-guile";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
nativeCheckInputs = [ dejagnu mkpasswd ];
|
2023-03-04 12:14:45 +00:00
|
|
|
doCheck = !stdenv.isDarwin; # ERROR: All 46 tests were run, 46 failed unexpectedly.
|
2020-04-24 23:36:52 +00:00
|
|
|
doInstallCheck = false; # fails
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# Disable comsat tests that fail without tty in the sandbox.
|
|
|
|
tty -s || echo > comsat/tests/testsuite.at
|
2023-02-22 10:55:15 +00:00
|
|
|
# Remove broken macro
|
|
|
|
sed -i '/AT_TESTED/d' libmu_scm/tests/testsuite.at
|
2020-04-24 23:36:52 +00:00
|
|
|
# Provide libraries for mhn.
|
|
|
|
export LD_LIBRARY_PATH=$(pwd)/lib/.libs
|
|
|
|
'';
|
|
|
|
|
|
|
|
postCheck = ''
|
|
|
|
unset LD_LIBRARY_PATH
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Rich and powerful protocol-independent mail framework";
|
|
|
|
|
|
|
|
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
|
2023-02-22 10:55:15 +00:00
|
|
|
servers, mail reporting utility comsatd, mail filtering program sieve,
|
|
|
|
and an implementation of MH message handling system.
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
license = with licenses; [
|
|
|
|
lgpl3Plus /* libraries */
|
|
|
|
gpl3Plus /* tools */
|
|
|
|
];
|
|
|
|
|
|
|
|
maintainers = with maintainers; [ orivej vrthra ];
|
|
|
|
|
|
|
|
homepage = "https://www.gnu.org/software/mailutils/";
|
2023-02-22 10:55:15 +00:00
|
|
|
changelog = "https://git.savannah.gnu.org/cgit/mailutils.git/tree/NEWS";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Some of the dependencies fail to build on {cyg,dar}win.
|
2020-09-25 04:45:31 +00:00
|
|
|
platforms = platforms.gnu ++ platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|