diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-10-31 19:35:09 +0100 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-10-31 19:35:09 +0100 |
commit | c4625b175f8200f643fd6e11010932ea44c78433 (patch) | |
tree | bce3f89888c8ac3991fa5569a878a9eab6801ccc /infra/libkookie/nixpkgs/pkgs/tools/networking/mailutils | |
parent | 49f735974dd103039ddc4cb576bb76555164a9e7 (diff) | |
parent | d661aa56a8843e991261510c1bb28fdc2f6975ae (diff) |
Add 'infra/libkookie/' from commit 'd661aa56a8843e991261510c1bb28fdc2f6975ae'
git-subtree-dir: infra/libkookie
git-subtree-mainline: 49f735974dd103039ddc4cb576bb76555164a9e7
git-subtree-split: d661aa56a8843e991261510c1bb28fdc2f6975ae
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/tools/networking/mailutils')
3 files changed, 183 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/tools/networking/mailutils/default.nix b/infra/libkookie/nixpkgs/pkgs/tools/networking/mailutils/default.nix new file mode 100644 index 000000000000..adcd2f1dc131 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/networking/mailutils/default.nix @@ -0,0 +1,117 @@ +{ stdenv, fetchurl, fetchpatch, autoreconfHook, dejagnu, gettext, pkgconfig +, gdbm, pam, readline, ncurses, gnutls, guile, texinfo, gnum4, sasl, fribidi, nettools +, python3, gss, libmysqlclient, system-sendmail }: + +stdenv.mkDerivation rec { + name = "${project}-${version}"; + project = "mailutils"; + version = "3.9"; + + src = fetchurl { + url = "mirror://gnu/${project}/${name}.tar.xz"; + sha256 = "1g1xf2lal04nsnf1iym9n9n0wxjpqbcr9nysxpm98v4pniinqwsz"; + }; + + 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 + sed -i 's/0\.18/0.19/' configure.ac + ''; + + nativeBuildInputs = [ + autoreconfHook gettext pkgconfig + ]; + + buildInputs = [ + gdbm pam readline ncurses gnutls guile texinfo gnum4 sasl fribidi nettools + gss libmysqlclient python3 + ]; + + patches = [ + ./fix-build-mb-len-max.patch + ./path-to-cat.patch + ]; + + enableParallelBuilding = false; + hardeningDisable = [ "format" ]; + + configureFlags = [ + "--with-gssapi" + "--with-gsasl" + "--with-mysql" + "--with-path-sendmail=${system-sendmail}/bin/sendmail" + ]; + + readmsg-tests = let + p = "https://raw.githubusercontent.com/gentoo/gentoo/9c921e89d51876fd876f250324893fd90c019326/net-mail/mailutils/files"; + in [ + (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"; }) + ]; + + NIX_CFLAGS_COMPILE = "-L${libmysqlclient}/lib/mysql -I${libmysqlclient}/include/mysql"; + + checkInputs = [ dejagnu ]; + doCheck = false; # fails 1 out of a bunch of tests, looks like a bug + doInstallCheck = false; # fails + + preCheck = '' + # Add missing test files + 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 + # Disable lmtp tests that require root spool. + echo > maidag/tests/lmtp.at + # 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 + ''; + + postCheck = '' + unset LD_LIBRARY_PATH + ''; + + meta = with stdenv.lib; { + 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 + servers, mail reporting utility comsatd, general-purpose mail delivery + agent maidag, mail filtering program sieve, and an implementation of MH + message handling system. + ''; + + license = with licenses; [ + lgpl3Plus /* libraries */ + gpl3Plus /* tools */ + ]; + + maintainers = with maintainers; [ orivej vrthra ]; + + homepage = "https://www.gnu.org/software/mailutils/"; + + # Some of the dependencies fail to build on {cyg,dar}win. + platforms = platforms.gnu ++ platforms.unix; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/tools/networking/mailutils/fix-build-mb-len-max.patch b/infra/libkookie/nixpkgs/pkgs/tools/networking/mailutils/fix-build-mb-len-max.patch new file mode 100644 index 000000000000..b28dfc5d99ca --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/networking/mailutils/fix-build-mb-len-max.patch @@ -0,0 +1,14 @@ +diff --git a/frm/frm.h b/frm/frm.h +index 178b87d54..7931faada 100644 +--- a/frm/frm.h ++++ b/frm/frm.h +@@ -34,6 +34,9 @@ + #ifdef HAVE_ICONV_H + # include <iconv.h> + #endif ++#ifdef HAVE_LIMITS_H ++# include <limits.h> ++#endif + #ifndef MB_LEN_MAX + # define MB_LEN_MAX 4 + #endif diff --git a/infra/libkookie/nixpkgs/pkgs/tools/networking/mailutils/path-to-cat.patch b/infra/libkookie/nixpkgs/pkgs/tools/networking/mailutils/path-to-cat.patch new file mode 100644 index 000000000000..698ee08f340f --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/tools/networking/mailutils/path-to-cat.patch @@ -0,0 +1,52 @@ +diff --git a/mh/show.c b/mh/show.c +index a43afe10c..6985386ec 100644 +--- a/mh/show.c ++++ b/mh/show.c +@@ -254,7 +254,7 @@ main (int argc, char **argv) + */ + + if (!use_showproc) +- showproc = "/bin/cat"; ++ showproc = "cat"; + else + showproc = mh_global_profile_get ("showproc", NULL); + +diff --git a/mh/tests/mhparam.at b/mh/tests/mhparam.at +index 54b7fc06a..3abd5bf9b 100644 +--- a/mh/tests/mhparam.at ++++ b/mh/tests/mhparam.at +@@ -28,7 +28,7 @@ mhparam -all | tr '\t' ' ' | sed 's/^Path:.*/Path: Mail/;s/^mhetcdir:.*/mhetcdir + [0], + [Path: Mail + mhetcdir: dir +-moreproc: /bin/cat ++moreproc: cat + Sequence-Negation: not + Draft-Folder: Mail/drafts + Aliasfile: .mh_aliases +diff --git a/mh/tests/testsuite.at b/mh/tests/testsuite.at +index c6820843c..6675a4a9c 100644 +--- a/mh/tests/testsuite.at ++++ b/mh/tests/testsuite.at +@@ -25,7 +25,7 @@ export MH + cat > $MH <<EOT + Path: $HOME/Mail + mhetcdir: $abs_top_srcdir/mh/etc +-moreproc: /bin/cat ++moreproc: cat + EOT + MTSTAILOR=$HOME/mtstailor + export MTSTAILOR +diff --git a/testsuite/lib/mailutils.exp b/testsuite/lib/mailutils.exp +index d4691d922..c1b056933 100644 +--- a/testsuite/lib/mailutils.exp ++++ b/testsuite/lib/mailutils.exp +@@ -728,7 +728,7 @@ proc mu_test_file {args} { + set pattern [lrange $args 1 end] + } + +- set res [remote_spawn host "/bin/cat $filename"] ++ set res [remote_spawn host "cat $filename"] + if { $res < 0 || $res == "" } { + perror "Reading $filename failed." + return 1; |