changeset 1203:8cd15df9b563

Controlling the xapian install script in tools.
author Brian Neal <bgneal@gmail.com>
date Sat, 04 Jan 2025 14:19:19 -0600
parents 50e511e032db
children 061ccb003dad
files tools/xapian_installer.sh
diffstat 1 files changed, 46 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/xapian_installer.sh	Sat Jan 04 14:19:19 2025 -0600
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+# BGN: This script was originally obtained from:
+#  https://gist.github.com/jorgecarleitao/ab6246c86c936b9c55fd
+#  
+# first argument of the script is Xapian version (e.g. 1.2.19)
+VERSION=$1
+
+# prepare
+mkdir $VIRTUAL_ENV/packages && cd $VIRTUAL_ENV/packages
+
+CORE=xapian-core-$VERSION
+BINDINGS=xapian-bindings-$VERSION
+
+# download
+echo "Downloading source..."
+curl -O https://oligarchy.co.uk/xapian/$VERSION/${CORE}.tar.xz
+curl -O https://oligarchy.co.uk/xapian/$VERSION/${BINDINGS}.tar.xz
+
+# extract
+echo "Extracting source..."
+tar xf ${CORE}.tar.xz
+tar xf ${BINDINGS}.tar.xz
+
+# install
+echo "Installing Xapian-core..."
+cd $VIRTUAL_ENV/packages/${CORE}
+./configure --prefix=$VIRTUAL_ENV && make && make install
+
+PYV=`python -c "import sys;t='{v[0]}'.format(v=list(sys.version_info[:1]));sys.stdout.write(t)";`
+
+if [ $PYV = "2" ]; then
+    PYTHON_FLAG=--with-python
+else
+    PYTHON_FLAG=--with-python3
+fi
+
+echo "Installing Xapian-bindings..."
+cd $VIRTUAL_ENV/packages/${BINDINGS}
+### ./configure --prefix=$VIRTUAL_ENV $PYTHON_FLAG XAPIAN_CONFIG=$VIRTUAL_ENV/bin/xapian-config-1.3 && make && make install
+./configure --prefix=$VIRTUAL_ENV $PYTHON_FLAG XAPIAN_CONFIG=$VIRTUAL_ENV/bin/xapian-config && make && make install
+
+# clean
+rm -rf $VIRTUAL_ENV/packages
+
+# test
+python -c "import xapian"