Skip to contentSkip to conversation

python-pyqt: fix compile on x86

PATCH New Gwenhael Goavec-Merou 3 participants 7 messages Apr 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 python-pyqt: fix compile on x86

From: Gwenhael Goavec-Merou <[email protected]>

fix :
http://autobuild.buildroot.net/results/e2a/e2ab7e2e61aaa5758a3a572ae25a047e802fdcc0/

According to configure-ng.py, PyQt_qreal_double must be disabled only for ARM target.

---
 package/python-pyqt/python-pyqt.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
package/python-pyqt/python-pyqt.mk +5 -1
index 2363f7d..808837e 100644
@@ -33,13 +33,17 @@ endif
 # Turn off features that aren't available in QWS and current qt
 # configuration.
 PYTHON_PYQT_QTDETAIL_DISABLE_FEATURES = \
-	PyQt_Accessibility PyQt_SessionManager PyQt_qreal_double \
+	PyQt_Accessibility PyQt_SessionManager \
 	PyQt_Shortcut PyQt_RawFont
 
 ifeq ($(BR2_PACKAGE_QT_OPENSSL),)
 PYTHON_PYQT_QTDETAIL_DISABLE_FEATURES += PyQt_OpenSSL
 endif
 
+ifeq ($(BR2_arm)$(BR2_armeb),y)
+PYTHON_PYQT_QTDETAIL_DISABLE_FEATURES += PyQt_qreal_double
+endif
+
 define PYTHON_PYQT_QTDETAIL
 	echo $(1) >> $(2)/qtdetail.out
 endef
Signature · 1 line
2.0.5
#1 lore raw

PATCH 2/3 python-pyqt: fix install

From: Gwenhael Goavec-Merou <[email protected]>

PyQt4 provides two version for some py files: one for python2.x and one for python3.x. This two versions are installed in TARGET_DIR.
After installing files, python is used to generate all .pyc files, but fails like :
class ProxyBase(metaclass=ProxyMetaclass):
^
SyntaxError: invalid syntax

This patch supdress directory for not targeted python version.

---
 package/python-pyqt/python-pyqt.mk | 3 +++
 1 file changed, 3 insertions(+)
package/python-pyqt/python-pyqt.mk +3 -0
index 808837e..e7ab3a6 100644
@@ -14,8 +14,10 @@ PYTHON_PYQT_DEPENDENCIES = python-sip host-python-sip qt
 
 ifeq ($(BR2_PACKAGE_PYTHON),y)
 PYTHON_PYQT_PYTHON_DIR = python$(PYTHON_VERSION_MAJOR)
+PYTHON_PYQT_RM_PORT_BASE = port_v3
 else ifeq ($(BR2_PACKAGE_PYTHON3),y)
 PYTHON_PYQT_PYTHON_DIR = python$(PYTHON3_VERSION_MAJOR)
+PYTHON_PYQT_RM_PORT_BASE = port_v2
 endif
 
 ifeq ($(BR2_PACKAGE_QT_EMBEDDED),y)
@@ -97,6 +99,7 @@ endef
 define PYTHON_PYQT_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) install
 	touch $(TARGET_DIR)/usr/lib/$(PYTHON_PYQT_PYTHON_DIR)/site-packages/PyQt4/__init__.py
+	$(RM) -rf $(TARGET_DIR)/usr/lib/$(PYTHON_PYQT_PYTHON_DIR)/site-packages/PyQt4/uic/$(PYTHON_PYQT_RM_PORT_BASE)
 	PYTHONPATH="$(PYTHON_PATH)" \
 		$(HOST_DIR)/usr/bin/python -c "import compileall; \
 		compileall.compile_dir('$(TARGET_DIR)/usr/lib/$(PYTHON_PYQT_PYTHON_DIR)/site-packages/PyQt4')"
Signature · 1 line
2.0.5
#2 lore raw

PATCH 2/3 python-pyqt: fix install

Dear Gwenhael Goavec-Merou,

Quoted 9 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

PyQt4 provides two version for some py files: one for python2.x and one for python3.x. This two versions are installed in TARGET_DIR.
After installing files, python is used to generate all .pyc files, but fails like :
class ProxyBase(metaclass=ProxyMetaclass):
^
SyntaxError: invalid syntax

I did not encounter this issue when testing. With which configuration do you get this problem?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 2/3 python-pyqt: fix install

Dear Thomas Petazzoni,

Quoted 13 lines · On Mon, 20 Apr 2015 17:37:52 +0200 Thomas Petazzoni…

Dear Gwenhael Goavec-Merou,

Quoted 9 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

PyQt4 provides two version for some py files: one for python2.x and one for python3.x. This two versions are installed in TARGET_DIR.
After installing files, python is used to generate all .pyc files, but fails like :
class ProxyBase(metaclass=ProxyMetaclass):
^
SyntaxError: invalid syntax

Quoted 3 lines

I did not encounter this issue when testing. With which configuration do you get this problem?

I have used the defconfig provided by :
http://autobuild.buildroot.net/results/e2a/e2ab7e2e61aaa5758a3a572ae25a047e802fdcc0/

Quoted 3 lines

Thanks,

Thomas

Regards,
Gwen

#4 lore raw

PATCH 2/3 python-pyqt: fix install

Quoted 18 lines · gwenhael.goavec

Dear Thomas Petazzoni,

Quoted 13 lines · On Mon, 20 Apr 2015 17:37:52 +0200 Thomas Petazzoni…

Dear Gwenhael Goavec-Merou,

Quoted 9 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

PyQt4 provides two version for some py files: one for python2.x and one for python3.x. This two versions are installed in TARGET_DIR.
After installing files, python is used to generate all .pyc files, but fails like :
class ProxyBase(metaclass=ProxyMetaclass):
^
SyntaxError: invalid syntax

Quoted 5 lines
Quoted 3 lines

I did not encounter this issue when testing. With which configuration do you get this problem?

I have used the defconfig provided by :
http://autobuild.buildroot.net/results/e2a/e2ab7e2e61aaa5758a3a572ae25a047e802fdcc0/

When you submit a patch that fixes an autobuild failure, you should mention
that in the commit log, like:

Fixes:
http://autobuild.buildroot.net/results/e2a/e2ab7e2e61aaa5758a3a572ae25a047e802fdcc0/

Regards,
Arnout

Quoted 13 lines
Quoted 4 lines

Thanks,

Thomas

Regards,
Gwen
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#5 lore raw

PATCH 3/3 qt: fix webkit dependencies

In reply to Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

qtwebkit includes qscript headers.
For packages like python-pyqt if webkit is available but not qscript, the compilation fails with :
buildroot/output/build/python-pyqt-4.11.3/sip/QtWebKit/qwebframe.sip:79:0:
../../../host/usr/i686-buildroot-linux-gnu/sysroot/usr/include/QtWebKit/qwebframe.h:28:36:
fatal error: QtScript/qscriptengine.h: No such file or directory

This problem is not seen with Qt compilation because some relative include directly from sources are added.

---
 package/qt/Config.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/qt/Config.in +3 -1
index 43f5a0f..f6ca054 100644
@@ -417,6 +417,7 @@ config BR2_PACKAGE_QT_ARCH_SUPPORTS_WEBKIT
 
 config BR2_PACKAGE_QT_WEBKIT
 	bool "WebKit Module"
+	depends on BR2_PACKAGE_QT_SCRIPT
 	depends on BR2_PACKAGE_QT_SHARED
 	depends on BR2_PACKAGE_QT_GUI_MODULE
 	depends on BR2_PACKAGE_QT_NETWORK
@@ -427,7 +428,8 @@ config BR2_PACKAGE_QT_WEBKIT
 	  If unsure, say n.
 
 comment "WebKit needs shared library/NPTL toolchain/gui/network support"
-	depends on !(BR2_PACKAGE_QT_SHARED && BR2_PACKAGE_QT_GUI_MODULE && BR2_PACKAGE_QT_NETWORK)
+	depends on !(BR2_PACKAGE_QT_SCRIPT && BR2_PACKAGE_QT_SHARED && \
+		BR2_PACKAGE_QT_GUI_MODULE && BR2_PACKAGE_QT_NETWORK)
 	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL
 	depends on BR2_PACKAGE_QT_ARCH_SUPPORTS_WEBKIT
 
Signature · 1 line
2.0.5
#6 lore raw

PATCH 1/3 python-pyqt: fix compile on x86

In reply to Gwenhael Goavec-Merou

Dear Gwenhael Goavec-Merou,

Quoted 7 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

fix :
http://autobuild.buildroot.net/results/e2a/e2ab7e2e61aaa5758a3a572ae25a047e802fdcc0/

According to configure-ng.py, PyQt_qreal_double must be disabled only for ARM target.

The situation seems unfortunately to be a bit more complicated. From the configure-ng.py code:

#if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN) || defined(QT_ARCH_VXWORKS)
    out << "PyQt_qreal_double\\n";

#endif

We indeed don't care about Windows CE, Symbian or VxWorks. QT_ARCH_ARM is handled by your patch. But not QT_NO_FPU. QT_NO_FPU is defined by Qt in the following situation:

#if defined(QT_ARCH_ARM) || defined(QT_ARCH_ARMV6) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_MIPS) && (defined(Q_WS_QWS) || defined(Q_WS_QPA) || defined(Q_OS_WINCE))) || defined(QT_ARCH_SH) || defined(QT_ARCH_SH4A) #define QT_NO_FPU
#endif

So it's not only ARM, but also SH, SH4A and MIPS in QWS apparently.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com