Source: pythonqt
Version: 2.0.1-1
Tags: patch
User: [email protected]
Usertags: qt48-transition
Your package fails to build against Qt 4.8 which is currently in experimental.
The transition to unstable/testing is tracked in bug #653903.
I'm attaching a patch that fixes the build failure.
The moc code calls the emit() function of PythonQtStdDecorators but emit is
defined to
an empty string.
So the patch defines QT_NO_KEYWORDS for moc_PythonQtStdDecorators.cxx and does
the necessary changes in PythonQtStdDecorators.h to support QT_NO_KEYWORDS.
Ideally the whole source would build without the generic Qt keywords but it
doesn't.
The patch can be applied even before Qt 4.8 enters unstable.
Build log:
> [ 93%] Building CXX object
> CMakeFiles/PythonQt.dir/src/gui/moc_PythonQtScriptingConsole.cxx.o
> /usr/bin/c++ -DPYTHONQT_EXPORTS -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -g
> -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
> -fPIC -I/usr/include/python2.7 -I/usr/include/qt4 -I/usr/include/qt4/QtGui
> -I/usr/include/qt4/QtCore -I/build/buildd/pythonqt-2.0.1/src -o
> CMakeFiles/PythonQt.dir/src/gui/moc_PythonQtScriptingConsole.cxx.o -c
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/gui/moc_PythonQtScriptingConsole.cxx
> In file included from
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/moc_PythonQtStdDecorators.cxx:10:0:
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/../../src/PythonQtStdDecorators.h:
> In member function 'void PythonQtStdDecorators::static_Qt_qDebug(const
> QByteArray&)':
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/../../src/PythonQtStdDecorators.h:83:72:
> warning: format not a string literal and no format arguments
> [-Wformat-security]
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/../../src/PythonQtStdDecorators.h:
> In member function 'void PythonQtStdDecorators::static_Qt_qWarning(const
> QByteArray&)':
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/../../src/PythonQtStdDecorators.h:85:76:
> warning: format not a string literal and no format arguments
> [-Wformat-security]
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/../../src/PythonQtStdDecorators.h:
> In member function 'void PythonQtStdDecorators::static_Qt_qCritical(const
> QByteArray&)':
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/../../src/PythonQtStdDecorators.h:87:78:
> warning: format not a string literal and no format arguments
> [-Wformat-security]
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/../../src/PythonQtStdDecorators.h:
> In member function 'void PythonQtStdDecorators::static_Qt_qFatal(const
> QByteArray&)':
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/../../src/PythonQtStdDecorators.h:89:72:
> warning: format not a string literal and no format arguments
> [-Wformat-security]
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/moc_PythonQtStdDecorators.cxx:
> In static member function 'static void
> PythonQtStdDecorators::qt_static_metacall(QObject*, QMetaObject::Call, int,
> void**)':
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/moc_PythonQtStdDecorators.cxx:152:25:
> error: expected unqualified-id before '(' token
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/moc_PythonQtStdDecorators.cxx:153:25:
> error: expected unqualified-id before '(' token
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/moc_PythonQtStdDecorators.cxx:154:25:
> error: expected unqualified-id before '(' token
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/moc_PythonQtStdDecorators.cxx:155:25:
> error: expected unqualified-id before '(' token
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/moc_PythonQtStdDecorators.cxx:156:25:
> error: expected unqualified-id before '(' token
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/moc_PythonQtStdDecorators.cxx:157:25:
> error: expected unqualified-id before '(' token
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/moc_PythonQtStdDecorators.cxx:158:26:
> error: expected unqualified-id before '(' token
> /build/buildd/pythonqt-2.0.1/obj-i686-linux-gnu/src/moc_PythonQtStdDecorators.cxx:159:26:
> error: expected unqualified-id before '(' token
> make[3]: *** [CMakeFiles/PythonQt.dir/src/moc_PythonQtStdDecorators.cxx.o]
> Error 1
Regards,
Felix
diff -Nru pythonqt-2.0.1/debian/patches/cmakebuildsystem.patch pythonqt-2.0.1/debian/patches/cmakebuildsystem.patch
--- pythonqt-2.0.1/debian/patches/cmakebuildsystem.patch 2011-03-10 16:19:44.000000000 +0100
+++ pythonqt-2.0.1/debian/patches/cmakebuildsystem.patch 2012-03-18 23:32:55.000000000 +0100
@@ -2,7 +2,7 @@
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ PythonQt2.0.1/CMakeLists.txt 2011-03-06 19:23:17.000000000 +0100
-@@ -0,0 +1,259 @@
+@@ -0,0 +1,266 @@
+cmake_minimum_required(VERSION 2.8)
+
+#-----------------------------------------------------------------------------
@@ -240,6 +240,13 @@
+set_target_properties(PythonQt PROPERTIES DEFINE_SYMBOL PYTHONQT_EXPORTS)
+set_target_properties(PythonQt PROPERTIES ${PythonQt_LIBRARY_PROPERTIES})
+
++foreach(source ${gen_moc_sources})
++ string(REGEX MATCH "PythonQtStdDecorators" match ${source})
++ if(match)
++ set_property(SOURCE ${source} PROPERTY COMPILE_FLAGS -DQT_NO_KEYWORDS)
++ endif(match)
++endforeach(source {gen_moc_sources})
++
+#
+# That should solve linkage error on Mac when the project is used in a superbuild setup
+# See http://blog.onesadcookie.com/2008/01/installname-magic.html
diff -Nru pythonqt-2.0.1/debian/patches/series pythonqt-2.0.1/debian/patches/series
--- pythonqt-2.0.1/debian/patches/series 2011-03-10 16:19:44.000000000 +0100
+++ pythonqt-2.0.1/debian/patches/series 2012-03-18 23:20:37.000000000 +0100
@@ -1 +1,2 @@
cmakebuildsystem.patch
+stddecorators_no_keywords.patch
diff -Nru pythonqt-2.0.1/debian/patches/stddecorators_no_keywords.patch pythonqt-2.0.1/debian/patches/stddecorators_no_keywords.patch
--- pythonqt-2.0.1/debian/patches/stddecorators_no_keywords.patch 1970-01-01 01:00:00.000000000 +0100
+++ pythonqt-2.0.1/debian/patches/stddecorators_no_keywords.patch 2012-03-18 23:20:44.000000000 +0100
@@ -0,0 +1,24 @@
+--- pythonqt-2.0.1.orig/src/PythonQtStdDecorators.h
++++ pythonqt-2.0.1/src/PythonQtStdDecorators.h
+@@ -56,16 +56,20 @@ class PYTHONQT_EXPORT PythonQtStdDecorat
+ {
+ Q_OBJECT
+
+-public slots:
++public Q_SLOTS:
+ bool connect(QObject* sender, const QByteArray& signal, PyObject* callable);
+ bool connect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot);
+ bool disconnect(QObject* sender, const QByteArray& signal, PyObject* callable);
+ bool disconnect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot);
+
++#ifndef QT_NO_KEYWORDS
+ #undef emit
++#endif
+ void emit(QObject* sender, const QByteArray& signal, PyObject* arg1 = NULL,PyObject* arg2 = NULL,
+ PyObject* arg3 = NULL,PyObject* arg4 = NULL,PyObject* arg5 = NULL,PyObject* arg6 = NULL,PyObject* arg7 = NULL);
++#ifndef QT_NO_KEYWORDS
+ #define emit
++#endif
+
+ QObject* parent(QObject* o);
+ void setParent(QObject* o, QObject* parent);