comparison tools/xapian_installer.sh @ 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
children
comparison
equal deleted inserted replaced
1202:50e511e032db 1203:8cd15df9b563
1 #!/usr/bin/env bash
2 # BGN: This script was originally obtained from:
3 # https://gist.github.com/jorgecarleitao/ab6246c86c936b9c55fd
4 #
5 # first argument of the script is Xapian version (e.g. 1.2.19)
6 VERSION=$1
7
8 # prepare
9 mkdir $VIRTUAL_ENV/packages && cd $VIRTUAL_ENV/packages
10
11 CORE=xapian-core-$VERSION
12 BINDINGS=xapian-bindings-$VERSION
13
14 # download
15 echo "Downloading source..."
16 curl -O https://oligarchy.co.uk/xapian/$VERSION/${CORE}.tar.xz
17 curl -O https://oligarchy.co.uk/xapian/$VERSION/${BINDINGS}.tar.xz
18
19 # extract
20 echo "Extracting source..."
21 tar xf ${CORE}.tar.xz
22 tar xf ${BINDINGS}.tar.xz
23
24 # install
25 echo "Installing Xapian-core..."
26 cd $VIRTUAL_ENV/packages/${CORE}
27 ./configure --prefix=$VIRTUAL_ENV && make && make install
28
29 PYV=`python -c "import sys;t='{v[0]}'.format(v=list(sys.version_info[:1]));sys.stdout.write(t)";`
30
31 if [ $PYV = "2" ]; then
32 PYTHON_FLAG=--with-python
33 else
34 PYTHON_FLAG=--with-python3
35 fi
36
37 echo "Installing Xapian-bindings..."
38 cd $VIRTUAL_ENV/packages/${BINDINGS}
39 ### ./configure --prefix=$VIRTUAL_ENV $PYTHON_FLAG XAPIAN_CONFIG=$VIRTUAL_ENV/bin/xapian-config-1.3 && make && make install
40 ./configure --prefix=$VIRTUAL_ENV $PYTHON_FLAG XAPIAN_CONFIG=$VIRTUAL_ENV/bin/xapian-config && make && make install
41
42 # clean
43 rm -rf $VIRTUAL_ENV/packages
44
45 # test
46 python -c "import xapian"