Merge lp:~sergiusens/ubuntu-clock-app/reboot-packaging into lp:~dholbach/ubuntu-clock-app/reboot-packaging

Proposed by Sergio Schvezov on 2014-08-07
Status: Merged
Merged at revision: 60
Proposed branch: lp:~sergiusens/ubuntu-clock-app/reboot-packaging
Merge into: lp:~dholbach/ubuntu-clock-app/reboot-packaging
Diff against target: 221 lines (+50/-62)
10 files modified
CMakeLists.txt (+18/-24)
app/CMakeLists.txt (+11/-5)
app/alarm/CMakeLists.txt (+1/-1)
app/clock/CMakeLists.txt (+1/-1)
app/components/CMakeLists.txt (+1/-1)
app/graphics/CMakeLists.txt (+5/-3)
app/worldclock/CMakeLists.txt (+1/-1)
backend/CMakeLists.txt (+10/-8)
cmake/Click.cmake (+0/-17)
manifest.json (+2/-1)
To merge this branch: bzr merge lp:~sergiusens/ubuntu-clock-app/reboot-packaging
Reviewer Review Type Date Requested Status
Nekhelesh Ramananthan (community) 2014-08-07 Needs Information on 2014-08-07
Daniel Holbach 2014-08-07 Pending
Ubuntu Phone Apps Jenkins Bot continuous-integration 2014-08-07 Pending
Review via email: mp+230013@code.launchpad.net

This proposal supersedes a proposal from 2014-08-07.

Description of the change

Changes:
- used a proper qt_imports_dir (still needs qml import updates).
- moved gnuinstalldirs higher up for better path management
- removed a bunch of very custom variables and build on top
- removed the install target for the gallery directory as it was a dup and going to the wrong path
- not installing icon for deb and just rely on us using the desktop default (we can depend on the suru icon set, it's there)
- made some rules filter out if not in qtcreator
- I've changed the path for a couple of things to use common subpaths in most cases, it may break some of your scenarios.

TODOs:
- change qml imports
- test (I haven't touched anything autopilot)

I hope this unblocks you guys

To post a comment you must log in.
review: Needs Fixing (continuous-integration)
Nekhelesh Ramananthan (nik90) wrote :

- change qml imports

What do you mean by this? Does this mean "import Alarm.Settings 1.0" in the qml code will change to something else?

- I've changed the path for a couple of things to use common subpaths in most cases, it may break some of your scenarios.

Not exactly sure what you mean by scenarios.

review: Needs Information
Sergio Schvezov (sergiusens) wrote :

On Thu, Aug 7, 2014 at 7:34 PM, Nekhelesh Ramananthan <<email address hidden>
> wrote:

> Review: Needs Information
>
> - change qml imports
>
> What do you mean by this? Does this mean "import Alarm.Settings 1.0" in
> the qml code will change to something else?
>

Since Daniel mentioned a better location for the libs I appended a Clock.
to the path, so most likely it means you need to prepend this.

>
> - I've changed the path for a couple of things to use common subpaths in
> most cases, it may break some of your scenarios.
>
> Not exactly sure what you mean by scenarios.
>

In other words, needs testing in qt creator

I don't have a full environment with me to test all this; I'll look into
this in the AM

Is this landing into the archives btw?

Nekhelesh Ramananthan (nik90) wrote :

> On Thu, Aug 7, 2014 at 7:34 PM, Nekhelesh Ramananthan <<email address hidden>
> > wrote:
>
> > Review: Needs Information
> >
> > - change qml imports
> >
> > What do you mean by this? Does this mean "import Alarm.Settings 1.0" in
> > the qml code will change to something else?
> >
>
> Since Daniel mentioned a better location for the libs I appended a Clock.
> to the path, so most likely it means you need to prepend this.
>
>

Ah okay. I don't think it will require a prepend since the QMLDir files still state Alarm.Setting or DateTime etc. But I will have to try in the morning to confirm that.

> >
> > - I've changed the path for a couple of things to use common subpaths in
> > most cases, it may break some of your scenarios.
> >
> > Not exactly sure what you mean by scenarios.
> >
>
> In other words, needs testing in qt creator
>
> I don't have a full environment with me to test all this; I'll look into
> this in the AM

Initial run on the device failed as it received a failed event. Again will see in the morning what is the issue.
>
> Is this landing into the archives btw?

We are planning to swap the old clock app with the new clock app (next week) in the default phone images since we are nearly feature complete. This is why I am trying to get the cmake stuff and the debian packaging done asap.

60. By Daniel Holbach on 2014-08-08

* Using GnuInstallDirs takes care of the arch triplet.
* Used a proper qt_imports_dir (still needs qml import updates).
* Moved gnuinstalldirs higher up for better path management.
* Removed a bunch of very custom variables and build on top.
* Removed the install target for the gallery directory as it was a dup
  and going to the wrong path.
* Not installing icon for deb and just rely on us using the desktop
  default (we can depend on the suru icon set, it's there).
* Made some rules filter out if not in qtcreator.
* Changed the path for a couple of things to use common subpaths in most
  cases.

Daniel Holbach (dholbach) wrote :

Thanks a lot. Great work. This almost fixes LP: #1354081 and takes care of LP: #1354082 for good.

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 2014-08-05 07:46:44 +0000
3+++ CMakeLists.txt 2014-08-07 21:06:25 +0000
4@@ -2,7 +2,6 @@
5 cmake_minimum_required(VERSION 2.8.9)
6
7 set (UBUNTU_PROJECT_TYPE "ClickApp" CACHE INTERNAL "Tells QtCreator this is a Click application project")
8-set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
9 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra")
10
11 find_package(Qt5Core)
12@@ -20,38 +19,33 @@
13 set(APP_NAME clock)
14 set(APP_HARDCODE ubuntu-clock-app)
15 set(MAIN_QML ${APP_HARDCODE}.qml)
16-set(ICON clock-app@30.png)
17+set(ICON clock-app)
18+
19+# Standard install paths
20+include(GNUInstallDirs)
21
22 #set install paths
23-if(${CLICK_MODE})
24- set(CMAKE_INSTALL_PREFIX /)
25- set(DATA_DIR /)
26- set(DESKTOP_DIR ${DATA_DIR})
27- set(UBUNTU-CLOCK-APP_DIR "share/qml/ubuntu-clock-app")
28- set(ICON "${UBUNTU-CLOCK-APP_DIR}/${ICON}")
29+if(CLICK_MODE)
30+ set(CMAKE_INSTALL_PREFIX "/")
31+ set(UBUNTU-CLOCK_APP_DIR "${CMAKE_INSTALL_DATADIR}/qml")
32
33- execute_process(
34- COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
35- OUTPUT_VARIABLE ARCH_TRIPLET
36- OUTPUT_STRIP_TRAILING_WHITESPACE
37- )
38- set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}")
39-else()
40- set(DATA_DIR "share/clockapp")
41- set(DESKTOP_DIR ${DATA_DIR})
42- set(ICON "${DATA_DIR}/${ICON}")
43- set(UBUNTU-CLOCK-APP_DIR "share/ubuntu-clock-app/qml")
44- include(GNUInstallDirs)
45 set(QT_IMPORTS_DIR "${CMAKE_INSTALL_LIBDIR}")
46-endif()
47+ set(EXEC "qmlscene $@ ${UBUNTU-CLOCK_APP_DIR}/${MAIN_QML}")
48+else(CLICK_MODE)
49+ set(UBUNTU-CLOCK_APP_DIR "${CMAKE_INSTALL_DATADIR}/ubuntu-clock-app/qml")
50+ execute_process(
51+ COMMAND qmake -query QT_INSTALL_QML
52+ OUTPUT_VARIABLE QT_IMPORTS_DIR
53+ OUTPUT_STRIP_TRAILING_WHITESPACE
54+ )
55
56-set(EXEC "qmlscene $@ ${UBUNTU-CLOCK-APP_DIR}/${MAIN_QML}")
57+ set(EXEC "qmlscene $@ ${CMAKE_INSTALL_DATADIR}/${UBUNTU-CLOCK_APP_DIR}/${MAIN_QML}")
58+endif(CLICK_MODE)
59
60 if(${CLICK_MODE})
61 install(FILES manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX})
62+ install(FILES "${APP_HARDCODE}.json" DESTINATION ${CMAKE_INSTALL_DATADIR})
63 endif()
64-install(DIRECTORY "app/graphics" DESTINATION ${DATA_DIR})
65-install(FILES "${APP_HARDCODE}.json" DESTINATION ${DATA_DIR})
66
67 add_subdirectory(app)
68 add_subdirectory(backend)
69
70=== modified file 'app/CMakeLists.txt'
71--- app/CMakeLists.txt 2014-07-13 11:18:31 +0000
72+++ app/CMakeLists.txt 2014-08-07 21:06:25 +0000
73@@ -1,14 +1,20 @@
74-file(GLOB QML_JS_FILES *.qml *.js *.png)
75-
76-# make the files visible on qtcreator
77+if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
78 add_custom_target(ubuntu-clock-app_QMlFiles ALL SOURCES ${QML_JS_FILES})
79+endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
80+
81+
82+if(CLICK_MODE)
83+ set(ICON "${ICON}@30.png")
84+ install(FILES ${ICON} DESTINATION ${CMAKE_INSTALL_PREFIX})
85+endif(CLICK_MODE)
86
87 # substitute variables in the desktop file
88 set(DESKTOP_FILE "ubuntu-clock-app.desktop")
89 configure_file(${DESKTOP_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE})
90
91-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} DESTINATION ${DESKTOP_DIR})
92-install(FILES ${QML_JS_FILES} DESTINATION ${UBUNTU-CLOCK-APP_DIR})
93+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}
94+ DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
95+install(FILES ${MAIN_QML} DESTINATION ${UBUNTU-CLOCK_APP_DIR})
96
97 add_subdirectory(clock)
98 add_subdirectory(alarm)
99
100=== modified file 'app/alarm/CMakeLists.txt'
101--- app/alarm/CMakeLists.txt 2014-06-16 14:09:12 +0000
102+++ app/alarm/CMakeLists.txt 2014-08-07 21:06:25 +0000
103@@ -3,4 +3,4 @@
104 # make the files visible in the qtcreator tree
105 add_custom_target(ubuntu-clock-app_alarm_QMlFiles ALL SOURCES ${ALARM_QML_JS_FILES})
106
107-install(FILES ${ALARM_QML_JS_FILES} DESTINATION ${UBUNTU-CLOCK-APP_DIR}/alarm)
108+install(FILES ${ALARM_QML_JS_FILES} DESTINATION ${UBUNTU-CLOCK_APP_DIR}/alarm)
109
110=== modified file 'app/clock/CMakeLists.txt'
111--- app/clock/CMakeLists.txt 2014-06-06 18:45:49 +0000
112+++ app/clock/CMakeLists.txt 2014-08-07 21:06:25 +0000
113@@ -3,4 +3,4 @@
114 # make the files visible in the qtcreator tree
115 add_custom_target(ubuntu-clock-app_clock_QMlFiles ALL SOURCES ${CLOCK_QML_JS_FILES})
116
117-install(FILES ${CLOCK_QML_JS_FILES} DESTINATION ${UBUNTU-CLOCK-APP_DIR}/clock)
118+install(FILES ${CLOCK_QML_JS_FILES} DESTINATION ${UBUNTU-CLOCK_APP_DIR}/clock)
119
120=== modified file 'app/components/CMakeLists.txt'
121--- app/components/CMakeLists.txt 2014-06-06 18:45:49 +0000
122+++ app/components/CMakeLists.txt 2014-08-07 21:06:25 +0000
123@@ -3,4 +3,4 @@
124 # make the files visible in the qtcreator tree
125 add_custom_target(ubuntu-clock-app_components_QMlFiles ALL SOURCES ${COMPONENTS_QML_JS_FILES})
126
127-install(FILES ${COMPONENTS_QML_JS_FILES} DESTINATION ${UBUNTU-CLOCK-APP_DIR}/components)
128+install(FILES ${COMPONENTS_QML_JS_FILES} DESTINATION ${UBUNTU-CLOCK_APP_DIR}/components)
129
130=== modified file 'app/graphics/CMakeLists.txt'
131--- app/graphics/CMakeLists.txt 2014-06-06 18:45:49 +0000
132+++ app/graphics/CMakeLists.txt 2014-08-07 21:06:25 +0000
133@@ -1,6 +1,8 @@
134-file(GLOB IMAGES_PNG_FILES *.png *.jpg)
135+file(GLOB GRAPHICS_FILES *.png *.jpg)
136
137 # make the files visible in the qtcreator tree
138-add_custom_target(ubuntu-clock-app_graphics_PNGFiles ALL SOURCES ${IMAGES_PNG_FILES})
139+if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
140+ add_custom_target(ubuntu-clock-app_graphics_PNGFiles ALL SOURCES ${IMAGES_PNG_FILES})
141+endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
142
143-install(FILES ${IMAGES_PNG_FILES} DESTINATION ${UBUNTU-CLOCK-APP_DIR}/graphics)
144+install(FILES ${GRAPHICS_FILES} DESTINATION ${UBUNTU-CLOCK_APP_DIR}/graphics)
145
146=== modified file 'app/worldclock/CMakeLists.txt'
147--- app/worldclock/CMakeLists.txt 2014-07-13 11:18:31 +0000
148+++ app/worldclock/CMakeLists.txt 2014-08-07 21:06:25 +0000
149@@ -3,4 +3,4 @@
150 # make the files visible in the qtcreator tree
151 add_custom_target(ubuntu-clock-app_worldclock_QMlFiles ALL SOURCES ${WORLDCLOCK_QML_JS_FILES})
152
153-install(FILES ${WORLDCLOCK_QML_JS_FILES} DESTINATION ${UBUNTU-CLOCK-APP_DIR}/worldclock)
154+install(FILES ${WORLDCLOCK_QML_JS_FILES} DESTINATION ${UBUNTU-CLOCK_APP_DIR}/worldclock)
155
156=== modified file 'backend/CMakeLists.txt'
157--- backend/CMakeLists.txt 2014-07-26 09:34:15 +0000
158+++ backend/CMakeLists.txt 2014-08-07 21:06:25 +0000
159@@ -66,12 +66,14 @@
160 DEPENDS ${QMLFILES}
161 )
162
163+set(MODULE_PATH ${QT_IMPORTS_DIR}/Clock)
164+
165 # Install plugin file
166-install(TARGETS timezone DESTINATION ${QT_IMPORTS_DIR}/Timezone/)
167-install(FILES modules/Timezone/qmldir DESTINATION ${QT_IMPORTS_DIR}/Timezone/)
168-
169-install(TARGETS datetime DESTINATION ${QT_IMPORTS_DIR}/DateTime/)
170-install(FILES modules/DateTime/qmldir DESTINATION ${QT_IMPORTS_DIR}/DateTime/)
171-
172-install(TARGETS alarmsettings DESTINATION ${QT_IMPORTS_DIR}/Alarm/Settings/)
173-install(FILES modules/Alarm/Settings/qmldir DESTINATION ${QT_IMPORTS_DIR}/Alarm/Settings/)
174+install(TARGETS timezone DESTINATION ${MODULE_PATH}/Timezone/)
175+install(FILES modules/Timezone/qmldir DESTINATION ${MODULE_PATH}/Timezone/)
176+
177+install(TARGETS datetime DESTINATION ${MODULE_PATH}/DateTime/)
178+install(FILES modules/DateTime/qmldir DESTINATION ${MODULE_PATH}/DateTime/)
179+
180+install(TARGETS alarmsettings DESTINATION ${MODULE_PATH}/Alarm/Settings/)
181+install(FILES modules/Alarm/Settings/qmldir DESTINATION ${MODULE_PATH}/Alarm/Settings/)
182
183=== removed directory 'cmake'
184=== removed file 'cmake/Click.cmake'
185--- cmake/Click.cmake 2014-06-06 18:45:49 +0000
186+++ cmake/Click.cmake 1970-01-01 00:00:00 +0000
187@@ -1,17 +0,0 @@
188-if(CLICK_MODE)
189- STRING(REPLACE "/usr/" "/" QT_IMPORTS_DIR ${QT_IMPORTS_DIR})
190- set(CMAKE_INSTALL_PREFIX /)
191- set(CMAKE_INSTALL_BINDIR /)
192- set(DATA_DIR /)
193- set(EXEC "qmlscene $@ -I .${QT_IMPORTS_DIR} ${UBUNTU-CLOCK-APP_DIR}/${MAIN_QML}")
194- set(DESKTOP_DIR ${DATA_DIR})
195- set(ICON ".${DATA_DIR}/${ICON}")
196- install(FILES manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX})
197- install(DIRECTORY "app/graphics" DESTINATION ${DATA_DIR})
198- install(FILES "${CMAKE_PROJECT_NAME}.json" DESTINATION ${DATA_DIR})
199-else(CLICK_MODE)
200- set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_NAME})
201- set(EXEC "qmlscene $@ ${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/qml/${MAIN_QML}")
202- set(ICON "${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON}")
203- set(DESKTOP_DIR ${CMAKE_INSTALL_DATADIR}/applications)
204-endif(CLICK_MODE)
205
206=== modified file 'manifest.json'
207--- manifest.json 2014-07-31 19:33:54 +0000
208+++ manifest.json 2014-08-07 21:06:25 +0000
209@@ -4,10 +4,11 @@
210 "framework": "ubuntu-sdk-14.10-dev2",
211 "architecture": "all",
212 "title": "Clock Reboot",
213+ "icon": "clock@30.png",
214 "hooks": {
215 "ubuntu-clock-app": {
216 "apparmor": "ubuntu-clock-app.json",
217- "desktop": "ubuntu-clock-app.desktop"
218+ "desktop": "share/applications/ubuntu-clock-app.desktop"
219 }
220 },
221 "version": "0.1",

Subscribers

People subscribed via source and target branches