[Python-modules-commits] [pythonqt] 01/02: Changes developed in parallel when moving to 3.2
Jonathan Cristopher Carter
jcc at moszumanska.debian.org
Sat Oct 7 12:05:57 UTC 2017
This is an automated email from the git hooks/post-receive script.
jcc pushed a commit to branch master
in repository pythonqt.
commit 2170d2ed3b30f08ef5cc90557859af14b22da206
Author: Erik Lundin <erik at lun.nu>
Date: Sun Oct 1 21:12:16 2017 +0200
Changes developed in parallel when moving to 3.2
- Use generator to create Qt wrapper code
- Build packages for both Python 2 and Python 3
- Place QtAll extension in separate package
- Implement multiarch support
- Create pkg-config files
---
debian/changelog | 10 +
debian/control | 216 ++++++++++++++++++---
debian/libpythonqt-qt5-common-dev.install | 2 +
debian/libpythonqt-qt5-python2-3.install | 3 +
debian/libpythonqt-qt5-python2-dev.install | 4 +
debian/libpythonqt-qt5-python3-3.install | 3 +
debian/libpythonqt-qt5-python3-dev.install | 4 +
debian/libpythonqt-qtall-qt5-common-dev.install | 1 +
debian/libpythonqt-qtall-qt5-python2-3.install | 3 +
debian/libpythonqt-qtall-qt5-python2-dev.install | 4 +
debian/libpythonqt-qtall-qt5-python3-3.install | 3 +
debian/libpythonqt-qtall-qt5-python3-dev.install | 4 +
debian/patches/create-pkg-config.diff | 43 ++++
debian/patches/enable-python-selection.diff | 35 ++++
debian/patches/fix-string-literals | 49 -----
debian/patches/series | 5 +-
.../skip-functions-with-rvalue-references.diff | 167 ++++++++++++++++
debian/patches/skip-variadic-functions.diff | 26 +++
debian/rules | 37 +++-
19 files changed, 546 insertions(+), 73 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index a0e0e1b..86c9988 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+pythonqt (3.2-4~exp2) experimental; urgency=medium
+
+ * Use generator to create Qt wrapper code
+ * Build packages for both Python 2 and Python 3
+ * Place QtAll extension in separate package
+ * Implement multiarch support
+ * Create pkg-config files
+
+ -- Erik Lundin <erik at lun.nu> Sun, 1 Oct 2017 21:08:09 +0200
+
pythonqt (3.2-4~exp1) experimental; urgency=medium
* Fix FTBFS on arm and hppa architectures
diff --git a/debian/control b/debian/control
index 8ad82bc..7c1c6a8 100644
--- a/debian/control
+++ b/debian/control
@@ -3,22 +3,15 @@ Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.
Uploaders: Jonathan Carter <jcc at debian.org>
Section: libs
Priority: optional
-Build-Depends: cmake,
- debhelper (>= 10),
- libgtk2.0-dev,
- libpulse-dev,
- libpythonqt-dev,
- libqt5designer5,
- libqt5multimediawidgets5,
+Build-Depends: debhelper (>= 10),
+ dh-exec (>= 0.3),
libqt5opengl5-dev,
libqt5svg5-dev,
libqt5xmlpatterns5-dev,
- libqtwebkit-dev,
- pyqt5-dev,
- pyqt5-dev-tools,
python-dev,
- python3-pyside.qtuitools,
+ python3-dev,
qt5-qmake,
+ qtbase5-dev,
qtbase5-private-dev,
qtdeclarative5-dev,
qtmultimedia5-dev,
@@ -27,14 +20,17 @@ Standards-Version: 4.1.0
Vcs-Git: https://anonscm.debian.org/git/python-modules/packages/pythonqt.git
Vcs-Browser: https://anonscm.debian.org/git/python-modules/packages/pythonqt.git
Homepage: http://pythonqt.sourceforge.net
-X-Python-Version: current
+X-Python-Version: >= 2.6
+X-Python3-Version: >= 3.3
-Package: libpythonqt3.2
+Package: libpythonqt-qt5-python2-3
Architecture: any
-Depends: ${misc:Depends}, ${shlibs:Depends}
+Multi-Arch: same
+Depends: ${shlibs:Depends},
+ ${misc:Depends}
Description: Dynamic Python binding for the Qt framework - runtime
PythonQt offers an easy way to embed the Python scripting language into a
- C++ Qt applications. It makes heavy use of the QMetaObject system and thus
+ C++ Qt applications. It makes heavy use of the QMetaObject system and
requires Qt 5.x.
The focus of PythonQt is on embedding Python into an existing C++ application,
not on writing the whole application completely in Python. If you want to write
@@ -43,17 +39,18 @@ Description: Dynamic Python binding for the Qt framework - runtime
Application and to script parts of your application via Python, PythonQt is the
way to go!
.
- This package contains the libraries needed to run PythonQt applications.
+ This package contains the libraries needed to run PythonQt applications
+ for Python 2.
-Package: libpythonqt-dev
+Package: libpythonqt-qt5-common-dev
Architecture: any
+Multi-Arch: same
Section: libdevel
-Depends: libpythonqt3.2 (= ${binary:Version}),
- ${misc:Depends},
- ${shlibs:Depends}
+Depends: ${shlibs:Depends},
+ ${misc:Depends}
Description: Dynamic Python binding for the Qt framework - development
PythonQt offers an easy way to embed the Python scripting language into a
- C++ Qt applications. It makes heavy use of the QMetaObject system and thus
+ C++ Qt applications. It makes heavy use of the QMetaObject system and
requires Qt 5.x.
The focus of PythonQt is on embedding Python into an existing C++ application,
not on writing the whole application completely in Python. If you want to write
@@ -62,4 +59,179 @@ Description: Dynamic Python binding for the Qt framework - development
Application and to script parts of your application via Python, PythonQt is the
way to go!
.
- This package contains development files needed to build PythonQt applications.
+ This package contains development files common for Python 2 and Python 3
+ needed to build PythonQt applications.
+
+Package: libpythonqt-qt5-python2-dev
+Architecture: any
+Multi-Arch: same
+Section: libdevel
+Depends: libpythonqt-qt5-python2-3 (= ${binary:Version}),
+ libpythonqt-qt5-common-dev (= ${binary:Version}),
+ pkg-config,
+ ${shlibs:Depends},
+ ${misc:Depends}
+Description: Dynamic Python binding for the Qt framework - development
+ PythonQt offers an easy way to embed the Python scripting language into a
+ C++ Qt applications. It makes heavy use of the QMetaObject system and
+ requires Qt 5.x.
+ The focus of PythonQt is on embedding Python into an existing C++ application,
+ not on writing the whole application completely in Python. If you want to write
+ your whole application in Python, you should use PyQt or PySide instead.
+ If you are looking for a simple way to embed Python objects into your C++/Qt
+ Application and to script parts of your application via Python, PythonQt is the
+ way to go!
+ .
+ This package contains development files needed to build PythonQt applications
+ for Python 2.
+
+Package: libpythonqt-qtall-qt5-python2-3
+Architecture: any
+Multi-Arch: same
+Depends: libpythonqt-qt5-python2-3 (= ${binary:Version}),
+ pkg-config,
+ ${shlibs:Depends},
+ ${misc:Depends}
+Description: Dynamic Python binding for the Qt framework - runtime
+ PythonQt offers an easy way to embed the Python scripting language into a
+ C++ Qt applications. It makes heavy use of the QMetaObject system and
+ requires Qt 5.x.
+ The focus of PythonQt is on embedding Python into an existing C++ application,
+ not on writing the whole application completely in Python. If you want to write
+ your whole application in Python, you should use PyQt or PySide instead.
+ If you are looking for a simple way to embed Python objects into your C++/Qt
+ Application and to script parts of your application via Python, PythonQt is the
+ way to go!
+ .
+ This package contains the extension PythonQt_QtAll, enabling usage of
+ Qt classes from the embedded Python 2 code.
+
+Package: libpythonqt-qtall-qt5-common-dev
+Architecture: any
+Multi-Arch: same
+Section: libdevel
+Depends: libpythonqt-qt5-common-dev (= ${binary:Version}),
+ ${shlibs:Depends},
+ ${misc:Depends}
+Description: Dynamic Python binding for the Qt framework - development
+ PythonQt offers an easy way to embed the Python scripting language into a
+ C++ Qt applications. It makes heavy use of the QMetaObject system and
+ requires Qt 5.x.
+ The focus of PythonQt is on embedding Python into an existing C++ application,
+ not on writing the whole application completely in Python. If you want to write
+ your whole application in Python, you should use PyQt or PySide instead.
+ If you are looking for a simple way to embed Python objects into your C++/Qt
+ Application and to script parts of your application via Python, PythonQt is the
+ way to go!
+ .
+ This package contains development files common for both Python 2 and Python 3
+ needed to build applications using and the PythonQt extension PythonQt_QtAll.
+
+Package: libpythonqt-qtall-qt5-python2-dev
+Architecture: any
+Multi-Arch: same
+Section: libdevel
+Depends: libpythonqt-qtall-qt5-python2-3 (= ${binary:Version}),
+ libpythonqt-qtall-qt5-common-dev (= ${binary:Version}),
+ libpythonqt-qt5-python2-dev (= ${binary:Version}),
+ ${shlibs:Depends},
+ ${misc:Depends}
+Description: Dynamic Python binding for the Qt framework - development
+ PythonQt offers an easy way to embed the Python scripting language into a
+ C++ Qt applications. It makes heavy use of the QMetaObject system and
+ requires Qt 5.x.
+ The focus of PythonQt is on embedding Python into an existing C++ application,
+ not on writing the whole application completely in Python. If you want to write
+ your whole application in Python, you should use PyQt or PySide instead.
+ If you are looking for a simple way to embed Python objects into your C++/Qt
+ Application and to script parts of your application via Python, PythonQt is the
+ way to go!
+ .
+ This package contains development files needed to build applications
+ using and the PythonQt extension PythonQt_QtAll for Python 2.
+
+Package: libpythonqt-qt5-python3-3
+Architecture: any
+Multi-Arch: same
+Depends: ${shlibs:Depends},
+ ${misc:Depends}
+Description: Dynamic Python binding for the Qt framework - runtime
+ PythonQt offers an easy way to embed the Python scripting language into a
+ C++ Qt applications. It makes heavy use of the QMetaObject system and
+ requires Qt 5.x.
+ The focus of PythonQt is on embedding Python into an existing C++ application,
+ not on writing the whole application completely in Python. If you want to write
+ your whole application in Python, you should use PyQt or PySide instead.
+ If you are looking for a simple way to embed Python objects into your C++/Qt
+ Application and to script parts of your application via Python, PythonQt is the
+ way to go!
+ .
+ This package contains the libraries needed to run PythonQt applications
+ for Python 3.
+
+Package: libpythonqt-qt5-python3-dev
+Architecture: any
+Multi-Arch: same
+Section: libdevel
+Depends: libpythonqt-qt5-python3-3 (= ${binary:Version}),
+ libpythonqt-qt5-common-dev (= ${binary:Version}),
+ pkg-config,
+ ${shlibs:Depends},
+ ${misc:Depends}
+Description: Dynamic Python binding for the Qt framework - development
+ PythonQt offers an easy way to embed the Python scripting language into a
+ C++ Qt applications. It makes heavy use of the QMetaObject system and
+ requires Qt 5.x.
+ The focus of PythonQt is on embedding Python into an existing C++ application,
+ not on writing the whole application completely in Python. If you want to write
+ your whole application in Python, you should use PyQt or PySide instead.
+ If you are looking for a simple way to embed Python objects into your C++/Qt
+ Application and to script parts of your application via Python, PythonQt is the
+ way to go!
+ .
+ This package contains development files needed to build PythonQt applications
+ for Python 3.
+
+Package: libpythonqt-qtall-qt5-python3-3
+Architecture: any
+Multi-Arch: same
+Depends: libpythonqt-qt5-python3-3 (= ${binary:Version}),
+ ${shlibs:Depends},
+ ${misc:Depends}
+Description: Dynamic Python binding for the Qt framework - runtime
+ PythonQt offers an easy way to embed the Python scripting language into a
+ C++ Qt applications. It makes heavy use of the QMetaObject system and
+ requires Qt 5.x.
+ The focus of PythonQt is on embedding Python into an existing C++ application,
+ not on writing the whole application completely in Python. If you want to write
+ your whole application in Python, you should use PyQt or PySide instead.
+ If you are looking for a simple way to embed Python objects into your C++/Qt
+ Application and to script parts of your application via Python, PythonQt is the
+ way to go!
+ .
+ This package contains the extension PythonQt_QtAll, enabling usage of
+ Qt classes from the embedded Python 3 code.
+
+Package: libpythonqt-qtall-qt5-python3-dev
+Architecture: any
+Multi-Arch: same
+Section: libdevel
+Depends: libpythonqt-qtall-qt5-python3-3 (= ${binary:Version}),
+ libpythonqt-qtall-qt5-common-dev (= ${binary:Version}),
+ libpythonqt-qt5-python3-dev (= ${binary:Version}),
+ pkg-config,
+ ${shlibs:Depends},
+ ${misc:Depends}
+Description: Dynamic Python binding for the Qt framework - development
+ PythonQt offers an easy way to embed the Python scripting language into a
+ C++ Qt applications. It makes heavy use of the QMetaObject system and
+ requires Qt 5.x.
+ The focus of PythonQt is on embedding Python into an existing C++ application,
+ not on writing the whole application completely in Python. If you want to write
+ your whole application in Python, you should use PyQt or PySide instead.
+ If you are looking for a simple way to embed Python objects into your C++/Qt
+ Application and to script parts of your application via Python, PythonQt is the
+ way to go!
+ .
+ This package contains development files needed to build applications
+ using and the PythonQt extension PythonQt_QtAll for Python 3.
diff --git a/debian/libpythonqt-qt5-common-dev.install b/debian/libpythonqt-qt5-common-dev.install
new file mode 100644
index 0000000..61cb3a2
--- /dev/null
+++ b/debian/libpythonqt-qt5-common-dev.install
@@ -0,0 +1,2 @@
+src/*.h usr/include/PythonQt5/
+src/gui/*.h usr/include/PythonQt5/gui/
diff --git a/debian/libpythonqt-qt5-python2-3.install b/debian/libpythonqt-qt5-python2-3.install
new file mode 100755
index 0000000..976385f
--- /dev/null
+++ b/debian/libpythonqt-qt5-python2-3.install
@@ -0,0 +1,3 @@
+#!/usr/bin/dh-exec
+
+build-py2.*/lib/libPythonQt-Qt5-Python2.*.so.* usr/lib/${DEB_HOST_MULTIARCH}/
diff --git a/debian/libpythonqt-qt5-python2-dev.install b/debian/libpythonqt-qt5-python2-dev.install
new file mode 100755
index 0000000..cd40f01
--- /dev/null
+++ b/debian/libpythonqt-qt5-python2-dev.install
@@ -0,0 +1,4 @@
+#!/usr/bin/dh-exec
+
+build-py2.*/lib/libPythonQt-Qt5-Python2.*.so usr/lib/${DEB_HOST_MULTIARCH}/
+build-py2.*/lib/PythonQt-Qt5-Python2.pc usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/
diff --git a/debian/libpythonqt-qt5-python3-3.install b/debian/libpythonqt-qt5-python3-3.install
new file mode 100755
index 0000000..05b45f8
--- /dev/null
+++ b/debian/libpythonqt-qt5-python3-3.install
@@ -0,0 +1,3 @@
+#!/usr/bin/dh-exec
+
+build-py3.*/lib/libPythonQt-Qt5-Python3.*.so.* usr/lib/${DEB_HOST_MULTIARCH}/
diff --git a/debian/libpythonqt-qt5-python3-dev.install b/debian/libpythonqt-qt5-python3-dev.install
new file mode 100755
index 0000000..bc4ca62
--- /dev/null
+++ b/debian/libpythonqt-qt5-python3-dev.install
@@ -0,0 +1,4 @@
+#!/usr/bin/dh-exec
+
+build-py3.*/lib/libPythonQt-Qt5-Python3.*.so usr/lib/${DEB_HOST_MULTIARCH}/
+build-py3.*/lib/PythonQt-Qt5-Python3.pc usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/
diff --git a/debian/libpythonqt-qtall-qt5-common-dev.install b/debian/libpythonqt-qtall-qt5-common-dev.install
new file mode 100644
index 0000000..67958bd
--- /dev/null
+++ b/debian/libpythonqt-qtall-qt5-common-dev.install
@@ -0,0 +1 @@
+extensions/PythonQt_QtAll/*.h usr/include/PythonQt5/
diff --git a/debian/libpythonqt-qtall-qt5-python2-3.install b/debian/libpythonqt-qtall-qt5-python2-3.install
new file mode 100755
index 0000000..900db2a
--- /dev/null
+++ b/debian/libpythonqt-qtall-qt5-python2-3.install
@@ -0,0 +1,3 @@
+#!/usr/bin/dh-exec
+
+build-py2.*/lib/libPythonQt_QtAll-Qt5-Python2.*.so.* usr/lib/${DEB_HOST_MULTIARCH}/
diff --git a/debian/libpythonqt-qtall-qt5-python2-dev.install b/debian/libpythonqt-qtall-qt5-python2-dev.install
new file mode 100755
index 0000000..6adbcc2
--- /dev/null
+++ b/debian/libpythonqt-qtall-qt5-python2-dev.install
@@ -0,0 +1,4 @@
+#!/usr/bin/dh-exec
+
+build-py2.*/lib/libPythonQt_QtAll-Qt5-Python2.*.so usr/lib/${DEB_HOST_MULTIARCH}/
+build-py2.*/lib/PythonQt_QtAll-Qt5-Python2.pc usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/
diff --git a/debian/libpythonqt-qtall-qt5-python3-3.install b/debian/libpythonqt-qtall-qt5-python3-3.install
new file mode 100755
index 0000000..45ccc9b
--- /dev/null
+++ b/debian/libpythonqt-qtall-qt5-python3-3.install
@@ -0,0 +1,3 @@
+#!/usr/bin/dh-exec
+
+build-py3.*/lib/libPythonQt_QtAll-Qt5-Python3.*.so.* usr/lib/${DEB_HOST_MULTIARCH}/
diff --git a/debian/libpythonqt-qtall-qt5-python3-dev.install b/debian/libpythonqt-qtall-qt5-python3-dev.install
new file mode 100755
index 0000000..db37227
--- /dev/null
+++ b/debian/libpythonqt-qtall-qt5-python3-dev.install
@@ -0,0 +1,4 @@
+#!/usr/bin/dh-exec
+
+build-py3.*/lib/libPythonQt_QtAll-Qt5-Python3.*.so usr/lib/${DEB_HOST_MULTIARCH}/
+build-py3.*/lib/PythonQt_QtAll-Qt5-Python3.pc usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/
diff --git a/debian/patches/create-pkg-config.diff b/debian/patches/create-pkg-config.diff
new file mode 100644
index 0000000..6b5739f
--- /dev/null
+++ b/debian/patches/create-pkg-config.diff
@@ -0,0 +1,43 @@
+Description: Create pkg-config files
+From: Erik Lundin <erik at lun.nu>
+Origin: https://sourceforge.net/p/pythonqt/discussion/631392/thread/b2b4bb19/
+
+--- a/src/src.pro
++++ b/src/src.pro
+@@ -39,5 +39,16 @@ TARGET = $$replace(TARGET, PythonXY, Pyt
+
+ include ( src.pri )
+
++unix {
++ CONFIG += create_pc create_prl no_install_prl
++ QMAKE_PKGCONFIG_NAME = PythonQt-Qt$${QT_MAJOR_VERSION}-Python$${PYTHON_VERSION}
++ QMAKE_PKGCONFIG_DESCRIPTION = Dynamic Python binding for the Qt framework
++ QMAKE_PKGCONFIG_PREFIX = $$INSTALLBASE
++ QMAKE_PKGCONFIG_LIBDIR = $$target.path
++ QMAKE_PKGCONFIG_INCDIR = $$headers.path
++ QMAKE_PKGCONFIG_INCDIR += $$PREFIX/include/PythonQt5
++ QMAKE_PKGCONFIG_VERSION = $$VERSION
++}
++
+ include($${PYTHONQT_GENERATED_PATH}/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin.pri)
+ include($${PYTHONQT_GENERATED_PATH}/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin.pri)
+--- a/extensions/PythonQt_QtAll/PythonQt_QtAll.pro
++++ b/extensions/PythonQt_QtAll/PythonQt_QtAll.pro
+@@ -20,6 +20,17 @@ HEADERS += \
+ SOURCES += \
+ PythonQt_QtAll.cpp
+
++unix {
++ CONFIG += create_pc create_prl no_install_prl
++ QMAKE_PKGCONFIG_NAME = PythonQt_QtAll-Qt$${QT_MAJOR_VERSION}-Python$${PYTHON_VERSION}
++ QMAKE_PKGCONFIG_DESCRIPTION = Dynamic Python binding for the Qt framework
++ QMAKE_PKGCONFIG_PREFIX = $$INSTALLBASE
++ QMAKE_PKGCONFIG_LIBDIR = $$target.path
++ QMAKE_PKGCONFIG_INCDIR = $$headers.path
++ QMAKE_PKGCONFIG_INCDIR += $$PREFIX/include/PythonQt5
++ QMAKE_PKGCONFIG_VERSION = $$VERSION
++}
++
+ QT += gui svg sql network xml xmlpatterns opengl
+ QT += widgets printsupport multimedia multimediawidgets
+ QT += quick qml quickwidgets uitools
diff --git a/debian/patches/enable-python-selection.diff b/debian/patches/enable-python-selection.diff
new file mode 100644
index 0000000..64b0ccc
--- /dev/null
+++ b/debian/patches/enable-python-selection.diff
@@ -0,0 +1,35 @@
+Description: Enable selection of Python version
+ Enables selection of the Python version using the environment variable
+ PYTHON_VERSION.
+From: Joerg Kreuzberger <kreuzberger at users.sourceforge.net>
+Origin: https://sourceforge.net/p/pythonqt/discussion/631392/thread/4bc9704c/#0614
+Applied-Upstream: 3.3, https://sourceforge.net/p/pythonqt/code/457/
+
+--- a/build/python.prf
++++ b/build/python.prf
+@@ -1,8 +1,13 @@
+ # profile to include and link Python
+
++
+ # Change this variable to your python version (2.6, 2.7, 3.3, ...)
+-win32:PYTHON_VERSION=27
+-unix:PYTHON_VERSION=2.7
++PYTHON_VERSION=$$(PYTHON_VERSION)
++isEmpty( PYTHON_VERSION ) {
++ win32:PYTHON_VERSION=27
++ unix:PYTHON_VERSION=2.7
++}
++
+
+ macx {
+ # for macx you need to have the Python development kit installed as framework
+@@ -35,7 +40,7 @@
+ } else:unix {
+ # on linux, python-config is used to autodetect Python.
+ # make sure that you have installed a matching python-dev package.
+-
+- unix:LIBS += $$system(python$${PYTHON_VERSION}-config --libs)
++
++ unix:LIBS += $$system(python$${PYTHON_VERSION}-config --ldflags)
+ unix:QMAKE_CXXFLAGS += $$system(python$${PYTHON_VERSION}-config --includes)
+ }
diff --git a/debian/patches/fix-string-literals b/debian/patches/fix-string-literals
deleted file mode 100644
index 6ac8fd0..0000000
--- a/debian/patches/fix-string-literals
+++ /dev/null
@@ -1,49 +0,0 @@
-Description: fix-string-literals
- Debug and error messages are unquoted, resulting in a compilation security
- warning that results in a failure to build.
- .
- This patch replaces (msg) with ("%", msg) which makes the strings safer
- and fixes the build failure.
-Author: Jonathan Carter <jcc at debian.org>
-
---- pythonqt-3.2.orig/generated_cpp_56/com_trolltech_qt_core/com_trolltech_qt_core1.cpp
-+++ pythonqt-3.2/generated_cpp_56/com_trolltech_qt_core/com_trolltech_qt_core1.cpp
-@@ -4951,32 +4951,32 @@ return new QMessageLogger(file, line, fu
-
- void PythonQtWrapper_QMessageLogger::critical(QMessageLogger* theWrappedObject, const char* msg) const
- {
-- ( theWrappedObject->critical(msg));
-+ ( theWrappedObject->critical("%s", msg));
- }
-
- void PythonQtWrapper_QMessageLogger::debug(QMessageLogger* theWrappedObject, const char* msg) const
- {
-- ( theWrappedObject->debug(msg));
-+ ( theWrappedObject->debug("%s", msg));
- }
-
- void PythonQtWrapper_QMessageLogger::fatal(QMessageLogger* theWrappedObject, const char* msg) const
- {
-- ( theWrappedObject->fatal(msg));
-+ ( theWrappedObject->fatal("%s", msg));
- }
-
- void PythonQtWrapper_QMessageLogger::info(QMessageLogger* theWrappedObject, const char* msg) const
- {
-- ( theWrappedObject->info(msg));
-+ ( theWrappedObject->info("%s", msg));
- }
-
- void PythonQtWrapper_QMessageLogger::noDebug(QMessageLogger* theWrappedObject, const char* arg__1) const
- {
-- ( theWrappedObject->noDebug(arg__1));
-+ ( theWrappedObject->noDebug("%s", arg__1));
- }
-
- void PythonQtWrapper_QMessageLogger::warning(QMessageLogger* theWrappedObject, const char* msg) const
- {
-- ( theWrappedObject->warning(msg));
-+ ( theWrappedObject->warning("%s", msg));
- }
-
-
diff --git a/debian/patches/series b/debian/patches/series
index 757ee95..817441b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,4 @@
-fix-string-literals
+enable-python-selection.diff
+skip-functions-with-rvalue-references.diff
+skip-variadic-functions.diff
+create-pkg-config.diff
diff --git a/debian/patches/skip-functions-with-rvalue-references.diff b/debian/patches/skip-functions-with-rvalue-references.diff
new file mode 100644
index 0000000..e0b1c0a
--- /dev/null
+++ b/debian/patches/skip-functions-with-rvalue-references.diff
@@ -0,0 +1,167 @@
+Description: Skip functions with rvalue references
+ The code generator doesn't handle rvalue references present at least since
+ Qt 5.7 and generates code where function arguments are passed by value instead
+ of by rvalue reference. Trying to compile that code gives errors like
+ "error: call of overloaded [...] is ambiguous".
+ .
+ Skipping functions with rvalue reference arguments in the code generator should
+ be fine according to upstream developer Florian, since they don't make sense
+ for Python wrappers anyway.
+From: Erik Lundin <erik at lun.nu>
+Origin: https://sourceforge.net/p/pythonqt/discussion/631392/thread/49cb56c2/#1ce7
+Applied-Upstream: 3.3, https://sourceforge.net/p/pythonqt/code/459/
+
+--- a/generator/parser/binder.cpp
++++ b/generator/parser/binder.cpp
+@@ -375,6 +375,13 @@ void Binder::visitFunctionDefinition(FunctionDefinitionAST *node)
+ }
+
+ decl_cc.run(declarator);
++ foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters()) {
++ if (p.type.isRvalueReference()) {
++ std::cerr << "** Skipping function with rvalue reference parameter: "
++ << qPrintable(name_cc.name()) << std::endl;
++ return;
++ }
++ }
+
+ Q_ASSERT(! decl_cc.id().isEmpty());
+
+--- a/generator/parser/codemodel.cpp
++++ b/generator/parser/codemodel.cpp
+@@ -144,6 +144,7 @@ TypeInfo TypeInfo::combine (const TypeInfo &__lhs, const TypeInfo &__rhs)
+ __result.setConstant (__result.isConstant () || __rhs.isConstant ());
+ __result.setVolatile (__result.isVolatile () || __rhs.isVolatile ());
+ __result.setReference (__result.isReference () || __rhs.isReference ());
++ __result.setRvalueReference (__result.isRvalueReference () || __rhs.isRvalueReference ());
+ __result.setIndirections (__result.indirections () + __rhs.indirections ());
+ __result.setArrayElements (__result.arrayElements () + __rhs.arrayElements ());
+
+@@ -187,7 +188,9 @@ QString TypeInfo::toString() const
+ if (indirections())
+ tmp += QString(indirections(), QLatin1Char('*'));
+
+- if (isReference())
++ if (isRvalueReference())
++ tmp += QLatin1String("&&");
++ else if (isReference())
+ tmp += QLatin1Char('&');
+
+ if (isFunctionPointer())
+--- a/generator/parser/codemodel.h
++++ b/generator/parser/codemodel.h
+@@ -131,12 +131,13 @@ public:
+ : flags(other.flags),
+ m_qualifiedName(other.m_qualifiedName),
+ m_arrayElements(other.m_arrayElements),
+- m_arguments(other.m_arguments)
++ m_arguments(other.m_arguments),
++ m_rvalue_reference(other.m_rvalue_reference)
+ {
+ }
+
+ TypeInfo():
+- flags (0) {}
++ flags (0), m_rvalue_reference(false) {}
+
+ QStringList qualifiedName() const { return m_qualifiedName; }
+ void setQualifiedName(const QStringList &qualified_name) { m_qualifiedName = qualified_name; }
+@@ -150,6 +151,9 @@ public:
+ bool isReference() const { return m_reference; }
+ void setReference(bool is) { m_reference = is; }
+
++ bool isRvalueReference() const { return m_rvalue_reference; }
++ void setRvalueReference(bool is) { m_rvalue_reference = is; }
++
+ int indirections() const { return m_indirections; }
+ void setIndirections(int indirections) { m_indirections = indirections; }
+
+@@ -192,6 +196,7 @@ private:
+ QStringList m_qualifiedName;
+ QStringList m_arrayElements;
+ QList<TypeInfo> m_arguments;
++ bool m_rvalue_reference;
+ };
+
+ class _CodeModelItem: public QSharedData
+--- a/generator/parser/compiler_utils.cpp
++++ b/generator/parser/compiler_utils.cpp
+@@ -60,6 +60,7 @@ TypeInfo CompilerUtils::typeDescription(TypeSpecifierAST *type_specifier, Declar
+ typeInfo.setConstant (type_cc.isConstant ());
+ typeInfo.setVolatile (type_cc.isVolatile ());
+ typeInfo.setReference (decl_cc.isReference ());
++ typeInfo.setRvalueReference (decl_cc.isRvalueReference ());
+ typeInfo.setIndirections (decl_cc.indirection ());
+ typeInfo.setArrayElements (decl_cc.arrayElements ());
+
+--- a/generator/parser/declarator_compiler.cpp
++++ b/generator/parser/declarator_compiler.cpp
+@@ -62,6 +62,7 @@ void DeclaratorCompiler::run(DeclaratorAST *node)
+ _M_array.clear();
+ _M_function = false;
+ _M_reference = false;
++ _M_rvalue_reference = false;
+ _M_variadics = false;
+ _M_indirection = 0;
+
+@@ -116,6 +117,10 @@ void DeclaratorCompiler::visitPtrOperator(PtrOperatorAST *node)
+
+ switch (op)
+ {
++ case Token_and:
++ _M_rvalue_reference = true;
++ _M_reference = false;
++ break;
+ case '&':
+ _M_reference = true;
+ break;
+--- a/generator/parser/declarator_compiler.h
++++ b/generator/parser/declarator_compiler.h
+@@ -75,6 +75,7 @@ public:
+ inline bool isFunction() const { return _M_function; }
+ inline bool isVariadics() const { return _M_variadics; }
+ inline bool isReference() const { return _M_reference; }
++ inline bool isRvalueReference() const { return _M_rvalue_reference; }
+ inline int indirection() const { return _M_indirection; }
+ inline QList<Parameter> parameters() const { return _M_parameters; }
+
+@@ -88,6 +89,7 @@ private:
+
+ bool _M_function;
+ bool _M_reference;
++ bool _M_rvalue_reference;
+ bool _M_variadics;
+ int _M_indirection;
+ QString _M_id;
+--- a/generator/parser/name_compiler.cpp
++++ b/generator/parser/name_compiler.cpp
+@@ -147,7 +147,9 @@ void NameCompiler::visitTemplateArgument(TemplateArgumentAST *node)
+
+ _M_name.last() += q.join("::");
+
+- if (decl_cc.isReference())
++ if (decl_cc.isRvalueReference())
++ _M_name.last() += "&&";
++ else if (decl_cc.isReference())
+ _M_name.last() += "&";
+ if (decl_cc.indirection())
+ _M_name.last() += QString(decl_cc.indirection(), '*');
+--- a/generator/parser/parser.cpp
++++ b/generator/parser/parser.cpp
+@@ -1040,7 +1040,7 @@ bool Parser::parsePtrOperator(PtrOperatorAST *&node)
+ {
+ int tk = token_stream.lookAhead();
+
+- if (tk != '&' && tk != '*'
++ if (tk != '&' && tk != Token_and && tk != '*'
+ && tk != Token_scope && tk != Token_identifier)
+ {
+ return false;
+@@ -1054,6 +1054,7 @@ bool Parser::parsePtrOperator(PtrOperatorAST *&node)
+ {
+ case '&':
+ case '*':
++ case Token_and:
+ ast->op = token_stream.cursor();
+ token_stream.nextToken();
+ break;
diff --git a/debian/patches/skip-variadic-functions.diff b/debian/patches/skip-variadic-functions.diff
new file mode 100644
index 0000000..e3070d9
--- /dev/null
+++ b/debian/patches/skip-variadic-functions.diff
@@ -0,0 +1,26 @@
+Description: Skip variadic functions
+ Some functions in the Qt API are variadic (i.e. accepting a variable number of
+ arguments), e.g. void critical(const char *msg, ...) in QMessageLogger.
+ Compiling the generated wrapper code with GCC fails, because the log functions
+ of QMessageLogger expect a format and arguments, and giving them a char pointer
+ yields an error [-Werror=format-security].
+ .
+ Since the arguments aren't properly handled, this patch makes the generator
+ skip those functions.
+From: Erik Lundin <erik at lun.nu>
+Origin: https://sourceforge.net/p/pythonqt/discussion/631392/thread/005fca4a/#397c
+Applied-Upstream: 3.3, https://sourceforge.net/p/pythonqt/code/458/
+
+--- a/generator/abstractmetabuilder.cpp
++++ b/generator/abstractmetabuilder.cpp
+@@ -1463,6 +1463,10 @@ AbstractMetaFunction *AbstractMetaBuilder::traverseFunction(FunctionModelItem fu
+ if (function_item->isFriend())
+ return 0;
+
++ // Filter out variadic functions (having ... arguments) - they are not currently handled
++ if (function_item->isVariadics()) {
++ return 0;
++ }
+
+ QString cast_type;
+
diff --git a/debian/rules b/debian/rules
index 3a1d52d..41b5ea9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -14,5 +14,40 @@ ifneq (,$(findstring $(DEB_HOST_ARCH),hppa))
export DEB_CXXFLAGS_MAINT_APPEND=-mlong-calls
endif
+PY2VERS := $(shell pyversions -vd)
+PY3VERS := $(shell py3versions -vd)
+
%:
- dh $@ --parallel --buildsystem=qmake
+ dh $@
+
+override_dh_auto_configure:
+ dh_auto_configure
+ for i in $(PY2VERS) $(PY3VERS); do \
+ export PYTHON_VERSION=$${i}; \
+ dh_auto_configure --builddirectory=build-py$${i} -- LIBS+=-L$$PWD/build-py$${i}/lib ../PythonQt.pro; \
+ done
+
+override_dh_auto_build:
+ # Build the generator
+ dh_auto_build -- sub-generator
+
+ # Run the generator to create wrapper code for Qt classes. The generator
+ # will look for folders under QTDIR/include. To easily create this, symlink
+ # the correct include folder there.
+ cd generator; \
+ mkdir -p qtdir; \
+ ln -s /usr/include/x86_64-linux-gnu/qt5/ qtdir/include; \
+ QTDIR=qtdir ./pythonqt_generator qtscript_masterinclude.h build_all.txt
+
+ for i in $(PY2VERS) $(PY3VERS); do \
+ export PYTHON_VERSION=$${i}; \
+ dh_auto_build --builddirectory=build-py$${i} -- sub-src sub-extensions; \
+ done
+
+override_dh_auto_clean:
+ rm -rf build-py*
+ rm -rf generated_cpp
+ rm -rf generator/qtdir
+ rm -f generator/.preprocessed.tmp
+ rm -f generator/*.log
+ dh_auto_clean
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pythonqt.git
More information about the Python-modules-commits
mailing list