Merge lp:~sil2100/appmenu-qt/appmenu-qt-multi into lp:appmenu-qt

Proposed by Łukasz Zemczak
Status: Merged
Approved by: Allan LeSage
Approved revision: 68
Merged at revision: 55
Proposed branch: lp:~sil2100/appmenu-qt/appmenu-qt-multi
Merge into: lp:appmenu-qt
Diff against target: 317 lines (+145/-26)
9 files modified
CMakeLists.txt (+20/-2)
debian/changelog (+10/-0)
debian/control (+19/-1)
debian/copyright (+5/-5)
debian/rules (+23/-1)
src/CMakeLists.txt (+60/-17)
src/appmenuplatformmenubar.cpp (+2/-0)
src/appmenuplatformmenubar.h (+5/-0)
src/appmenuplatformmenubar.json (+1/-0)
To merge this branch: bzr merge lp:~sil2100/appmenu-qt/appmenu-qt-multi
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Mathieu Trudel-Lapierre Approve
Review via email: mp+156002@code.launchpad.net

Commit message

Straight port appmenu-qt to also support Qt5. Change packaging to do a double-build, building both appmenu-qt (for Qt4) and appmenu-qt5 (for Qt5) packages. In appmenu-qt5, do not depend on Qt5 in the package deps, instead let's Suggest them - we hack shlibs variable to do this nicely. This way we won't pull in Qt5 by default to Ubuntu.

Description of the change

- Problem:

Current appmenu-qt does not support Qt5, only Qt4 (LP: #1126205).

- Fix:

Straight port appmenu-qt to support also Qt5. Change packaging to do a double-build, building both appmenu-qt (for Qt4) and appmenu-qt5 (for Qt5). In appmenu-qt5, we do not depend on Qt5 in the package deps, instead let's Suggest them. This way we won't pull in Qt5 by default to Ubuntu.

NOTE! This needs the respective libdbusmenu-qt changes incorporated as well. A merge request for those will be soon available.

- Tests:

N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Could you also add Vcs-Browser: https://code.launchpad.net/~indicator-applet-developers/appmenu-qt/trunk/files below Vcs-Bzr ?

Also, debian/copyright is inconsistent, some places mention GPL 2, but refer to /usr/share/common-licenses/GPL-3; also, the License: stanza always mentions the unversioned name of the license, when it should be GPL-3, GPL-2, or LGPL-2.1.

review: Needs Fixing
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Should be
118 +License: LGPL-2

LGPL-2.1; given that the license text below mentions 2.1... or fix the text... Also correct the reference to the file in /usr/share/common-licenses. :)

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Jenkins wants the depends to be fixed :)

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Looks good.

review: Approve
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

armhf fails because it's not setup with the PPA for testing that build -- approving.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Allan LeSage (allanlesage) wrote :

One more time! Disabled armhf build temporarily.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2012-04-05 15:10:00 +0000
3+++ CMakeLists.txt 2013-03-28 19:20:25 +0000
4@@ -7,6 +7,16 @@
5 set(appmenu_qt_VERSION_PATCH 6)
6 set(appmenu_qt_VERSION ${appmenu_qt_VERSION_MAJOR}.${appmenu_qt_VERSION_MINOR}.${appmenu_qt_VERSION_PATCH})
7
8+# Check if we want to explicitly select the Qt version to be used or autodetect
9+if(NOT USE_QT4 AND NOT USE_QT5)
10+ # Autodetect, prefering Qt5
11+ message(STATUS "Autodetecting Qt version to use")
12+ find_package(Qt5Widgets QUIET)
13+ if (Qt5Widgets_FOUND)
14+ set(USE_QT5 TRUE)
15+ endif()
16+endif()
17+
18 # Packaging
19 set(ARCHIVE_NAME appmenu-qt-${appmenu_qt_VERSION})
20 add_custom_target(dist
21@@ -28,8 +38,16 @@
22
23 # Dependencies
24 find_package(PkgConfig REQUIRED)
25-find_package(Qt4 REQUIRED)
26-pkg_check_modules(DBUSMENUQT REQUIRED dbusmenu-qt>=0.9.0)
27+if(USE_QT5)
28+ find_package(Qt5Widgets REQUIRED)
29+ find_package(Qt5Core REQUIRED)
30+ find_package(Qt5DBus REQUIRED)
31+ pkg_check_modules(DBUSMENUQT REQUIRED dbusmenu-qt5>=0.9.0)
32+ add_definitions( -DUSE_QT5 )
33+else()
34+ find_package(Qt4 REQUIRED)
35+ pkg_check_modules(DBUSMENUQT REQUIRED dbusmenu-qt>=0.9.0)
36+endif()
37
38 # Source
39 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Woverloaded-virtual")
40
41=== modified file 'debian/changelog'
42--- debian/changelog 2013-01-18 02:00:49 +0000
43+++ debian/changelog 2013-03-28 19:20:25 +0000
44@@ -1,3 +1,13 @@
45+appmenu-qt (0.2.7daily13.01.18-0ubuntu2) UNRELEASED; urgency=low
46+
47+ * debian/control:
48+ - Add the appmenu-qt5 package for Qt5 appmenu support
49+ * debian/rules:
50+ - Enable a double build - first build a Qt4 version of appmenu for
51+ appmenu-qt and then a Qt5 version for appmenu-qt5
52+
53+ -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com> Wed, 27 Mar 2013 19:54:44 +0100
54+
55 appmenu-qt (0.2.7daily13.01.18-0ubuntu1) raring; urgency=low
56
57 * Automatic snapshot from revision 53
58
59=== modified file 'debian/control'
60--- debian/control 2012-11-22 18:19:57 +0000
61+++ debian/control 2013-03-28 19:20:25 +0000
62@@ -6,7 +6,9 @@
63 Uploaders: Ritesh Raj Sarraf <rrs@debian.org>
64 Build-Depends: cmake,
65 debhelper (>= 9),
66- libdbusmenu-qt-dev (>= 0.9.0),
67+ libdbusmenu-qt-dev,
68+ libdbusmenu-qt5-dev,
69+ qtbase5-dev (>= 5.0.1+dfsg-0ubuntu4~),
70 libqt4-dev (>= 4:4.8),
71 pkg-config,
72 Standards-Version: 3.9.3
73@@ -14,6 +16,7 @@
74 # If you aren't ~indicator-applet-developers but need to upload packaging changes,
75 # just go ahead. ~indicator-applet-developers will notice and sync up the code again.
76 Vcs-Bzr: https://code.launchpad.net/~indicator-applet-developers/appmenu-qt/trunk
77+Vcs-Browser: https://code.launchpad.net/~indicator-applet-developers/appmenu-qt/trunk/files
78
79 Package: appmenu-qt
80 Architecture: any
81@@ -24,3 +27,18 @@
82 global menu bar
83 .
84 appmenu-qt will work for applications designed for Qt and KDE
85+
86+Package: appmenu-qt5
87+Architecture: any
88+Depends: ${misc:Depends},
89+ ${shlibs:Depends},
90+Suggests: libqt5core5,
91+ libqt5dbus5,
92+ libqt5gui5,
93+ libqt5widgets5,
94+Description: application menu for Qt5
95+ appmenu provides you with an integrated application menu in your
96+ global menu bar
97+ .
98+ appmenu-qt5 will work for applications designed for Qt and KDE
99+ This is the Qt5 version
100
101=== modified file 'debian/copyright'
102--- debian/copyright 2012-11-22 17:15:51 +0000
103+++ debian/copyright 2013-03-28 19:20:25 +0000
104@@ -6,7 +6,7 @@
105
106 Files: *
107 Copyright: Aurélien Gâteau <agateau@kde.org>
108-License: LGPL
109+License: LGPL-3
110 This package is free software; you can redistribute it and/or modify
111 it under the terms of the GNU Lesser General Public License version 3, as
112 published by the Free Software Foundation
113@@ -26,7 +26,7 @@
114
115 Files: src/private/qabstractplatformmenubar_p.h patches/qmenubar-plugin-system-4.7.3.diff
116 Copyright: 2010 Nokia Corporation and/or its subsidiary(-ies).
117-License: LGPL
118+License: LGPL-2.1
119 This package is free software; you can redistribute it and/or modify
120 it under the terms of the GNU Lesser General Public License version 2.1, as
121 published by the Free Software Foundation
122@@ -41,11 +41,11 @@
123 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
124 .
125 On Debian systems, the complete text of the GNU General Public License
126- can be found in /usr/share/common-licenses/LGPL-2
127+ can be found in /usr/share/common-licenses/LGPL-2.1
128
129 Files: debian/*
130 Copyright: 2012 Ritesh Raj Sarraf
131-License: GPL
132+License: GPL-2
133 This package is free software; you can redistribute it and/or modify
134 it under the terms of the GNU General Public License version 2, as
135 published by the Free Software Foundation
136@@ -60,4 +60,4 @@
137 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
138 .
139 On Debian systems, the complete text of the GNU General Public License
140- can be found in /usr/share/common-licenses/GPL-3
141+ can be found in /usr/share/common-licenses/GPL-2
142
143=== modified file 'debian/rules'
144--- debian/rules 2012-11-23 16:23:39 +0000
145+++ debian/rules 2013-03-28 19:20:25 +0000
146@@ -7,11 +7,33 @@
147 %:
148 dh $@
149
150+override_dh_auto_configure:
151+ mkdir qt4
152+ mkdir qt5
153+ cd qt4 && QT_SELECT=qt4 cmake -DUSE_QT4=true ../
154+ cd qt5 && QT_SELECT=qt5 cmake -DUSE_QT5=true ../
155+
156+override_dh_auto_build:
157+ cd qt4 && make
158+ cd qt5 && make
159+
160+override_dh_auto_install:
161+ cd qt4 && make DESTDIR=../debian/appmenu-qt install
162+ cd qt5 && make DESTDIR=../debian/appmenu-qt5 install
163+
164 override_dh_installchangelogs:
165 dh_installchangelogs NEWS
166
167 override_dh_makeshlibs:
168- dh_makeshlibs -Xqt4/plugins
169+ dh_makeshlibs -Xqt5/plugins -Xqt4/plugins
170
171 override_dh_install:
172 dh_install --fail-missing
173+
174+override_dh_gencontrol:
175+ # Ugly hack, since we don't want to have Qt5 as our depends, we prefer
176+ # those as Suggests for now
177+ sed -i '/^shlibs/s/libqt5[^,]*, //g' debian/appmenu-qt5.substvars
178+ sed -i '/^shlibs/s/,[^,]* libqt5.*$$//' debian/appmenu-qt5.substvars
179+
180+ dh_gencontrol
181
182=== modified file 'src/CMakeLists.txt'
183--- src/CMakeLists.txt 2013-01-11 15:05:38 +0000
184+++ src/CMakeLists.txt 2013-03-28 19:20:25 +0000
185@@ -1,3 +1,16 @@
186+# Compat variables for plugins.
187+function(_QT5_QUERY_QMAKE VAR RESULT)
188+ get_target_property(QT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} LOCATION)
189+ execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} "-query" ${VAR}
190+ RESULT_VARIABLE return_code
191+ OUTPUT_VARIABLE output)
192+ if(NOT return_code)
193+ file(TO_CMAKE_PATH "${output}" output)
194+ STRING(REGEX REPLACE "(\r?\n)+$" "" output "${output}")
195+ set(${RESULT} ${output} PARENT_SCOPE)
196+ endif(NOT return_code)
197+endfunction(_QT5_QUERY_QMAKE)
198+
199 # Source
200 set(appmenu_qt_SRCS
201 appmenuplatformmenubar.cpp
202@@ -8,18 +21,37 @@
203 ${CMAKE_CURRENT_SOURCE_DIR}
204 ${CMAKE_CURRENT_BINARY_DIR}
205 ${DBUSMENUQT_INCLUDE_DIRS}
206- ${QT_INCLUDE_DIR}
207- ${QT_QTCORE_INCLUDE_DIR}
208- ${QT_QTDBUS_INCLUDE_DIR}
209- ${QT_QTGUI_INCLUDE_DIR}
210- ${QT_QTXML_INCLUDE_DIR}
211 )
212
213-qt4_add_dbus_interface(appmenu_qt_SRCS com.canonical.AppMenu.Registrar.xml
214- registrar)
215-
216-
217-qt4_automoc(${appmenu_qt_SRCS})
218+if(USE_QT5)
219+ include_directories(
220+ ${QT_INCLUDE_DIRS}
221+ ${Qt5Core_INCLUDE_DIRS}
222+ ${Qt5Widgets_INCLUDE_DIRS}
223+ ${Qt5DBus_INCLUDE_DIRS}
224+ ${Qt5Gui_INCLUDE_DIRS}
225+ ${Qt5Xml_INCLUDE_DIRS}
226+ )
227+
228+ qt5_add_dbus_interface(appmenu_qt_SRCS com.canonical.AppMenu.Registrar.xml
229+ registrar)
230+ set(CMAKE_AUTOMOC TRUE)
231+ # Fetch the Qt5 plugins directory path
232+ _qt5_query_qmake(QT_INSTALL_PLUGINS QT_PLUGINS_DIR)
233+else()
234+ include_directories(
235+ ${QT_INCLUDE_DIR}
236+ ${QT_QTCORE_INCLUDE_DIR}
237+ ${QT_QTDBUS_INCLUDE_DIR}
238+ ${QT_QTGUI_INCLUDE_DIR}
239+ ${QT_QTXML_INCLUDE_DIR}
240+ )
241+
242+ qt4_add_dbus_interface(appmenu_qt_SRCS com.canonical.AppMenu.Registrar.xml
243+ registrar)
244+ qt4_automoc(${appmenu_qt_SRCS})
245+endif()
246+
247
248 link_directories(
249 ${DBUSMENUQT_LIBRARY_DIRS}
250@@ -29,13 +61,24 @@
251 ${appmenu_qt_SRCS}
252 )
253
254-target_link_libraries(appmenu-qt
255- ${DBUSMENUQT_LIBRARIES}
256- ${QT_QTCORE_LIBRARIES}
257- ${QT_QTDBUS_LIBRARIES}
258- ${QT_QTGUI_LIBRARIES}
259- ${QT_QTXML_LIBRARIES}
260- )
261+if(USE_QT5)
262+ target_link_libraries(appmenu-qt
263+ ${DBUSMENUQT_LIBRARIES}
264+ ${Qt5Core_LIBRARIES}
265+ ${Qt5DBus_LIBRARIES}
266+ ${Qt5Widgets_LIBRARIES}
267+ ${Qt5Gui_LIBRARIES}
268+ ${Qt5Xml_LIBRARIES}
269+ )
270+else()
271+ target_link_libraries(appmenu-qt
272+ ${DBUSMENUQT_LIBRARIES}
273+ ${QT_QTCORE_LIBRARIES}
274+ ${QT_QTDBUS_LIBRARIES}
275+ ${QT_QTGUI_LIBRARIES}
276+ ${QT_QTXML_LIBRARIES}
277+ )
278+endif()
279
280 # Install
281 install(TARGETS appmenu-qt
282
283=== modified file 'src/appmenuplatformmenubar.cpp'
284--- src/appmenuplatformmenubar.cpp 2013-01-17 12:53:26 +0000
285+++ src/appmenuplatformmenubar.cpp 2013-03-28 19:20:25 +0000
286@@ -486,7 +486,9 @@
287 return new AppMenuPlatformMenuBar;
288 }
289
290+#ifndef USE_QT5
291 Q_EXPORT_PLUGIN2(appmenuplatformmenubar, AppMenuPlatformMenuBarFactory)
292+#endif
293
294 QT_END_NAMESPACE
295
296
297=== modified file 'src/appmenuplatformmenubar.h'
298--- src/appmenuplatformmenubar.h 2013-01-14 10:44:22 +0000
299+++ src/appmenuplatformmenubar.h 2013-03-28 19:20:25 +0000
300@@ -84,6 +84,11 @@
301 class Q_GUI_EXPORT AppMenuPlatformMenuBarFactory : public QObject, public QPlatformMenuBarFactoryInterface
302 {
303 Q_OBJECT
304+
305+#ifdef USE_QT5
306+ Q_PLUGIN_METADATA(IID QPlatformMenuBarFactoryInterface_iid FILE "appmenuplatformmenubar.json")
307+#endif
308+
309 Q_INTERFACES(QPlatformMenuBarFactoryInterface:QFactoryInterface)
310 public:
311 virtual QAbstractPlatformMenuBar* create();
312
313=== added file 'src/appmenuplatformmenubar.json'
314--- src/appmenuplatformmenubar.json 1970-01-01 00:00:00 +0000
315+++ src/appmenuplatformmenubar.json 2013-03-28 19:20:25 +0000
316@@ -0,0 +1,1 @@
317+{ "Keys": [ "default" ] }

Subscribers

People subscribed via source and target branches