Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mailutils: 2.2 -> 3.2 #27580

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 38 additions & 16 deletions pkgs/tools/networking/mailutils/default.nix
Original file line number Diff line number Diff line change
@@ -1,36 +1,58 @@
{ fetchurl, stdenv, gettext, gdbm, libtool, pam, readline
, ncurses, gnutls, sasl, fribidi, gss , mysql, guile, texinfo,
gnum4, dejagnu, nettools }:
{ stdenv, fetchurl, autoreconfHook, automake, dejagnu, gettext, libtool, pkgconfig
, gdbm, pam, readline, ncurses, gnutls, guile, texinfo, gnum4, sasl, fribidi, nettools
, gss, mysql }:

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 = [ ./path-to-cat.patch ./no-gets.patch ./scm_c_string.patch ];
patches = [
./fix-build-gentoo-bug-612712.patch
./fix-build-mb-len-max.patch
./fix-test-ali-awk.patch
./path-to-cat.patch
];

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 ${./readmsg-tests}/* readmsg/tests/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where these files added later to upstream?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They have always been in the upstream repository, but they are missing from the released archive! I copied this fix from http://data.gpo.zugaina.org/gentoo/net-mail/mailutils/mailutils-3.2.ebuild

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use repository snapshot which contains these files: http://git.savannah.gnu.org/cgit/mailutils.git/snapshot/mailutils-release-3.2.tar.gz

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then please switch to the other url.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turned out to be more involved. Bootstrapping the build requires a git checkout (and wget, and rsync), so I used fetchgit and added additional dependencies to run ./bootstrap.

# Disable comsat tests that fail without tty in the sandbox.
tty -s || echo > comsat/tests/testsuite.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";
Expand Down Expand Up @@ -60,7 +82,7 @@ stdenv.mkDerivation rec {
gpl3Plus /* tools */
];

maintainers = with maintainers; [ vrthra ];
maintainers = with maintainers; [ orivej vrthra ];

homepage = http://www.gnu.org/software/mailutils/;

Expand Down
70 changes: 70 additions & 0 deletions pkgs/tools/networking/mailutils/fix-build-gentoo-bug-612712.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
From afbb33cf9ff750e93a9a4c1f51a3b62d584f056e Mon Sep 17 00:00:00 2001
From: Sergey Poznyakoff <[email protected]>
Date: Sun, 19 Mar 2017 17:31:08 +0200
Subject: Fix a bug in field-map handling.

* libmailutils/cfg/driver.c (parse_mapping): Fix expected value type.
* libmu_auth/sql.c (get_field): Remove left-over mu_assoc_ref call
(see 622bc770).
---
NEWS | 2 +-
libmailutils/cfg/driver.c | 7 ++++++-
libmu_auth/sql.c | 11 +++++++----
3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/libmailutils/cfg/driver.c b/libmailutils/cfg/driver.c
index 7da75a8..8af543d 100644
--- a/libmailutils/cfg/driver.c
+++ b/libmailutils/cfg/driver.c
@@ -617,10 +617,15 @@ static int
parse_mapping (void *item, void *data)
{
struct mapping_closure *clos = data;
- char *str = item;
+ struct mu_config_value *cval = item;
+ char const *str;
size_t len;
char *key, *val;
int rc;
+
+ if (mu_cfg_assert_value_type (cval, MU_CFG_STRING))
+ return 1;
+ str = cval->v.string;

len = strcspn (str, "=");
if (str[len] == 0)
diff --git a/libmu_auth/sql.c b/libmu_auth/sql.c
index d69c36c..c50598d 100644
--- a/libmu_auth/sql.c
+++ b/libmu_auth/sql.c
@@ -214,20 +214,23 @@ mu_sql_expand_query (const char *query, const char *ustr)
static int
get_field (mu_sql_connection_t conn, const char *id, char **ret, int mandatory)
{
- const char **name = mu_assoc_ref (mu_sql_module_config.field_map, id);
- int rc = mu_sql_get_field (conn, 0, name ? *name : id, ret);
+ int rc;
+ const char *name = mu_assoc_get (mu_sql_module_config.field_map, id);
+ if (!name)
+ name = id;
+ rc = mu_sql_get_field (conn, 0, name, ret);
if (rc)
{
if (mandatory || rc != MU_ERR_NOENT)
mu_error (_("cannot get SQL field `%s' (`%s'): %s"),
- id, name ? *name : id, mu_strerror (rc));
+ id, name, mu_strerror (rc));
}
else if (!*ret)
{
if (mandatory)
{
mu_error (_("SQL field `%s' (`%s') has NULL value"),
- id, name ? *name : id);
+ id, name);
rc = MU_ERR_READ;
}
else
--
cgit v1.0-41-gc330

14 changes: 14 additions & 0 deletions pkgs/tools/networking/mailutils/fix-build-mb-len-max.patch
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions pkgs/tools/networking/mailutils/fix-test-ali-awk.patch
Original file line number Diff line number Diff line change
@@ -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
14 changes: 0 additions & 14 deletions pkgs/tools/networking/mailutils/no-gets.patch

This file was deleted.

49 changes: 44 additions & 5 deletions pkgs/tools/networking/mailutils/path-to-cat.patch
Original file line number Diff line number Diff line change
@@ -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]
}

Expand Down
36 changes: 36 additions & 0 deletions pkgs/tools/networking/mailutils/readmsg-tests/hdr.at
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2007-2012, 2014-2015 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# GNU Mailutils is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.

READMSGTEST([readmsg -h],[hdr],
[readmsg -h SOMETHING],
[0],
[From [email protected] Fri Dec 28 23:28:09 2001
Received: (from [email protected])
by dontmailme.org id fERKR9N16790
for [email protected]; Fri, 28 Dec 2001 22:18:08 +0200
Date: Fri, 28 Dec 2001 23:28:08 +0200
From: Bar <[email protected]>
To: Foo Bar <[email protected]>
Message-Id: <[email protected]>
Subject: Re: Jabberwocky

It seems very pretty, but it's *rather* hard to understand!'
Somehow it seems to fill my head with ideas -- only I don't
exactly know what they are! However, SOMEBODY killed SOMETHING:
that's clear, at any rate...


])
26 changes: 26 additions & 0 deletions pkgs/tools/networking/mailutils/readmsg-tests/nohdr.at
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2007-2012, 2014-2015 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# GNU Mailutils is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.

READMSGTEST([readmsg -n],[nohdr],
[readmsg -n SOMETHING],
[0],
[It seems very pretty, but it's *rather* hard to understand!'
Somehow it seems to fill my head with ideas -- only I don't
exactly know what they are! However, SOMEBODY killed SOMETHING:
that's clear, at any rate...


])
73 changes: 73 additions & 0 deletions pkgs/tools/networking/mailutils/readmsg-tests/twomsg.at
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2007-2012, 2014-2015 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# GNU Mailutils is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.

READMSGTEST([readmsg 1 2],[twomsg],
[1 2],
[0],
[Date: Fri, 28 Dec 2001 22:18:08 +0200
From: Foo Bar <[email protected]>
To: Bar <[email protected]>
Subject: Jabberwocky

`Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe.

`Beware the Jabberwock, my son!
The jaws that bite, the claws that catch!
Beware the Jujub bird, and shun
The frumious Bandersnatch!'

He took his vorpal sword in hand:
Long time the manxome foe he sought --
So rested he by the Tumtum gree,
And stood awhile in thought.

And as in uffish thought he stood,
The Jabberwock, with eyes of flame,
Came whiffling through the tulgey wook,
And burbled as it came!

One, two! One, two! And through and through
The vorpal blade went snicker-snack!
He left it dead, and with its head
He went galumphing back.

`And has thou slain the Jabberwock?
Come to my arms, my beamish boy!
O frabjous day! Calloh! Callay!
He chortled in his joy.

`Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe.


Date: Fri, 28 Dec 2001 23:28:08 +0200
From: Bar <[email protected]>
To: Foo Bar <[email protected]>
Subject: Re: Jabberwocky

It seems very pretty, but it's *rather* hard to understand!'
Somehow it seems to fill my head with ideas -- only I don't
exactly know what they are! However, SOMEBODY killed SOMETHING:
that's clear, at any rate...


])

Loading