work on xapian-delve issues

1) `xapian_wheel_builder.sh` adds `xapian-delve` to the wheel
2) `tests/xapian_tests/tests/test_backend.py` learns to check the new `xapian-delve` location
3) drop support for delve from xapian<1.3 (support dropped along Python 2)
This commit is contained in:
Alejandro R. Sedeño 2021-09-23 12:15:22 -04:00 committed by Claude Paroz
parent 194aa2ca86
commit 37e8b5af8f
2 changed files with 19 additions and 8 deletions

View File

@ -1,5 +1,6 @@
from decimal import Decimal
import datetime
import inspect
import sys
import xapian
import subprocess
@ -30,17 +31,17 @@ class XapianSearchResult(SearchResult):
def get_terms(backend, *args):
if XAPIAN_VERSION[1] <= 2:
# old versions use "delve".
executable = 'delve'
else:
# new versions use 'xapian-delve'
executable = 'xapian-delve'
executable = 'xapian-delve'
# dev versions (odd minor) use a suffix
if XAPIAN_VERSION[1] % 2 != 0:
executable = executable+'-%d.%d' % tuple(XAPIAN_VERSION[0:2])
# look for a xapian-delve built by `xapian_wheel_builder`
wheel_delve = os.path.join(os.path.dirname(inspect.getfile(xapian)), executable)
if os.path.exists(wheel_delve):
executable = wheel_delve
result = subprocess.check_output([executable] + list(args) + [backend.path],
env=os.environ.copy()).decode('utf-8')
result = result.split(": ")

View File

@ -135,8 +135,8 @@ echo "Building xapian python3 bindings..."
make install
)
echo "preparing xapian wheel..."
for file in "${prefix}"/xapian/*.so; do
binary_patch_rpath() {
file="${1}"
case "${uname_sysname}" in
Linux|FreeBSD)
# Binary patch rpath to be '$ORIGIN' as needed.
@ -151,6 +151,11 @@ for file in "${prefix}"/xapian/*.so; do
install_name_tool -change "${prefix}/lib/${libxapian_name}" "@loader_path/${libxapian_name}" "${file}"
;;
esac
}
echo "preparing xapian wheel..."
for file in "${prefix}"/xapian/*.so; do
binary_patch_rpath "${file}"
done
# Copy libxapian into place alongside the python bindings.
@ -161,6 +166,11 @@ case "${uname_sysname}" in
;;
esac
for file in "${prefix}"/bin/xapian-delve*; do
binary_patch_rpath "${file}"
cp "${file}" "${prefix}/xapian"
done
# Prepare the scaffolding for the wheel
cat > "$prefix/setup.py" <<EOF
from setuptools import setup