Commit ecb26b1a authored by Gwenhael Goavec-Merou's avatar Gwenhael Goavec-Merou Committed by Thomas Petazzoni
Browse files

python-pyqt: new package



[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.]

Signed-off-by: default avatarGwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
Cc: Sergey Kostanbaev <sergey.kostanbaev@gmail.com>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent 32574fe1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -618,6 +618,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"
+29 −0
Original line number Diff line number Diff line
Do not run qtdetail

qtdetail is a tool that generates qtdetail.out. Since this program is
cross-compiled, it's not possible to run it on the host.

Consequently, python-pyqt.mk generates the qtdetail.out file before
calling configure-ng.py.

Therefore, this patch makes sure that the pre-generated qtdetail.out
file is kept, and that qtdetail is not executed.

Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
Signed-off-by: Sergey Kostanbaev <sergey.kostanbaev@gmail.com>
---
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))
 
+43 −0
Original line number Diff line number Diff line
Add support for several Qt flavors

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 <gwenhael.goavec-merou@trabucayre.com>
---
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)
+44 −0
Original line number Diff line number Diff line
Add WS_QWS in the Platforms variable and to define some types

Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
Signed-off-by: Sergey Kostanbaev <sergey.kostanbaev@gmail.com>
---
Index: PyQt-x11-gpl-4.11.3/sip/QtCore/QtCoremod.sip
===================================================================
--- PyQt-x11-gpl-4.11.3.orig/sip/QtCore/QtCoremod.sip
+++ PyQt-x11-gpl-4.11.3/sip/QtCore/QtCoremod.sip
@@ -29,7 +29,7 @@
 
 %Timeline {Qt_4_1_0 Qt_4_1_1 Qt_4_1_2 Qt_4_1_3 Qt_4_2_0 Qt_4_2_1 Qt_4_2_2 Qt_4_2_3 Qt_4_3_0 Qt_4_3_1 Qt_4_3_2 Qt_4_3_3 Qt_4_3_4 Qt_4_4_0 Qt_4_4_1 Qt_4_4_2 Qt_4_5_0 Qt_4_5_1 Qt_4_5_2 Qt_4_5_3 Qt_4_6_0 Qt_4_6_1 Qt_4_6_2 Qt_4_6_3 Qt_4_7_0 Qt_4_7_1 Qt_4_7_2 Qt_4_7_3 Qt_4_7_4 Qt_4_8_0 Qt_4_8_1 Qt_4_8_2 Qt_4_8_3 Qt_4_8_4 Qt_4_8_5 Qt_4_8_6 Qt_5_0_0}
 
-%Platforms {WS_X11 WS_WIN WS_MACX}
+%Platforms {WS_X11 WS_QWS WS_WIN WS_MACX}
 
 %Feature PyQt_Accessibility
 %Feature PyQt_SessionManager
Index: PyQt-x11-gpl-4.11.3/sip/QtCore/qprocess.sip
===================================================================
--- PyQt-x11-gpl-4.11.3.orig/sip/QtCore/qprocess.sip
+++ PyQt-x11-gpl-4.11.3/sip/QtCore/qprocess.sip
@@ -28,7 +28,7 @@
 %If (WS_WIN)
 typedef void *Q_PID;
 %End
-%If (WS_X11 || WS_MACX)
+%If (WS_X11 || WS_QWS || WS_MACX)
 typedef qint64 Q_PID;
 %End
 
Index: PyQt-x11-gpl-4.11.3/sip/QtGui/qwindowdefs.sip
===================================================================
--- PyQt-x11-gpl-4.11.3.orig/sip/QtGui/qwindowdefs.sip
+++ PyQt-x11-gpl-4.11.3/sip/QtGui/qwindowdefs.sip
@@ -27,7 +27,7 @@
 
 typedef QList<QWidget*> QWidgetList;
 %If (- Qt_5_0_0)
-%If (WS_X11)
+%If (WS_X11 || WS_QWS)
 // X11 specific definitions.
 typedef unsigned long WId;
 %End
+18 −0
Original line number Diff line number Diff line
Hide QFont::cacheStatistics which isn't available in QWS

Signed-off-by: Sergey Kostanbaev <sergey.kostanbaev@gmail.com>
---

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;
Loading