Skip to content

Commit

Permalink
enhance(recoll): configure without --disable-python-module
Browse files Browse the repository at this point in the history
Added Python support to recoll package
  • Loading branch information
JCGoran committed Oct 23, 2022
1 parent 0281a1c commit 143dc47
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/recoll/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ 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_SHA256=025dec0b9745e1ddacd86ee5478f9c52b2da2e5c307f831aaa5b2c7f9d7e8db9
TERMUX_PKG_DEPENDS="aspell, libxapian, libxslt, zlib"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-userdoc --disable-python-module --disable-python-chm --disable-x11mon --disable-qtgui"
TERMUX_PKG_DEPENDS="aspell, libxapian, libxslt, zlib, python"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-userdoc --disable-python-chm --disable-x11mon --disable-qtgui"


termux_step_pre_configure() {
LDFLAGS+=" $($CC -print-libgcc-file-name)"
CXXFLAGS+=" -fPIC"
}
77 changes: 77 additions & 0 deletions packages/recoll/fix-python-prefix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
diff --git src/python/recoll/pyrclextract.cpp src/python/recoll/pyrclextract.cpp
index 96325856..f6040848 100644
--- src/python/recoll/pyrclextract.cpp
+++ src/python/recoll/pyrclextract.cpp
@@ -16,9 +16,9 @@
*/


-#include <Python.h>
-#include <structmember.h>
-#include <bytearrayobject.h>
+#include <@TERMUX_PREFIX@/include/python3.10/Python.h>
+#include <@TERMUX_PREFIX@/include/python3.10/structmember.h>
+#include <@TERMUX_PREFIX@/include/python3.10/bytearrayobject.h>

#include <string>
#include <memory>
diff --git src/python/recoll/pyrecoll.cpp src/python/recoll/pyrecoll.cpp
index 18df550b..0cb42b91 100644
--- src/python/recoll/pyrecoll.cpp
+++ src/python/recoll/pyrecoll.cpp
@@ -15,9 +15,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

-#include <Python.h>
-#include <structmember.h>
-#include <bytesobject.h>
+#include <@TERMUX_PREFIX@/include/python3.10/Python.h>
+#include <@TERMUX_PREFIX@/include/python3.10/structmember.h>
+#include <@TERMUX_PREFIX@/include/python3.10/bytesobject.h>

#include <string>
#include <iostream>
diff --git src/python/recoll/pyrecoll.h src/python/recoll/pyrecoll.h
index 8d6403f8..8b3cd7a3 100644
--- src/python/recoll/pyrecoll.h
+++ src/python/recoll/pyrecoll.h
@@ -19,7 +19,7 @@

/* Shared definitions for pyrecoll.cpp and pyrclextract.cpp */

-#include <Python.h>
+#include <@TERMUX_PREFIX@/include/python3.10/Python.h>

#include <memory>
#include <string>
diff --git src/python/recoll/pyresultstore.cpp src/python/recoll/pyresultstore.cpp
index 45ee01a3..b4a77deb 100644
--- src/python/recoll/pyresultstore.cpp
+++ src/python/recoll/pyresultstore.cpp
@@ -15,9 +15,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

-#include <Python.h>
-#include <structmember.h>
-#include <bytesobject.h>
+#include <@TERMUX_PREFIX@/include/python3.10/Python.h>
+#include <@TERMUX_PREFIX@/include/python3.10/structmember.h>
+#include <@TERMUX_PREFIX@/include/python3.10/bytesobject.h>

#include <string>
#include <iostream>
diff --git src/python/recoll/setup.py.in src/python/recoll/setup.py.in
index 0409cb9d..7812ebce 100644
--- src/python/recoll/setup.py.in
+++ src/python/recoll/setup.py.in
@@ -18,7 +18,7 @@ if "CYGWIN" in os.environ:
else:
libraries = ['recoll']

-extra_compile_args = ['-std=c++11']
+extra_compile_args = ['-std=c++11', '-fPIC']

VERSION = open(os.path.join(top, "RECOLL-VERSION.txt")).read().strip()

0 comments on commit 143dc47

Please sign in to comment.