From ab026c42aae9c2dffddc2742a29b86ce6a09f41c Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Fri, 7 Apr 2017 01:11:41 +0200 Subject: [PATCH] notmuch: Add package --- packages/notmuch/build.sh | 17 ++++++++++++ packages/notmuch/configure.patch | 27 +++++++++++++++++++ .../notmuch/lib-message-property.cc.patch | 12 +++++++++ packages/notmuch/lib-message.cc.patch | 12 +++++++++ packages/notmuch/notmuch-config.c.patch | 22 +++++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 packages/notmuch/build.sh create mode 100644 packages/notmuch/configure.patch create mode 100644 packages/notmuch/lib-message-property.cc.patch create mode 100644 packages/notmuch/lib-message.cc.patch create mode 100644 packages/notmuch/notmuch-config.c.patch diff --git a/packages/notmuch/build.sh b/packages/notmuch/build.sh new file mode 100644 index 000000000..336439f1f --- /dev/null +++ b/packages/notmuch/build.sh @@ -0,0 +1,17 @@ +TERMUX_PKG_HOMEPAGE=https://notmuchmail.org +TERMUX_PKG_DESCRIPTION="Thread-based email index, search and tagging system" +TERMUX_PKG_VERSION=0.24.1 +TERMUX_PKG_SRCURL=https://notmuchmail.org/releases/notmuch-${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=fa117de2c6096dd896a333b9c770572a939e04a02abe6745b6b07f5363063ca3 +TERMUX_PKG_BUILD_IN_SRC=yes +TERMUX_PKG_DEPENDS="glib, libgmime, libtalloc, libxapian" + +termux_step_configure () { + cd $TERMUX_PKG_SRCDIR + XAPIAN_CONFIG=$TERMUX_PREFIX/bin/xapian-config ./configure \ + --prefix=$TERMUX_PREFIX \ + --without-api-docs \ + --without-desktop \ + --without-emacs \ + --without-ruby +} diff --git a/packages/notmuch/configure.patch b/packages/notmuch/configure.patch new file mode 100644 index 000000000..a102b84f2 --- /dev/null +++ b/packages/notmuch/configure.patch @@ -0,0 +1,27 @@ +diff -u -r ../notmuch-0.24.1/configure ./configure +--- ../notmuch-0.24.1/configure 2017-04-01 14:29:38.000000000 +0200 ++++ ./configure 2017-04-07 00:53:36.743033402 +0200 +@@ -352,7 +352,7 @@ + return 0; + } + EOF +-if ${CC} ${CFLAGS} _libversion.c -o _libversion > /dev/null 2>&1 && \ ++if ${CC_FOR_BUILD} _libversion.c -o _libversion > /dev/null 2>&1 && \ + ./_libversion > _libversion.sh && . ./_libversion.sh + then + printf "OK.\n" +@@ -554,14 +554,6 @@ + valgrind_cflags= + fi + +-printf "Checking for bash-completion (>= 1.90)... " +-if pkg-config --atleast-version=1.90 bash-completion; then +- printf "Yes.\n" +-else +- printf "No (will not install bash completion).\n" +- WITH_BASH=0 +-fi +- + if [ -z "${EMACSLISPDIR-}" ]; then + EMACSLISPDIR="\$(prefix)/share/emacs/site-lisp" + fi diff --git a/packages/notmuch/lib-message-property.cc.patch b/packages/notmuch/lib-message-property.cc.patch new file mode 100644 index 000000000..2dfaab20e --- /dev/null +++ b/packages/notmuch/lib-message-property.cc.patch @@ -0,0 +1,12 @@ +diff -u -r ../notmuch-0.24.1/lib/message-property.cc ./lib/message-property.cc +--- ../notmuch-0.24.1/lib/message-property.cc 2017-04-01 14:29:38.000000000 +0200 ++++ ./lib/message-property.cc 2017-04-07 00:48:00.914918764 +0200 +@@ -51,7 +51,7 @@ + if (key == NULL || value == NULL) + return NOTMUCH_STATUS_NULL_POINTER; + +- if (index (key, '=')) ++ if (strchr (key, '=')) + return NOTMUCH_STATUS_ILLEGAL_ARGUMENT; + + term = talloc_asprintf (message, "%s=%s", key, value); diff --git a/packages/notmuch/lib-message.cc.patch b/packages/notmuch/lib-message.cc.patch new file mode 100644 index 000000000..20b83e6fd --- /dev/null +++ b/packages/notmuch/lib-message.cc.patch @@ -0,0 +1,12 @@ +diff -u -r ../notmuch-0.24.1/lib/message.cc ./lib/message.cc +--- ../notmuch-0.24.1/lib/message.cc 2017-04-01 14:29:38.000000000 +0200 ++++ ./lib/message.cc 2017-04-07 00:45:52.192408149 +0200 +@@ -1837,7 +1837,7 @@ + const char *key; + char *value; + +- value = index(node->string, '='); ++ value = strchr(node->string, '='); + if (!value) + INTERNAL_ERROR ("malformed property term"); + diff --git a/packages/notmuch/notmuch-config.c.patch b/packages/notmuch/notmuch-config.c.patch new file mode 100644 index 000000000..ccba609ef --- /dev/null +++ b/packages/notmuch/notmuch-config.c.patch @@ -0,0 +1,22 @@ +diff -u -r ../notmuch-0.24.1/notmuch-config.c ./notmuch-config.c +--- ../notmuch-0.24.1/notmuch-config.c 2017-04-01 14:29:38.000000000 +0200 ++++ ./notmuch-config.c 2017-04-07 01:01:21.205661688 +0200 +@@ -157,6 +157,8 @@ + pw_buf = talloc_zero_size(ctx, pw_buf_size); + } + ++#if !defined(__ANDROID__) || defined(__LP64__) ++ /* Only 64-bit Android has the pw_gecos field. */ + if (e == 0) { + char *comma = strchr (passwd.pw_gecos, ','); + if (comma) +@@ -167,6 +169,9 @@ + } else { + name = talloc_strdup (ctx, ""); + } ++#else ++ name = talloc_strdup (ctx, ""); ++#endif + + talloc_free (pw_buf); +