[PATCH 1/3] build: require Xapian >= 1.4.0

David Bremner david at tethera.net
Sun Apr 14 05:44:43 PDT 2019


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



More information about the notmuch mailing list