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
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2012-04-05 15:10:00 +0000
+++ CMakeLists.txt 2013-03-28 19:20:25 +0000
@@ -7,6 +7,16 @@
7set(appmenu_qt_VERSION_PATCH 6)7set(appmenu_qt_VERSION_PATCH 6)
8set(appmenu_qt_VERSION ${appmenu_qt_VERSION_MAJOR}.${appmenu_qt_VERSION_MINOR}.${appmenu_qt_VERSION_PATCH})8set(appmenu_qt_VERSION ${appmenu_qt_VERSION_MAJOR}.${appmenu_qt_VERSION_MINOR}.${appmenu_qt_VERSION_PATCH})
99
10# Check if we want to explicitly select the Qt version to be used or autodetect
11if(NOT USE_QT4 AND NOT USE_QT5)
12 # Autodetect, prefering Qt5
13 message(STATUS "Autodetecting Qt version to use")
14 find_package(Qt5Widgets QUIET)
15 if (Qt5Widgets_FOUND)
16 set(USE_QT5 TRUE)
17 endif()
18endif()
19
10# Packaging20# Packaging
11set(ARCHIVE_NAME appmenu-qt-${appmenu_qt_VERSION})21set(ARCHIVE_NAME appmenu-qt-${appmenu_qt_VERSION})
12add_custom_target(dist22add_custom_target(dist
@@ -28,8 +38,16 @@
2838
29# Dependencies39# Dependencies
30find_package(PkgConfig REQUIRED)40find_package(PkgConfig REQUIRED)
31find_package(Qt4 REQUIRED)41if(USE_QT5)
32pkg_check_modules(DBUSMENUQT REQUIRED dbusmenu-qt>=0.9.0)42 find_package(Qt5Widgets REQUIRED)
43 find_package(Qt5Core REQUIRED)
44 find_package(Qt5DBus REQUIRED)
45 pkg_check_modules(DBUSMENUQT REQUIRED dbusmenu-qt5>=0.9.0)
46 add_definitions( -DUSE_QT5 )
47else()
48 find_package(Qt4 REQUIRED)
49 pkg_check_modules(DBUSMENUQT REQUIRED dbusmenu-qt>=0.9.0)
50endif()
3351
34# Source52# Source
35set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Woverloaded-virtual")53set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Woverloaded-virtual")
3654
=== modified file 'debian/changelog'
--- debian/changelog 2013-01-18 02:00:49 +0000
+++ debian/changelog 2013-03-28 19:20:25 +0000
@@ -1,3 +1,13 @@
1appmenu-qt (0.2.7daily13.01.18-0ubuntu2) UNRELEASED; urgency=low
2
3 * debian/control:
4 - Add the appmenu-qt5 package for Qt5 appmenu support
5 * debian/rules:
6 - Enable a double build - first build a Qt4 version of appmenu for
7 appmenu-qt and then a Qt5 version for appmenu-qt5
8
9 -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com> Wed, 27 Mar 2013 19:54:44 +0100
10
1appmenu-qt (0.2.7daily13.01.18-0ubuntu1) raring; urgency=low11appmenu-qt (0.2.7daily13.01.18-0ubuntu1) raring; urgency=low
212
3 * Automatic snapshot from revision 5313 * Automatic snapshot from revision 53
414
=== modified file 'debian/control'
--- debian/control 2012-11-22 18:19:57 +0000
+++ debian/control 2013-03-28 19:20:25 +0000
@@ -6,7 +6,9 @@
6Uploaders: Ritesh Raj Sarraf <rrs@debian.org>6Uploaders: Ritesh Raj Sarraf <rrs@debian.org>
7Build-Depends: cmake,7Build-Depends: cmake,
8 debhelper (>= 9),8 debhelper (>= 9),
9 libdbusmenu-qt-dev (>= 0.9.0),9 libdbusmenu-qt-dev,
10 libdbusmenu-qt5-dev,
11 qtbase5-dev (>= 5.0.1+dfsg-0ubuntu4~),
10 libqt4-dev (>= 4:4.8),12 libqt4-dev (>= 4:4.8),
11 pkg-config,13 pkg-config,
12Standards-Version: 3.9.314Standards-Version: 3.9.3
@@ -14,6 +16,7 @@
14# If you aren't ~indicator-applet-developers but need to upload packaging changes,16# If you aren't ~indicator-applet-developers but need to upload packaging changes,
15# just go ahead. ~indicator-applet-developers will notice and sync up the code again.17# just go ahead. ~indicator-applet-developers will notice and sync up the code again.
16Vcs-Bzr: https://code.launchpad.net/~indicator-applet-developers/appmenu-qt/trunk18Vcs-Bzr: https://code.launchpad.net/~indicator-applet-developers/appmenu-qt/trunk
19Vcs-Browser: https://code.launchpad.net/~indicator-applet-developers/appmenu-qt/trunk/files
1720
18Package: appmenu-qt21Package: appmenu-qt
19Architecture: any22Architecture: any
@@ -24,3 +27,18 @@
24 global menu bar27 global menu bar
25 .28 .
26 appmenu-qt will work for applications designed for Qt and KDE29 appmenu-qt will work for applications designed for Qt and KDE
30
31Package: appmenu-qt5
32Architecture: any
33Depends: ${misc:Depends},
34 ${shlibs:Depends},
35Suggests: libqt5core5,
36 libqt5dbus5,
37 libqt5gui5,
38 libqt5widgets5,
39Description: application menu for Qt5
40 appmenu provides you with an integrated application menu in your
41 global menu bar
42 .
43 appmenu-qt5 will work for applications designed for Qt and KDE
44 This is the Qt5 version
2745
=== modified file 'debian/copyright'
--- debian/copyright 2012-11-22 17:15:51 +0000
+++ debian/copyright 2013-03-28 19:20:25 +0000
@@ -6,7 +6,7 @@
66
7Files: *7Files: *
8Copyright: Aurélien Gâteau <agateau@kde.org>8Copyright: Aurélien Gâteau <agateau@kde.org>
9License: LGPL9License: LGPL-3
10 This package is free software; you can redistribute it and/or modify10 This package is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License version 3, as11 it under the terms of the GNU Lesser General Public License version 3, as
12 published by the Free Software Foundation12 published by the Free Software Foundation
@@ -26,7 +26,7 @@
2626
27Files: src/private/qabstractplatformmenubar_p.h patches/qmenubar-plugin-system-4.7.3.diff27Files: src/private/qabstractplatformmenubar_p.h patches/qmenubar-plugin-system-4.7.3.diff
28Copyright: 2010 Nokia Corporation and/or its subsidiary(-ies).28Copyright: 2010 Nokia Corporation and/or its subsidiary(-ies).
29License: LGPL29License: LGPL-2.1
30 This package is free software; you can redistribute it and/or modify30 This package is free software; you can redistribute it and/or modify
31 it under the terms of the GNU Lesser General Public License version 2.1, as31 it under the terms of the GNU Lesser General Public License version 2.1, as
32 published by the Free Software Foundation32 published by the Free Software Foundation
@@ -41,11 +41,11 @@
41 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA41 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
42 .42 .
43 On Debian systems, the complete text of the GNU General Public License43 On Debian systems, the complete text of the GNU General Public License
44 can be found in /usr/share/common-licenses/LGPL-244 can be found in /usr/share/common-licenses/LGPL-2.1
4545
46Files: debian/*46Files: debian/*
47Copyright: 2012 Ritesh Raj Sarraf47Copyright: 2012 Ritesh Raj Sarraf
48License: GPL48License: GPL-2
49 This package is free software; you can redistribute it and/or modify49 This package is free software; you can redistribute it and/or modify
50 it under the terms of the GNU General Public License version 2, as50 it under the terms of the GNU General Public License version 2, as
51 published by the Free Software Foundation51 published by the Free Software Foundation
@@ -60,4 +60,4 @@
60 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA60 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
61 .61 .
62 On Debian systems, the complete text of the GNU General Public License62 On Debian systems, the complete text of the GNU General Public License
63 can be found in /usr/share/common-licenses/GPL-363 can be found in /usr/share/common-licenses/GPL-2
6464
=== modified file 'debian/rules'
--- debian/rules 2012-11-23 16:23:39 +0000
+++ debian/rules 2013-03-28 19:20:25 +0000
@@ -7,11 +7,33 @@
7%:7%:
8 dh $@8 dh $@
99
10override_dh_auto_configure:
11 mkdir qt4
12 mkdir qt5
13 cd qt4 && QT_SELECT=qt4 cmake -DUSE_QT4=true ../
14 cd qt5 && QT_SELECT=qt5 cmake -DUSE_QT5=true ../
15
16override_dh_auto_build:
17 cd qt4 && make
18 cd qt5 && make
19
20override_dh_auto_install:
21 cd qt4 && make DESTDIR=../debian/appmenu-qt install
22 cd qt5 && make DESTDIR=../debian/appmenu-qt5 install
23
10override_dh_installchangelogs:24override_dh_installchangelogs:
11 dh_installchangelogs NEWS25 dh_installchangelogs NEWS
1226
13override_dh_makeshlibs:27override_dh_makeshlibs:
14 dh_makeshlibs -Xqt4/plugins28 dh_makeshlibs -Xqt5/plugins -Xqt4/plugins
1529
16override_dh_install:30override_dh_install:
17 dh_install --fail-missing31 dh_install --fail-missing
32
33override_dh_gencontrol:
34 # Ugly hack, since we don't want to have Qt5 as our depends, we prefer
35 # those as Suggests for now
36 sed -i '/^shlibs/s/libqt5[^,]*, //g' debian/appmenu-qt5.substvars
37 sed -i '/^shlibs/s/,[^,]* libqt5.*$$//' debian/appmenu-qt5.substvars
38
39 dh_gencontrol
1840
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2013-01-11 15:05:38 +0000
+++ src/CMakeLists.txt 2013-03-28 19:20:25 +0000
@@ -1,3 +1,16 @@
1# Compat variables for plugins.
2function(_QT5_QUERY_QMAKE VAR RESULT)
3 get_target_property(QT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} LOCATION)
4 execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} "-query" ${VAR}
5 RESULT_VARIABLE return_code
6 OUTPUT_VARIABLE output)
7 if(NOT return_code)
8 file(TO_CMAKE_PATH "${output}" output)
9 STRING(REGEX REPLACE "(\r?\n)+$" "" output "${output}")
10 set(${RESULT} ${output} PARENT_SCOPE)
11 endif(NOT return_code)
12endfunction(_QT5_QUERY_QMAKE)
13
1# Source14# Source
2set(appmenu_qt_SRCS15set(appmenu_qt_SRCS
3 appmenuplatformmenubar.cpp16 appmenuplatformmenubar.cpp
@@ -8,18 +21,37 @@
8 ${CMAKE_CURRENT_SOURCE_DIR}21 ${CMAKE_CURRENT_SOURCE_DIR}
9 ${CMAKE_CURRENT_BINARY_DIR}22 ${CMAKE_CURRENT_BINARY_DIR}
10 ${DBUSMENUQT_INCLUDE_DIRS}23 ${DBUSMENUQT_INCLUDE_DIRS}
11 ${QT_INCLUDE_DIR}
12 ${QT_QTCORE_INCLUDE_DIR}
13 ${QT_QTDBUS_INCLUDE_DIR}
14 ${QT_QTGUI_INCLUDE_DIR}
15 ${QT_QTXML_INCLUDE_DIR}
16 )24 )
1725
18qt4_add_dbus_interface(appmenu_qt_SRCS com.canonical.AppMenu.Registrar.xml26if(USE_QT5)
19 registrar)27 include_directories(
2028 ${QT_INCLUDE_DIRS}
2129 ${Qt5Core_INCLUDE_DIRS}
22qt4_automoc(${appmenu_qt_SRCS})30 ${Qt5Widgets_INCLUDE_DIRS}
31 ${Qt5DBus_INCLUDE_DIRS}
32 ${Qt5Gui_INCLUDE_DIRS}
33 ${Qt5Xml_INCLUDE_DIRS}
34 )
35
36 qt5_add_dbus_interface(appmenu_qt_SRCS com.canonical.AppMenu.Registrar.xml
37 registrar)
38 set(CMAKE_AUTOMOC TRUE)
39 # Fetch the Qt5 plugins directory path
40 _qt5_query_qmake(QT_INSTALL_PLUGINS QT_PLUGINS_DIR)
41else()
42 include_directories(
43 ${QT_INCLUDE_DIR}
44 ${QT_QTCORE_INCLUDE_DIR}
45 ${QT_QTDBUS_INCLUDE_DIR}
46 ${QT_QTGUI_INCLUDE_DIR}
47 ${QT_QTXML_INCLUDE_DIR}
48 )
49
50 qt4_add_dbus_interface(appmenu_qt_SRCS com.canonical.AppMenu.Registrar.xml
51 registrar)
52 qt4_automoc(${appmenu_qt_SRCS})
53endif()
54
2355
24link_directories(56link_directories(
25 ${DBUSMENUQT_LIBRARY_DIRS}57 ${DBUSMENUQT_LIBRARY_DIRS}
@@ -29,13 +61,24 @@
29 ${appmenu_qt_SRCS}61 ${appmenu_qt_SRCS}
30 )62 )
3163
32target_link_libraries(appmenu-qt64if(USE_QT5)
33 ${DBUSMENUQT_LIBRARIES}65 target_link_libraries(appmenu-qt
34 ${QT_QTCORE_LIBRARIES}66 ${DBUSMENUQT_LIBRARIES}
35 ${QT_QTDBUS_LIBRARIES}67 ${Qt5Core_LIBRARIES}
36 ${QT_QTGUI_LIBRARIES}68 ${Qt5DBus_LIBRARIES}
37 ${QT_QTXML_LIBRARIES}69 ${Qt5Widgets_LIBRARIES}
38 )70 ${Qt5Gui_LIBRARIES}
71 ${Qt5Xml_LIBRARIES}
72 )
73else()
74 target_link_libraries(appmenu-qt
75 ${DBUSMENUQT_LIBRARIES}
76 ${QT_QTCORE_LIBRARIES}
77 ${QT_QTDBUS_LIBRARIES}
78 ${QT_QTGUI_LIBRARIES}
79 ${QT_QTXML_LIBRARIES}
80 )
81endif()
3982
40# Install83# Install
41install(TARGETS appmenu-qt84install(TARGETS appmenu-qt
4285
=== modified file 'src/appmenuplatformmenubar.cpp'
--- src/appmenuplatformmenubar.cpp 2013-01-17 12:53:26 +0000
+++ src/appmenuplatformmenubar.cpp 2013-03-28 19:20:25 +0000
@@ -486,7 +486,9 @@
486 return new AppMenuPlatformMenuBar;486 return new AppMenuPlatformMenuBar;
487}487}
488488
489#ifndef USE_QT5
489Q_EXPORT_PLUGIN2(appmenuplatformmenubar, AppMenuPlatformMenuBarFactory)490Q_EXPORT_PLUGIN2(appmenuplatformmenubar, AppMenuPlatformMenuBarFactory)
491#endif
490492
491QT_END_NAMESPACE493QT_END_NAMESPACE
492494
493495
=== modified file 'src/appmenuplatformmenubar.h'
--- src/appmenuplatformmenubar.h 2013-01-14 10:44:22 +0000
+++ src/appmenuplatformmenubar.h 2013-03-28 19:20:25 +0000
@@ -84,6 +84,11 @@
84class Q_GUI_EXPORT AppMenuPlatformMenuBarFactory : public QObject, public QPlatformMenuBarFactoryInterface84class Q_GUI_EXPORT AppMenuPlatformMenuBarFactory : public QObject, public QPlatformMenuBarFactoryInterface
85{85{
86 Q_OBJECT86 Q_OBJECT
87
88#ifdef USE_QT5
89 Q_PLUGIN_METADATA(IID QPlatformMenuBarFactoryInterface_iid FILE "appmenuplatformmenubar.json")
90#endif
91
87 Q_INTERFACES(QPlatformMenuBarFactoryInterface:QFactoryInterface)92 Q_INTERFACES(QPlatformMenuBarFactoryInterface:QFactoryInterface)
88public:93public:
89 virtual QAbstractPlatformMenuBar* create();94 virtual QAbstractPlatformMenuBar* create();
9095
=== added file 'src/appmenuplatformmenubar.json'
--- src/appmenuplatformmenubar.json 1970-01-01 00:00:00 +0000
+++ src/appmenuplatformmenubar.json 2013-03-28 19:20:25 +0000
@@ -0,0 +1,1 @@
1{ "Keys": [ "default" ] }

Subscribers

People subscribed via source and target branches