2024-06-22 19:15:37 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Originates from https://gist.github.com/jorgecarleitao/ab6246c86c936b9c55fd
|
|
|
|
# first argument of the script is Xapian version (e.g. 1.2.19)
|
2024-07-08 13:02:05 +00:00
|
|
|
VERSION="$1"
|
2024-06-22 19:15:37 +00:00
|
|
|
|
|
|
|
# Cleanup env vars for auto discovery mechanism
|
|
|
|
export CPATH=
|
|
|
|
export LIBRARY_PATH=
|
|
|
|
export CFLAGS=
|
|
|
|
export LDFLAGS=
|
|
|
|
export CCFLAGS=
|
|
|
|
export CXXFLAGS=
|
|
|
|
export CPPFLAGS=
|
|
|
|
|
|
|
|
# prepare
|
2024-06-26 09:31:39 +00:00
|
|
|
rm -rf "$VIRTUAL_ENV/packages"
|
|
|
|
mkdir -p "$VIRTUAL_ENV/packages" && cd "$VIRTUAL_ENV/packages" || exit 1
|
2024-06-22 19:15:37 +00:00
|
|
|
|
|
|
|
CORE=xapian-core-$VERSION
|
|
|
|
BINDINGS=xapian-bindings-$VERSION
|
|
|
|
|
|
|
|
# download
|
|
|
|
echo "Downloading source..."
|
2024-06-26 09:31:39 +00:00
|
|
|
curl -O "https://oligarchy.co.uk/xapian/$VERSION/${CORE}.tar.xz"
|
|
|
|
curl -O "https://oligarchy.co.uk/xapian/$VERSION/${BINDINGS}.tar.xz"
|
2024-06-22 19:15:37 +00:00
|
|
|
|
|
|
|
# extract
|
|
|
|
echo "Extracting source..."
|
2024-06-26 09:31:39 +00:00
|
|
|
tar xf "${CORE}.tar.xz"
|
|
|
|
tar xf "${BINDINGS}.tar.xz"
|
2024-06-22 19:15:37 +00:00
|
|
|
|
|
|
|
# install
|
|
|
|
echo "Installing Xapian-core..."
|
2024-06-26 09:31:39 +00:00
|
|
|
cd "$VIRTUAL_ENV/packages/${CORE}" || exit 1
|
2024-07-18 17:26:47 +00:00
|
|
|
./configure --prefix="$VIRTUAL_ENV" && make -j"$(nproc)" && make install
|
2024-06-22 19:15:37 +00:00
|
|
|
|
|
|
|
PYTHON_FLAG=--with-python3
|
|
|
|
|
|
|
|
echo "Installing Xapian-bindings..."
|
2024-06-26 09:31:39 +00:00
|
|
|
cd "$VIRTUAL_ENV/packages/${BINDINGS}" || exit 1
|
2024-07-18 17:26:47 +00:00
|
|
|
./configure --prefix="$VIRTUAL_ENV" $PYTHON_FLAG XAPIAN_CONFIG="$VIRTUAL_ENV/bin/xapian-config" && make -j"$(nproc)" && make install
|
2024-06-22 19:15:37 +00:00
|
|
|
|
|
|
|
# clean
|
2024-06-26 09:31:39 +00:00
|
|
|
rm -rf "$VIRTUAL_ENV/packages"
|
2024-06-22 19:15:37 +00:00
|
|
|
|
|
|
|
# test
|
|
|
|
python -c "import xapian"
|