bgneal@1203: #!/usr/bin/env bash bgneal@1203: # BGN: This script was originally obtained from: bgneal@1203: # https://gist.github.com/jorgecarleitao/ab6246c86c936b9c55fd bgneal@1203: # bgneal@1203: # first argument of the script is Xapian version (e.g. 1.2.19) bgneal@1203: VERSION=$1 bgneal@1203: bgneal@1203: # prepare bgneal@1203: mkdir $VIRTUAL_ENV/packages && cd $VIRTUAL_ENV/packages bgneal@1203: bgneal@1203: CORE=xapian-core-$VERSION bgneal@1203: BINDINGS=xapian-bindings-$VERSION bgneal@1203: bgneal@1203: # download bgneal@1203: echo "Downloading source..." bgneal@1203: curl -O https://oligarchy.co.uk/xapian/$VERSION/${CORE}.tar.xz bgneal@1203: curl -O https://oligarchy.co.uk/xapian/$VERSION/${BINDINGS}.tar.xz bgneal@1203: bgneal@1203: # extract bgneal@1203: echo "Extracting source..." bgneal@1203: tar xf ${CORE}.tar.xz bgneal@1203: tar xf ${BINDINGS}.tar.xz bgneal@1203: bgneal@1203: # install bgneal@1203: echo "Installing Xapian-core..." bgneal@1203: cd $VIRTUAL_ENV/packages/${CORE} bgneal@1203: ./configure --prefix=$VIRTUAL_ENV && make && make install bgneal@1203: bgneal@1203: PYV=`python -c "import sys;t='{v[0]}'.format(v=list(sys.version_info[:1]));sys.stdout.write(t)";` bgneal@1203: bgneal@1203: if [ $PYV = "2" ]; then bgneal@1203: PYTHON_FLAG=--with-python bgneal@1203: else bgneal@1203: PYTHON_FLAG=--with-python3 bgneal@1203: fi bgneal@1203: bgneal@1203: echo "Installing Xapian-bindings..." bgneal@1203: cd $VIRTUAL_ENV/packages/${BINDINGS} bgneal@1203: ### ./configure --prefix=$VIRTUAL_ENV $PYTHON_FLAG XAPIAN_CONFIG=$VIRTUAL_ENV/bin/xapian-config-1.3 && make && make install bgneal@1203: ./configure --prefix=$VIRTUAL_ENV $PYTHON_FLAG XAPIAN_CONFIG=$VIRTUAL_ENV/bin/xapian-config && make && make install bgneal@1203: bgneal@1203: # clean bgneal@1203: rm -rf $VIRTUAL_ENV/packages bgneal@1203: bgneal@1203: # test bgneal@1203: python -c "import xapian"