Skip to contentSkip to conversation

python3: Fix python-distutils variables

PATCH New Ricardo Ribalda Delgado 1 participant 2 messages Sep 1, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 python3: Fix python-distutils variables

python-distutils uses the information from this file for setting the system variables.

Whithout this patch:

root@qt5022:~# pip install pyzmq

...

x86_64-poky-linux-gcc -m64 -march=btver1 -mtune=btver1 --sysroot=/var/lib/jenkins/jobs/qt5022-cesium/workspace/build/tmp/sysroots/qt5022 -fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DNATIVE_LITTLE_ENDIAN=1 -Ibundled/libsodium/src/libsodium/include -Ibundled/libsodium/src/libsodium/include/sodium -I/usr/include/python2.7 -c buildutils/initlibsodium.c -o build/temp.linux-x86_64-2.7/buildutils/initlibsodium.o
In file included from /usr/include/python2.7/Python.h:8:0,
from buildutils/initlibsodium.c:10:
/usr/include/python2.7/pyconfig.h:24:27: fatal error: bits/wordsize.h: No such
file or directory

    #include <bits/wordsize.h>
root@qt5022:~# ls /usr/include/bits/wordsize.h
/usr/include/bits/wordsize.h
---
 meta/recipes-devtools/python/python3_3.4.3.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-devtools/python/python3_3.4.3.bb +4 -2
index 6c2e21d6a9c2..f61d278d79d4 100644
@@ -184,8 +184,10 @@ PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
 py_package_preprocess () {
 	# copy back the old Makefile to fix target package
 	install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
-	# Remove references to buildmachine paths in target Makefile
-	sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+	# Remove references to buildmachine paths in target Makefile and _sysconfigdata
+	sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
+		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
 }
 
 require python-${PYTHON_MAJMIN}-manifest.inc
Signature · 1 line
2.5.0
#1 lore raw

PATCH 2/2 python: Fix python-distutils variables

python-distutils uses the information from this file for setting the system variables.

Whithout this patch:

root@qt5022:~# pip install pyzmq

...

x86_64-poky-linux-gcc -m64 -march=btver1 -mtune=btver1 --sysroot=/var/lib/jenkins/jobs/qt5022-cesium/workspace/build/tmp/sysroots/qt5022 -fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DNATIVE_LITTLE_ENDIAN=1 -Ibundled/libsodium/src/libsodium/include -Ibundled/libsodium/src/libsodium/include/sodium -I/usr/include/python2.7 -c buildutils/initlibsodium.c -o build/temp.linux-x86_64-2.7/buildutils/initlibsodium.o
In file included from /usr/include/python2.7/Python.h:8:0,
from buildutils/initlibsodium.c:10:
/usr/include/python2.7/pyconfig.h:24:27: fatal error: bits/wordsize.h: No such
file or directory

    #include <bits/wordsize.h>
root@qt5022:~# ls /usr/include/bits/wordsize.h
/usr/include/bits/wordsize.h
---
 meta/recipes-devtools/python/python_2.7.9.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-devtools/python/python_2.7.9.bb +4 -2
index 803a1fc7497b..ae455771653e 100644
@@ -137,8 +137,10 @@ py_package_preprocess () {
 	# copy back the old Makefile to fix target package
 	install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
 
-	# Remove references to buildmachine paths in target Makefile
-	sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+	# Remove references to buildmachine paths in target Makefile and _sysconfigdata
+	sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
+		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
 }
 
 require python-${PYTHON_MAJMIN}-manifest.inc
Signature · 1 line
2.5.0