summary refs log tree commit diff
path: root/pkgs/tools/networking/mailutils
diff options
context:
space:
mode:
authorOrivej Desh <orivej@gmx.fr>2017-07-23 10:28:43 +0000
committerRobin Gloster <mail@glob.in>2017-07-26 13:32:59 +0200
commit1ec5b7f1d370a15c9a4db20e4c3802e8e7eb7d18 (patch)
treeb3df57a267cb195134ee8c777fc2d108c125a5a0 /pkgs/tools/networking/mailutils
parent2b0315d7d0429698c66d9cee26f892a05ef62ed3 (diff)
downloadnixpkgs-1ec5b7f1d370a15c9a4db20e4c3802e8e7eb7d18.tar
nixpkgs-1ec5b7f1d370a15c9a4db20e4c3802e8e7eb7d18.tar.gz
nixpkgs-1ec5b7f1d370a15c9a4db20e4c3802e8e7eb7d18.tar.bz2
nixpkgs-1ec5b7f1d370a15c9a4db20e4c3802e8e7eb7d18.tar.lz
nixpkgs-1ec5b7f1d370a15c9a4db20e4c3802e8e7eb7d18.tar.xz
nixpkgs-1ec5b7f1d370a15c9a4db20e4c3802e8e7eb7d18.tar.zst
nixpkgs-1ec5b7f1d370a15c9a4db20e4c3802e8e7eb7d18.zip
mailutils: 2.2 -> 3.2
Diffstat (limited to 'pkgs/tools/networking/mailutils')
-rw-r--r--pkgs/tools/networking/mailutils/default.nix72
-rw-r--r--pkgs/tools/networking/mailutils/fix-build-mb-len-max.patch14
-rw-r--r--pkgs/tools/networking/mailutils/fix-test-ali-awk.patch16
-rw-r--r--pkgs/tools/networking/mailutils/no-gets.patch14
-rw-r--r--pkgs/tools/networking/mailutils/path-to-cat.patch49
-rw-r--r--pkgs/tools/networking/mailutils/scm_c_string.patch15
6 files changed, 130 insertions, 50 deletions
diff --git a/pkgs/tools/networking/mailutils/default.nix b/pkgs/tools/networking/mailutils/default.nix
index f83ea004db6..82d581650bb 100644
--- a/pkgs/tools/networking/mailutils/default.nix
+++ b/pkgs/tools/networking/mailutils/default.nix
@@ -1,36 +1,76 @@
-{ fetchurl, stdenv, gettext, gdbm, libtool, pam, readline
-, ncurses, gnutls, sasl, fribidi, gss , mysql, guile, texinfo,
-  gnum4, dejagnu, nettools }:
+{ stdenv, fetchurl, fetchpatch, autoreconfHook, dejagnu, gettext, libtool, pkgconfig
+, gdbm, pam, readline, ncurses, gnutls, guile, texinfo, gnum4, sasl, fribidi, nettools
+, gss, mysql }:
 
+let
+  p = "https://raw.githubusercontent.com/gentoo/gentoo/9c921e89d51876fd876f250324893fd90c019326/net-mail/mailutils/files";
+in
 stdenv.mkDerivation rec {
-  name = "mailutils-2.2";
+  name = "${project}-${version}";
+  project = "mailutils";
+  version = "3.2";
 
   src = fetchurl {
-    url = "mirror://gnu/mailutils/${name}.tar.bz2";
-    sha256 = "0szbqa12zqzldqyw97lxqax3ja2adis83i7brdfsxmrfw68iaf65";
+    url = "mirror://gnu/${project}/${name}.tar.xz";
+    sha256 = "0zh7xn8yvnw9zkc7gi5290i34viwxp1rn0g1q9nyvmckkvk59lwn";
   };
 
-  hardeningDisable = [ "format" ];
+  nativeBuildInputs = [
+    autoreconfHook gettext libtool pkgconfig
+  ] ++ stdenv.lib.optional doCheck dejagnu;
+
+  buildInputs = [
+    gdbm pam readline ncurses gnutls guile texinfo gnum4 sasl fribidi nettools
+    gss mysql.lib
+  ];
+
+  patches = [
+    (fetchpatch {
+      url = "${p}/mailutils-3.2-fix-build.patch";
+      sha256 = "0yzkfx3j1zkkb43fhchjqphw4xznbclj39bjzjggv32gppy6d1db";
+    })
+    ./fix-build-mb-len-max.patch
+    ./fix-test-ali-awk.patch
+    ./path-to-cat.patch
+  ];
 
-  patches = [ ./path-to-cat.patch ./no-gets.patch ./scm_c_string.patch ];
+  readmsg-tests = stdenv.lib.optionals doCheck [
+    (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"; })
+  ];
 
   postPatch = ''
+    sed -e '/AM_GNU_GETTEXT_VERSION/s/0.18/0.19/' -i configure.ac
     sed -i -e '/chown root:mail/d' \
            -e 's/chmod [24]755/chmod 0755/' \
-      */Makefile{,.in,.am}
+      */Makefile{.in,.am}
   '';
 
   configureFlags = [
-    "--with-gsasl"
-    "--with-gssapi=${gss}"
+    "--with-gssapi"
+    "--with-mysql"
   ];
 
-  buildInputs =
-   [ gettext gdbm libtool pam readline ncurses
-     gnutls mysql.lib guile texinfo gnum4 sasl fribidi gss nettools ]
-   ++ stdenv.lib.optional doCheck dejagnu;
+  preCheck = ''
+    # Add missing 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 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";
 
   doCheck = true;
+  enableParallelBuilding = true;
+  hardeningDisable = [ "format" ];
 
   meta = with stdenv.lib; {
     description = "Rich and powerful protocol-independent mail framework";
@@ -60,7 +100,7 @@ stdenv.mkDerivation rec {
       gpl3Plus /* tools */
     ];
 
-    maintainers = with maintainers; [ vrthra ];
+    maintainers = with maintainers; [ orivej vrthra ];
 
     homepage = http://www.gnu.org/software/mailutils/;
 
diff --git a/pkgs/tools/networking/mailutils/fix-build-mb-len-max.patch b/pkgs/tools/networking/mailutils/fix-build-mb-len-max.patch
new file mode 100644
index 00000000000..b28dfc5d99c
--- /dev/null
+++ b/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/pkgs/tools/networking/mailutils/fix-test-ali-awk.patch b/pkgs/tools/networking/mailutils/fix-test-ali-awk.patch
new file mode 100644
index 00000000000..3d301d530de
--- /dev/null
+++ b/pkgs/tools/networking/mailutils/fix-test-ali-awk.patch
@@ -0,0 +1,16 @@
+diff --git a/mh/tests/ali.at b/mh/tests/ali.at
+index 28c0e5451..c76cf9363 100644
+--- a/mh/tests/ali.at
++++ b/mh/tests/ali.at
+@@ -85,9 +85,9 @@ ali -a ./mh_aliases korzen | tr -d ' '
+ [expout])
+ 
+ MH_CHECK([ali: group id],[ali05 ali-group-id ali-gid],[
+-cat /etc/passwd | awk -F : '/^#/ { next } $4==0 { print $1 }' > expout
++cat /etc/passwd | awk -F : '/^#/ { next } $4==0 { print $1; exit }' > expout
+ test -s expout || AT_SKIP_TEST
+-name=`awk -F : '/^#/ { next } $3==0 { print $1 }' /etc/group < /dev/null`
++name=`awk -F : '/^#/ { next } $3==0 { print $1; exit }' /etc/group < /dev/null`
+ test -z "$name" && AT_SKIP_TEST
+ 
+ echo "korzen: +$name" > mh_aliases
diff --git a/pkgs/tools/networking/mailutils/no-gets.patch b/pkgs/tools/networking/mailutils/no-gets.patch
deleted file mode 100644
index d72fa3f056c..00000000000
--- a/pkgs/tools/networking/mailutils/no-gets.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/lib/stdio.in.h
-+++ b/lib/stdio.in.h
-@@ -138,8 +138,10 @@
- /* It is very rare that the developer ever has full control of stdin,
-    so any use of gets warrants an unconditional warning.  Assume it is
-    always declared, since it is required by C89.  */
--#undef gets
-+#ifdef gets
-+# undef gets
- _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
-+#endif
- 
- #if @GNULIB_FOPEN@
- # if @REPLACE_FOPEN@
diff --git a/pkgs/tools/networking/mailutils/path-to-cat.patch b/pkgs/tools/networking/mailutils/path-to-cat.patch
index a9ae7c5366d..698ee08f340 100644
--- a/pkgs/tools/networking/mailutils/path-to-cat.patch
+++ b/pkgs/tools/networking/mailutils/path-to-cat.patch
@@ -1,8 +1,47 @@
-Fix absolute path to `cat'.
-
---- mailutils-2.2/testsuite/lib/mailutils.exp	2010-09-10 13:39:58.000000000 +0200
-+++ mailutils-2.2/testsuite/lib/mailutils.exp	2010-09-10 13:40:00.000000000 +0200
-@@ -719,7 +719,7 @@ proc mu_test_file {args} {
+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]
      }
      
diff --git a/pkgs/tools/networking/mailutils/scm_c_string.patch b/pkgs/tools/networking/mailutils/scm_c_string.patch
deleted file mode 100644
index 367dd2d6406..00000000000
--- a/pkgs/tools/networking/mailutils/scm_c_string.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-See https://lists.gnu.org/archive/html/bug-mailutils/2010-10/msg00005.html
-
-diff -u mailutils-2.2/libmu_scm/mu_message.c mailutils-2.2.new/libmu_scm/mu_message.c
---- mailutils-2.2/libmu_scm/mu_message.c	2010-04-18 10:29:07.000000000 -0700
-+++ mailutils-2.2.new/libmu_scm/mu_message.c	2016-07-03 21:18:53.746185547 -0700
-@@ -510,8 +510,8 @@
-     {
-       SCM car = SCM_CAR (lst);
-       if (scm_is_string (car)
- 	  && mu_c_strncasecmp (scm_i_string_chars (car), name,
--			       scm_i_string_length (car)) == 0)
-+			       scm_c_string_length (car)) == 0)
- 	return 1;
-     }
-   return 0;