unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: [PATCH 1/3] build: require Xapian >= 1.4.0
Date: Sun, 14 Apr 2019 09:44:43 -0300	[thread overview]
Message-ID: <20190414124445.3394-2-david@tethera.net> (raw)
In-Reply-To: <20190414124445.3394-1-david@tethera.net>

This is necessary before we can support Xapian 1.5, which drops the
old compact API, and replaces ValueRangeProcessor classes with
RangeProcessor classes. It also simplifies maintainability as 3
previously optional features are now part of the baseline Xapian
version.
---
 INSTALL   | 17 +++++-------
 NEWS      |  6 +++++
 configure | 78 +++++++++++++------------------------------------------
 3 files changed, 30 insertions(+), 71 deletions(-)

diff --git a/INSTALL b/INSTALL
index 6e6f4799..87fd65f2 100644
--- a/INSTALL
+++ b/INSTALL
@@ -24,20 +24,15 @@ Notmuch depends on four libraries: Xapian, GMime 2.6,
 Talloc, and zlib which are each described below:
 
 	Xapian
-	------
-	Xapian is the search-engine library underlying Notmuch.
+        ------
+        Xapian is the search-engine library underlying Notmuch.
 
-	It provides all the real machinery of indexing and searching,
-	(including the very nice parsing of the query string).
+        It provides all the real machinery of indexing and searching,
+        (including the very nice parsing of the query string).
 
-	Xapian is available from https://xapian.org
+        Xapian is available from https://xapian.org
 
-	Note: Notmuch will work best with Xapian 1.0.18 (or later) or
-	Xapian 1.1.4 (or later). Previous versions of Xapian (whether
-	1.0 or 1.1) had a performance bug that made notmuch very slow
-	when modifying tags. This would cause distracting pauses when
-	reading mail while notmuch would wait for Xapian when removing
-	the "inbox" and "unread" tags from messages in a thread.
+        Notmuch needs a Xapian version at least 1.4.0.
 
 	GMime
 	-----
diff --git a/NEWS b/NEWS
index 0a4ab4bb..9980ed9a 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,12 @@ Emacs
 Support for GNU Emacs older than 25.1 is deprecated with this release,
 and may be removed in a future release.
 
+Dependencies
+------------
+
+As of this release, support for versions of Xapian before 1.4.0 is
+removed. It was deprecated in release 0.27.
+
 Notmuch 0.28.3 (2019-03-05)
 ===========================
 
diff --git a/configure b/configure
index 5e7e5aa9..edd12488 100755
--- a/configure
+++ b/configure
@@ -401,75 +401,33 @@ else
     have_pkg_config=0
 fi
 
-printf "Checking for Xapian development files... "
+XAPIAN_MINVER=1.4
+
+printf "Checking for Xapian development files (>= $XAPIAN_MINVER)..."
 have_xapian=0
-for xapian_config in ${XAPIAN_CONFIG} xapian-config xapian-config-1.3; do
-    if ${xapian_config} --version > /dev/null 2>&1; then
-	xapian_version=$(${xapian_config} --version | sed -e 's/.* //')
-	printf "Yes (%s).\n" ${xapian_version}
-	have_xapian=1
-	xapian_cxxflags=$(${xapian_config} --cxxflags)
-	xapian_ldflags=$(${xapian_config} --libs)
-	break
-    fi
-done
+if pkg-config --atleast-version=${XAPIAN_MINVER} xapian-core; then
+   for xapian_config in ${XAPIAN_CONFIG} xapian-config; do
+       if ${xapian_config} --version > /dev/null 2>&1; then
+	   xapian_version=$(${xapian_config} --version | sed -e 's/.* //')
+	   printf "Yes (%s).\n" ${xapian_version}
+	   have_xapian=1
+           have_xapian_compact=1
+           have_xapian_field_processor=1
+           have_xapian_db_retry_lock=1
+	   xapian_cxxflags=$(${xapian_config} --cxxflags)
+	   xapian_ldflags=$(${xapian_config} --libs)
+	   break
+       fi
+   done
+fi
 if [ ${have_xapian} = "0" ]; then
     printf "No.\n"
     errors=$((errors + 1))
 fi
 
-have_xapian_compact=0
-have_xapian_field_processor=0
 if [ ${have_xapian} = "1" ]; then
-    printf "Checking for Xapian compaction support... "
-    cat>_compact.cc<<EOF
-#include <xapian.h>
-class TestCompactor : public Xapian::Compactor { };
-EOF
-    if ${CXX} ${CXXFLAGS_for_sh} ${xapian_cxxflags} -c _compact.cc -o _compact.o > /dev/null 2>&1
-    then
-	have_xapian_compact=1
-	printf "Yes.\n"
-    else
-	printf "No.\n"
-	errors=$((errors + 1))
-    fi
-
-    rm -f _compact.o _compact.cc
-
-    printf "Checking for Xapian FieldProcessor API... "
-    cat>_field_processor.cc<<EOF
-#include <xapian.h>
-class TitleFieldProcessor : public Xapian::FieldProcessor { };
-EOF
-    if ${CXX} ${CXXFLAGS_for_sh} ${xapian_cxxflags} -c _field_processor.cc -o _field_processor.o > /dev/null 2>&1
-    then
-	have_xapian_field_processor=1
-	printf "Yes.\n"
-    else
-	printf "No. (optional)\n"
-    fi
-
-    rm -f _field_processor.o _field_processor.cc
 
     default_xapian_backend=""
-    # DB_RETRY_LOCK is only supported on Xapian > 1.3.2
-    have_xapian_db_retry_lock=0
-    if [ $WITH_RETRY_LOCK = "1" ]; then
-	printf "Checking for Xapian lock retry support... "
-	cat>_retry.cc<<EOF
-#include <xapian.h>
-int flag = Xapian::DB_RETRY_LOCK;
-EOF
-	if ${CXX} ${CXXFLAGS_for_sh} ${xapian_cxxflags} -c _retry.cc -o _retry.o > /dev/null 2>&1
-	then
-	    have_xapian_db_retry_lock=1
-	    printf "Yes.\n"
-	else
-	    printf "No. (optional)\n"
-	fi
-	rm -f _retry.o _retry.cc
-    fi
 
     printf "Testing default Xapian backend... "
     cat >_default_backend.cc <<EOF
-- 
2.20.1

  reply	other threads:[~2019-04-14 12:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-14 12:44 Drop support for pre-1.4 Xapian, prepare for 1.5.x David Bremner
2019-04-14 12:44 ` David Bremner [this message]
2019-04-14 12:44 ` [PATCH 2/3] lib: migrate to post Xapian 1.3.4 compact support David Bremner
2019-04-14 12:44 ` [PATCH 3/3] lib: migrate from Xapian ValueRangeProcessor to RangeProcessor David Bremner
2019-04-15 11:10 ` Drop support for pre-1.4 Xapian, prepare for 1.5.x David Bremner
2019-04-21 14:43   ` David Bremner
2019-05-23  1:12     ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190414124445.3394-2-david@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).