Skip to contentSkip to conversation

python-sip: new package

PATCH New Gwenhael Goavec-Merou 2 participants 5 messages Apr 19, 2015 – Apr 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 python-sip: new package

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

Based on http://lists.busybox.net/pipermail/buildroot/2013-October/080830.html

---
Changes v2 -> v3:
* bump version.
* suppress patch, --sysroot is enough.
* use qmake for configuration instead of sed.
* corrects LICENSE variable
* add depends on Qt
Changes v1 -> v2:
* renames patch.
* add depends on BR2_INSTALL_LIBSTDCPP.
* add hash file.
* add license informations.

---
 package/Config.in                  |  1 +
 package/python-sip/Config.in       | 12 ++++++++++
 package/python-sip/python-sip.hash |  4 ++++
 package/python-sip/python-sip.mk   | 45 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 62 insertions(+)
 create mode 100644 package/python-sip/Config.in
 create mode 100644 package/python-sip/python-sip.hash
 create mode 100644 package/python-sip/python-sip.mk
package/Config.in +1 -0
index 248e18b..546a9e5 100644
@@ -605,6 +605,7 @@ menu "external python modules"
 	source "package/python-serial/Config.in"
 	source "package/python-setuptools/Config.in"
 	source "package/python-simplejson/Config.in"
+	source "package/python-sip/Config.in"
 	source "package/python-six/Config.in"
 	source "package/python-spidev/Config.in"
 	source "package/python-thrift/Config.in"
package/python-sip/Config.in new file +12 -0
new file mode 100644
index 0000000..3ee6c2a
@@ -0,0 +1,12 @@
+comment "python-sip needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
+
+config BR2_PACKAGE_PYTHON_SIP
+	bool "python-sip"
+	depends on BR2_INSTALL_LIBSTDCPP
+	select BR2_PACKAGE_QT
+	help
+	  SIP is a tool for C/C++ libraries binding. It was developed
+	  to create PyQt
+
+	  http://www.riverbankcomputing.com/software/sip/intro
package/python-sip/python-sip.hash new file +4 -0
new file mode 100644
index 0000000..aba5470
@@ -0,0 +1,4 @@
+# From http://sourceforge.net/projects/pyqt/files/sip/sip-4.16.7/
+md5 32abc003980599d33ffd789734de4c36	sip-4.16.7.tar.gz
+# Locally calculated:
+sha256 4caa8d52e4403bae5c4c64f44de03a2cfd0bb10b6d96c5fb771133516df9abbd	sip-4.16.7.tar.gz
package/python-sip/python-sip.mk new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
2.0.5
#1 lore raw

PATCH v3 2/2 python-pyqt: new package

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

---
Changes v2 -> v3:
* bump version.
* corrects LICENSE variable
* review patches (suppress, renames, add SoB and comments)
* add a way to select Qt mode
* use foreach instead for to generate qtdetail.out
* add qt mode configuration
* add sysroot option
* use long options
* add __init__.pyc generation
Changes v1 -> v2:
* renames patch.
* add missing dependencies
* add hash file.
* add license informations.

---
 package/Config.in                                  |  1 +
 .../python-pyqt/0001-configure-skip-qtdetail.patch | 25 +++++++
 package/python-pyqt/0002-configure-set-qws.patch   | 40 +++++++++++
 package/python-pyqt/0003-sip-add_qws.patch         | 44 ++++++++++++
 ...004-sip-QtGuit-hide-qfont-cachestatistics.patch | 16 +++++
 package/python-pyqt/0005-sip-fix_qws_handle.patch  | 23 ++++++
 package/python-pyqt/Config.in                      | 17 +++++
 package/python-pyqt/python-pyqt.hash               |  5 ++
 package/python-pyqt/python-pyqt.mk                 | 84 ++++++++++++++++++++++
 9 files changed, 255 insertions(+)
 create mode 100644 package/python-pyqt/0001-configure-skip-qtdetail.patch
 create mode 100644 package/python-pyqt/0002-configure-set-qws.patch
 create mode 100644 package/python-pyqt/0003-sip-add_qws.patch
 create mode 100644 package/python-pyqt/0004-sip-QtGuit-hide-qfont-cachestatistics.patch
 create mode 100644 package/python-pyqt/0005-sip-fix_qws_handle.patch
 create mode 100644 package/python-pyqt/Config.in
 create mode 100644 package/python-pyqt/python-pyqt.hash
 create mode 100644 package/python-pyqt/python-pyqt.mk
package/Config.in +1 -0
index 546a9e5..a7f05de 100644
@@ -592,6 +592,7 @@ menu "external python modules"
 	source "package/python-pyinotify/Config.in"
 	source "package/python-pyparsing/Config.in"
 	source "package/python-pypcap/Config.in"
+	source "package/python-pyqt/Config.in"
 	source "package/python-pyro/Config.in"
 	source "package/python-pysendfile/Config.in"
 	source "package/python-pysnmp/Config.in"
package/python-pyqt/0001-configure-skip-qtdetail.patch new file +25 -0
new file mode 100644
index 0000000..85fee40
@@ -0,0 +1,25 @@
+qtdetail generates qtdetail.out. Since this app is cross-compiled, it's not
+possible to run it on a host.
+Consequently, python-pyqt.mk generates qtdetail.out before calling
+configure-ng.py.
+In this situation removing this file is not a good idea and running qtdetail
+will fail.
+
+Signed-off-by: Gwenhael Goavec-Merou <[email protected]>
+Signed-off-by: Sergey Kostanbaev <[email protected]>
+---
+Index: PyQt-x11-gpl-4.11.3/configure-ng.py
+===================================================================
+--- PyQt-x11-gpl-4.11.3.orig/configure-ng.py
++++ PyQt-x11-gpl-4.11.3/configure-ng.py
+@@ -672,10 +672,6 @@ int main(int argc, char **argv)
+         if cmd is None:
+             error("Failed to determine the detail of your Qt installation. Try again using the --verbose flag to see more detail about the problem.")
+ 
+-        # Create the output file, first making sure it doesn't exist.
+-        remove_file(out_file)
+-        run_command(cmd, verbose)
+-
+         if not os.access(out_file, os.F_OK):
+             error("%s failed to create %s. Make sure your Qt installation is correct." % (cmd, out_file))
+ 
package/python-pyqt/0002-configure-set-qws.patch new file +40 -0
new file mode 100644
index 0000000..45719f0
@@ -0,0 +1,40 @@
+Qt has two flavors: X11 and embedded (QWS). QWS has some limitations compared to
+X11. This patch adds an option to select which version to use.
+
+Signed-off-by: Gwenhael Goavec-Merou <[email protected]>
+---
+Index: PyQt-x11-gpl-4.11.3/configure-ng.py
+===================================================================
+--- PyQt-x11-gpl-4.11.3.orig/configure-ng.py
++++ PyQt-x11-gpl-4.11.3/configure-ng.py
+@@ -960,6 +960,9 @@ int main(int argc, char **argv)
+         if opts.vendlibdir is not None:
+             self.vend_lib_dir = opts.vendlibdir
+ 
++        if opts.qtflavor is not None:
++            self.qt_flavor = opts.qtflavor
++
+         # Handle any conflicts.
+         if self.qt_shared:
+             if len(self.static_plugins) != 0:
+@@ -1177,6 +1180,11 @@ def create_optparser(target_config):
+             dest="notools",
+             help="disable the building of pyuic5, pyrcc5 and pylupdate5 "
+                     "[default: enabled]")
++    g.add_option("--qt-flavor", dest='qtflavor', type='string',
++            default="WS_X11", metavar='QTFLAVOR', action='store',
++            help="select Qt flavor beetween WS_X11 and WS_QWS "
++                    "only available on Linux)"
++                    "[default: WS_X11]")
+     p.add_option_group(g)
+ 
+     # Vendor ID.
+@@ -2088,7 +2096,7 @@ def get_sip_flags(target_config):
+     elif target_config.py_platform == 'darwin':
+         plattag = 'WS_MACX'
+     else:
+-        plattag = 'WS_X11'
++        plattag = target_config.qt_flavor
+ 
+     sip_flags.append('-t')
+     sip_flags.append(plattag)
package/python-pyqt/0003-sip-add_qws.patch new file +44 -0

44 lines not on this page · raw message

package/python-pyqt/0004-sip-QtGuit-hide-qfont-cachestatistics.patch new file +16 -0
new file mode 100644
index 0000000..677f56d
@@ -0,0 +1,16 @@
+Hide QFont::cacheStatistics which itn't available in QWS
+
+Signed-off-by: Sergey Kostanbaev <[email protected]>
+diff -ur PyQt-x11-gpl-4.9.6/sip/QtGui/qfont.sip pyqt-4.9.6/sip/QtGui/qfont.sip
+--- PyQt-x11-gpl-4.9.6/sip/QtGui/qfont.sip	2012-12-08 13:51:38.000000000 +0400
++++ pyqt-4.9.6/sip/QtGui/qfont.sip	2013-05-22 14:06:38.335000022 +0400
+@@ -185,7 +185,9 @@
+ %End
+     static void initialize();
+     static void cleanup();
++%If (!WS_QWS)
+     static void cacheStatistics();
++%End
+     QString defaultFamily() const;
+     QString lastResortFamily() const;
+     QString lastResortFont() const;
package/python-pyqt/0005-sip-fix_qws_handle.patch new file +23 -0
new file mode 100644
index 0000000..bdd5ea2
@@ -0,0 +1,23 @@
+Change HANDLE to void* to get rid of :
+buildroot/output/build/python-pyqt-4.11.3/QtCore/sipQtCoreQThread.cpp:318:50:
+error: invalid conversion from 'Qt::HANDLE {aka void*}' to 'long unsigned int'
+[-fpermissive]
+error during compilation.
+
+Signed-off-by: Gwenhael Goavec-Merou <[email protected]>
+Signed-off-by: Sergey Kostanbaev <[email protected]>
+---
+Index: PyQt-x11-gpl-4.11.3/sip/QtCore/qnamespace.sip
+===================================================================
+--- PyQt-x11-gpl-4.11.3.orig/sip/QtCore/qnamespace.sip
++++ PyQt-x11-gpl-4.11.3/sip/QtCore/qnamespace.sip
+@@ -1673,6 +1673,9 @@ namespace Qt
+ %If (WS_X11)
+     typedef unsigned long HANDLE;
+ %End
++%If (WS_QWS)
++    typedef void* HANDLE;
++%End
+ %End
+ %If (PyQt_Deprecated_5_0)
+     typedef Qt::WindowFlags WFlags;
package/python-pyqt/Config.in new file +17 -0
new file mode 100644
index 0000000..9250c8e
@@ -0,0 +1,17 @@
+comment "python-pyqt needs a toolchain w/ C++, threads"
+	depends on BR2_USE_MMU
+	depends on !BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_HAS_THREADS
+
+
+config BR2_PACKAGE_PYTHON_PYQT
+	bool "python-pyqt"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS # qt
+	depends on BR2_USE_MMU # qt
+	select BR2_PACKAGE_QT
+	select BR2_PACKAGE_PYTHON_SIP
+	help
+	  PyQt4 for Qt Embedded 4 bindings.
+
+	  http://www.riverbankcomputing.com/software/pyqt/
package/python-pyqt/python-pyqt.hash new file +5 -0
new file mode 100644
index 0000000..1709b66
@@ -0,0 +1,5 @@
+# From http://http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.3/
+md5 997c3e443165a89a559e0d96b061bf70 PyQt-x11-gpl-4.11.3.tar.gz
+
+# Locally calculated:
+sha256 853780dcdbe2e6ba785d703d059b096e1fc49369d3e8d41a060be874b8745686 PyQt-x11-gpl-4.11.3.tar.gz
package/python-pyqt/python-pyqt.mk new file +84 -0

84 lines not on this page · raw message

Signature · 1 line
2.0.5
#2 lore raw

PATCH v3 2/2 python-pyqt: new package

Gwenhael,

Quoted 4 lines · Gwenhael Goavec-Merou

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

Patch applied, after doing some additional changes:

[Thomas:
- Remove dependency on python (already a dependency of python-sip), and add a dependency on host-python-sip, since python-sip no longer depends on host-python-sip.
- Make the code Python 2 / Python 3 compatible (both have been tested).
- Fix indentation all over the place.
- Remove double quotes when defining variable values, not needed.
- Add <pkg>_BUILD_CMDS to do the build process separately from the installation.
- Create a PYTHON_PYQT_CONF_OPTS variable with all the config options, since some of them are now conditional.
- Use 'compileall' to byte-compile the dummy __init__.py.]

I also made a fix on python-sip to make things build properly on Python 3.

I tested PyQt with both Python 2 and Python 3, and I was able to run:

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

from PyQt4 import QtCore
QtCore.QDateTime.currentDateTime()

PyQt4.QtCore.QDateTime(2015, 4, 19, 16, 59, 12, 794)

in both cases. Don't hesitate to test with bigger applications to confirm that everything is still working fine.

Thanks!

Thomas

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

PATCH v3 2/2 python-pyqt: new package

Thomas.

Thank for review and corrections.

Regards
Gwenhael

Quoted 42 lines · On Sun, 19 Apr 2015 19:23:45 +0200 Thomas Petazzoni…

Gwenhael,

Quoted 4 lines · Gwenhael Goavec-Merou

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

Patch applied, after doing some additional changes:

[Thomas:
- Remove dependency on python (already a dependency of python-sip), and add a dependency on host-python-sip, since python-sip no longer depends on host-python-sip.
- Make the code Python 2 / Python 3 compatible (both have been tested).
- Fix indentation all over the place.
- Remove double quotes when defining variable values, not needed.
- Add <pkg>_BUILD_CMDS to do the build process separately from the installation.
- Create a PYTHON_PYQT_CONF_OPTS variable with all the config options, since some of them are now conditional.
- Use 'compileall' to byte-compile the dummy __init__.py.]

I also made a fix on python-sip to make things build properly on Python 3.

I tested PyQt with both Python 2 and Python 3, and I was able to run:

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

from PyQt4 import QtCore
QtCore.QDateTime.currentDateTime()

PyQt4.QtCore.QDateTime(2015, 4, 19, 16, 59, 12, 794)

in both cases. Don't hesitate to test with bigger applications to confirm that everything is still working fine.

Thanks!

Thomas

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

PATCH v3 1/2 python-sip: new package

In reply to Gwenhael Goavec-Merou

Dear Gwenhael Goavec-Merou,

Quoted 18 lines · Gwenhael Goavec-Merou

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

Based on http://lists.busybox.net/pipermail/buildroot/2013-October/080830.html

---
Changes v2 -> v3:
* bump version.
* suppress patch, --sysroot is enough.
* use qmake for configuration instead of sed.
* corrects LICENSE variable
* add depends on Qt
Changes v1 -> v2:
* renames patch.
* add depends on BR2_INSTALL_LIBSTDCPP.
* add hash file.
* add license informations.

Quoted 9 lines
---
 package/Config.in                  |  1 +
 package/python-sip/Config.in       | 12 ++++++++++
 package/python-sip/python-sip.hash |  4 ++++
 package/python-sip/python-sip.mk   | 45 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 62 insertions(+)
 create mode 100644 package/python-sip/Config.in
 create mode 100644 package/python-sip/python-sip.hash
 create mode 100644 package/python-sip/python-sip.mk

I've applied, but after doing a certain amount of changes:

[Thomas:
- fix license information: it is a "or" between the SIP license, GPLv2 and GPLv3
- the target version of python-sip does *not* need the host version of python-sip, it can build perfectly fine without it. python-qt will need host-python-sip, but there's no need to have this dependency between python-sip and host-python-sip.
- add support for Python 3, since the package could also be enabled for Python 3.
- add <pkg>_BUILD_CMDS for host and target variants, so that the build does not take place when doing the installation.
- use HOST_MAKE_ENV and TARGET_MAKE_ENV where appropriate.
- fix indentation.
- propagate the thread and mmu dependencies from Qt.
- extend the Config.in help text.]

See the final result at
http://git.buildroot.net/buildroot/commit/?id=72578e1883c98cea00d5f0cdac8d49ee6f93f532.

Thanks!

Thomas

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