pygobject: add patch to setup proper python includes

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2016-03-10 12:33:46 +01:00
parent dbc2e92769
commit 1106d29c5e
2 changed files with 37 additions and 1 deletions

View File

@ -34,6 +34,10 @@ PKG_AUTORECONF="yes"
PKG_CONFIGURE_OPTS_TARGET="--enable-thread --disable-introspection"
pre_configure_target() {
export PYTHON_INCLUDES="$($SYSROOT_PREFIX/usr/bin/python2-config --includes)"
}
post_makeinstall_target() {
find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
find $INSTALL/usr/lib -name "*.pyc" -exec rm -rf "{}" ";"

View File

@ -0,0 +1,32 @@
[PATCH] m4/python.m4: add PYTHON_INCLUDES override for cross compilation
As the configure script mixes up host/target python. Equivalent to the
similar code in dbus-python.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
m4/python.m4 | 4 ++++
1 file changed, 4 insertions(+)
Index: python-gobject-2.28.6/m4/python.m4
===================================================================
--- python-gobject-2.28.6.orig/m4/python.m4
+++ python-gobject-2.28.6/m4/python.m4
@@ -43,6 +43,9 @@
[AC_REQUIRE([AM_PATH_PYTHON])
AC_MSG_CHECKING(for headers required to compile python extensions)
dnl deduce PYTHON_INCLUDES
+if test "${PYTHON_INCLUDES+set}" = set; then
+ AC_MSG_NOTICE([PYTHON_INCLUDES overridden to: $PYTHON_INCLUDES])
+else
py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`
py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`
PYTHON_CONFIG=`which $PYTHON`-config
@@ -54,6 +57,7 @@
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
fi
fi
+fi
AC_SUBST(PYTHON_INCLUDES)
dnl check if the headers exist:
save_CPPFLAGS="$CPPFLAGS"