From 9c471bdd6d1411d49863bb789a695c36945b29fa Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Sun, 13 Dec 2015 21:22:39 -0500 Subject: [PATCH] mutt: Various fixes and improvements - Fix hardlink usage which doesn't work on Android 6. - Enable header cache and depend on gdbm. - Specify $PREFIX/bin/sh as exec shell to avoid trying /bin/sh. Fixes #84. - Avoid building bundled&broken (v)snprintf functions. --- packages/mutt/build.sh | 17 +++++++++++++++-- packages/mutt/lib.c.patch | 22 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 packages/mutt/lib.c.patch diff --git a/packages/mutt/build.sh b/packages/mutt/build.sh index 4ec454143..61679fd9d 100644 --- a/packages/mutt/build.sh +++ b/packages/mutt/build.sh @@ -1,9 +1,22 @@ TERMUX_PKG_HOMEPAGE=http://www.mutt.org/ TERMUX_PKG_DESCRIPTION="Mail client" TERMUX_PKG_VERSION=1.5.24 +TERMUX_PKG_BUILD_REVISION=1 TERMUX_PKG_SRCURL=https://bitbucket.org/mutt/mutt/downloads/mutt-${TERMUX_PKG_VERSION}.tar.gz -TERMUX_PKG_DEPENDS="libandroid-support, ncurses, openssl" -TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-smtp --enable-imap --enable-pop --with-mailpath=$TERMUX_PREFIX/var/mail --with-ssl --enable-compressed --without-idn" +TERMUX_PKG_DEPENDS="libandroid-support, ncurses, gdbm, openssl" +TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-smtp --enable-imap --enable-pop --with-mailpath=$TERMUX_PREFIX/var/mail --with-ssl --enable-compressed --without-idn --enable-hcache" +TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-exec-shell=$TERMUX_PREFIX/bin/sh" +# The mutt autoconf guesses no for working (v)snprintf and uses broken local versions - avoid that: +TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" mutt_cv_c99_snprintf=yes mutt_cv_c99_vsnprintf=yes" +# TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-sasl" +# bin/{flea,muttbug}: File bug against mutt: +TERMUX_PKG_RM_AFTER_INSTALL="bin/flea bin/muttbug" + +termux_step_post_configure () { + # Build wants to run mutt_md5 at build time: + gcc -D'uint32_t=unsigned int' -DMD5UTIL $TERMUX_PKG_SRCDIR/md5.c -o $TERMUX_PKG_BUILDDIR/mutt_md5 + $TERMUX_TOUCH -d "next hour" $TERMUX_PKG_BUILDDIR/mutt_md5 +} termux_step_post_make_install () { cp $TERMUX_PKG_SRCDIR/doc/mutt.man $TERMUX_PREFIX/share/man/man1/mutt.1.man diff --git a/packages/mutt/lib.c.patch b/packages/mutt/lib.c.patch new file mode 100644 index 000000000..f25ae1dd5 --- /dev/null +++ b/packages/mutt/lib.c.patch @@ -0,0 +1,22 @@ +diff -u -r ../mutt-1.5.24/lib.c ./lib.c +--- ../mutt-1.5.24/lib.c 2015-08-30 13:06:38.000000000 -0400 ++++ ./lib.c 2015-12-13 17:05:02.546904223 -0500 +@@ -445,6 +445,10 @@ + + int safe_rename (const char *src, const char *target) + { ++#ifdef __ANDROID__ ++ /* Android (since 6.0) does not support hardlinks. */ ++ return rename(src, target); ++#else + struct stat ssb, tsb; + + if (!src || !target) +@@ -537,6 +541,7 @@ + + + return 0; ++#endif + } + +