Skip to content

Commit

Permalink
recoll: Separate recoll-python as a subpackage
Browse files Browse the repository at this point in the history
  • Loading branch information
xtkoba committed Oct 27, 2022
1 parent d288213 commit 2c40a8f
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 3 deletions.
27 changes: 27 additions & 0 deletions packages/recoll/Makefile.in.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- a/Makefile.in
+++ b/Makefile.in
@@ -1145,7 +1145,7 @@
# someone fixes it:
# php/00README.txt php/recoll/config.m4 php/recoll/make.sh
# php/recoll/php_recoll.h php/recoll/recoll.cpp php/sample/shell.php
-OPTSFORPYTHON = $(shell test -f /etc/debian_version && echo --install-layout=deb)
+OPTSFORPYTHON =
defconfdir = $(pkgdatadir)/examples
defconf_DATA = \
desktop/recollindex.desktop \
@@ -2802,13 +2802,13 @@
@MAKEPYTHON_TRUE@clean-local:: recollpython-clean
@MAKEPYTHON_TRUE@recollpython: librecoll.la
@MAKEPYTHON_TRUE@ (cd python/recoll; set -x; \
-@MAKEPYTHON_TRUE@ for v in 2 3;do test -n "`which python$${v}`" && \
+@MAKEPYTHON_TRUE@ for v in 3;do test -n "`command -v python$${v}`" && \
@MAKEPYTHON_TRUE@ libdir=$(libdir) python$${v} setup.py build; \
@MAKEPYTHON_TRUE@ done \
@MAKEPYTHON_TRUE@ )
@MAKEPYTHON_TRUE@recollpython-install:
@MAKEPYTHON_TRUE@ (cd python/recoll; set -x; \
-@MAKEPYTHON_TRUE@ for v in 2 3;do test -n "`which python$${v}`" && \
+@MAKEPYTHON_TRUE@ for v in 3;do test -n "`command -v python$${v}`" && \
@MAKEPYTHON_TRUE@ python$${v} setup.py install \
@MAKEPYTHON_TRUE@ --prefix=${prefix} --root=$${DESTDIR:-/} $(OPTSFORPYTHON); \
@MAKEPYTHON_TRUE@ done; \
20 changes: 17 additions & 3 deletions packages/recoll/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,29 @@ TERMUX_PKG_DESCRIPTION="Full-text search for your desktop"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.33.1
TERMUX_PKG_SRCURL=http://www.lesbonscomptes.com/recoll/recoll-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://www.lesbonscomptes.com/recoll/recoll-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=025dec0b9745e1ddacd86ee5478f9c52b2da2e5c307f831aaa5b2c7f9d7e8db9
TERMUX_PKG_DEPENDS="aspell, libxapian, libxslt, zlib, python"
TERMUX_PKG_DEPENDS="aspell, libiconv, libxapian, libxml2, libxslt, zlib"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-userdoc --disable-python-chm --disable-x11mon --disable-qtgui"
TERMUX_PKG_REVISION=1

termux_step_pre_configure() {
LDFLAGS+=" $($CC -print-libgcc-file-name)"
CXXFLAGS+=" -fPIC"
_PYTHON_VERSION=$(source $TERMUX_SCRIPTDIR/packages/python/build.sh; echo $_MAJOR_VERSION)
CPPFLAGS+=" -I${TERMUX_PREFIX}/include/python${_PYTHON_VERSION}/"

termux_setup_python_crossenv
pushd $TERMUX_PYTHON_CROSSENV_SRCDIR
_CROSSENV_PREFIX=$TERMUX_PKG_BUILDDIR/python-crossenv-prefix
python${_PYTHON_VERSION} -m crossenv \
$TERMUX_PREFIX/bin/python${_PYTHON_VERSION} \
${_CROSSENV_PREFIX}
popd
. ${_CROSSENV_PREFIX}/bin/activate

echo "Applying python-recoll-setup.py.in.diff"
sed "s|@PYTHON_VERSION@|${_PYTHON_VERSION}|g" \
$TERMUX_PKG_BUILDER_DIR/python-recoll-setup.py.in.diff \
| patch --silent -p1
}
22 changes: 22 additions & 0 deletions packages/recoll/python-recoll-setup.py.in.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- a/python/recoll/setup.py.in
+++ b/python/recoll/setup.py.in
@@ -13,8 +13,8 @@
localtop = os.path.join(os.path.dirname(__file__), '..', '..')

library_dirs = [os.path.join(localtop, '.libs')]
-if "CYGWIN" in os.environ:
- libraries = ['recoll', 'xapian', 'iconv', 'z']
+if True:
+ libraries = ['recoll', 'python@PYTHON_VERSION@', 'xslt', 'xml2', 'xapian', 'iconv', 'z']
else:
libraries = ['recoll']

@@ -31,7 +31,7 @@
define_macros = [
('RECOLL_DATADIR', '"@RECOLL_DATADIR@"')
],
- include_dirs = ['/usr/local/include',
+ include_dirs = [
os.path.join(top, 'utils'),
os.path.join(top, 'common'),
os.path.join(localtop, 'common'),
3 changes: 3 additions & 0 deletions packages/recoll/recoll-python.subpackage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TERMUX_SUBPKG_INCLUDE="lib/python*"
TERMUX_SUBPKG_DESCRIPTION="Python interface for Recoll"
TERMUX_SUBPKG_DEPENDS="python"

0 comments on commit 2c40a8f

Please sign in to comment.