Last active
September 10, 2022 06:30
-
-
Save jorgecarleitao/ab6246c86c936b9c55fd to your computer and use it in GitHub Desktop.
Install Xapian in current Python virtualenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# 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 http://oligarchy.co.uk/xapian/$VERSION/${CORE}.tar.xz | |
curl -O http://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 | |
# clean | |
rm -rf $VIRTUAL_ENV/packages | |
# test | |
python -c "import xapian" |
this is awesome. This should be on xapian.org
Thanks a lot. I will give it a try
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The script doesn't work as is. Replacing
http://
byhttps://
fixes it.