Merge lp:~achiang/telegram-app/libqtelegram-click-prep-2 into lp:telegram-app/app

Proposed by Alex Chiang
Status: Merged
Merged at revision: 22
Proposed branch: lp:~achiang/telegram-app/libqtelegram-click-prep-2
Merge into: lp:telegram-app/app
Prerequisite: lp:~achiang/telegram-app/libqtelegram-click-prep-1
Diff against target: 278 lines (+54/-55)
12 files modified
CMakeLists.txt (+25/-15)
README.org (+4/-0)
build.sh (+2/-8)
click.sh (+16/-18)
deps.sh (+1/-1)
manifest.json.in (+1/-2)
run.sh (+1/-1)
telegram.json (+0/-6)
telegram.qml (+1/-1)
ui/ContactsPage.qml (+1/-1)
ui/DialogPage.qml (+1/-1)
ui/DialogsPage.qml (+1/-1)
To merge this branch: bzr merge lp:~achiang/telegram-app/libqtelegram-click-prep-2
Reviewer Review Type Date Requested Status
Michał Karnicki (community) Approve
Review via email: mp+228975@code.launchpad.net

Description of the change

With this MP, we now have click packaging working 100% from the command line and *mostly* from the IDE. You can push the resulting click to the phone, install it, and launch it. It will get through a few screens before it crashes.

If you attempt from the IDE, you will get garbage. Not sure why that is yet, still debugging there...

There are lots and lots of commits in here; please read the individual commit logs to get a sense for the evolution.

To post a comment you must log in.
34. By Alex Chiang

deps.sh: fix merge conflict

35. By Alex Chiang

Fix merge conflicts

36. By Alex Chiang

CMakeLists.txt: ensure ui/ and js/ are copied during installation

Revision history for this message
Alex Chiang (achiang) wrote :

Note -- after merging with latest trunk, the app fails to start again. :( But I verified that reverting the merge with latest trunk, the app can still start.

So -- my request is that we just land this (modulo review comments) and iterate debugging why latest version crashes.

Revision history for this message
Alex Chiang (achiang) wrote :

Ah, ok. Latest merge causes crashers because qml-module-qt-labs-settings is not installed in the image.

I installed it as root, but for the general case, this might be a problem...

Revision history for this message
Michał Karnicki (karni) wrote :

Left minor in-line comments.

Regarding qml-module-qt-labs-settings -- let's verify if this will get into the image. If not, we can switch to using U1db, which should be rather easy/quick. (Too bad, the labs settings were very convenient to use.)

The app builds correctly, tested with the click package received in the mail.
(Most importantly, the app boots, I didn't see anything on the dialogs list, but that is not related to this MP. Contacts list works fine.)

review: Approve

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-07-15 23:03:19 +0000
3+++ CMakeLists.txt 2014-07-31 03:01:55 +0000
4@@ -9,13 +9,13 @@
5
6 # Sets BZR_REVNO
7 execute_process(
8- COMMAND bzr revno
9+ COMMAND bzr revno ${CMAKE_SOURCE_DIR}
10 OUTPUT_VARIABLE BZR_REVNO
11 OUTPUT_STRIP_TRAILING_WHITESPACE
12 )
13 # Sets VERSION_TAG
14 execute_process(
15- COMMAND bzr tags
16+ COMMAND bzr tags -d ${CMAKE_SOURCE_DIR}
17 COMMAND tail -n1
18 COMMAND tr -s " "
19 COMMAND cut -d " " -f1
20@@ -24,7 +24,7 @@
21 )
22 # Sets VERSION_REV
23 execute_process(
24- COMMAND bzr tags
25+ COMMAND bzr tags -d ${CMAKE_SOURCE_DIR}
26 COMMAND tail -n1
27 COMMAND tr -s " "
28 COMMAND cut -d " " -f2
29@@ -38,10 +38,10 @@
30 # Semantic versioning.
31 set(APP_VERSION "${VERSION_TAG}+${VERSION_REV}")
32 message("-- app version: ${APP_VERSION}")
33-set(APP_ICON "telegram.png")
34+set(APP_ICON "images/telegram.png")
35
36 execute_process(
37- COMMAND dpkg-architecture -qDEB_BUILD_ARCH
38+ COMMAND dpkg-architecture -qDEB_HOST_ARCH
39 OUTPUT_VARIABLE ARCH
40 OUTPUT_STRIP_TRAILING_WHITESPACE
41 )
42@@ -52,7 +52,7 @@
43 )
44
45 set(ARCHITECTURE "${ARCH}")
46-set(FRAMEWORK "ubuntu-sdk-14.10-qml-dev3")
47+set(FRAMEWORK "ubuntu-sdk-14.10-dev2")
48
49 set(MAIN_QML "${APP_NAME}.qml")
50 set(DESKTOP_FILE "${APP_NAME}.desktop")
51@@ -78,9 +78,9 @@
52 set(CMAKE_INSTALL_BINDIR /)
53 set(DATA_DIR /)
54 set(ICON ".${DATA_DIR}/${APP_ICON}")
55- set(EXEC "qmlscene $@ -I .${QT_IMPORTS_DIR} ${MAIN_QML}")
56- set(DESKTOP_DIR ${DATA_DIR})
57- set(URLS_DIR ${DATA_DIR})
58+ set(EXEC "qmlscene $@ ${MAIN_QML}")
59+ set(DESKTOP_DIR ${CMAKE_INSTALL_PREFIX})
60+# set(URLS_DIR ${CMAKE_INSTALL_PREFIX})
61 else()
62 set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_NAME})
63 configure_file(${APP_NAME}.in
64@@ -90,7 +90,7 @@
65 set(ICON ${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON_FILE})
66 set(EXEC ${APP_NAME})
67 set(DESKTOP_DIR ${CMAKE_INSTALL_DATADIR}/applications)
68- set(URLS_DIR ${CMAKE_INSTALL_DATADIR}/url-dispatcher/urls)
69+# set(URLS_DIR ${CMAKE_INSTALL_DATADIR}/url-dispatcher/urls)
70 endif()
71
72 configure_file(
73@@ -125,11 +125,21 @@
74 #endforeach(LINE)
75
76 install(
77- FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}
78+ FILES ${CMAKE_CURRENT_SOURCE_DIR}/${DESKTOP_FILE}
79 DESTINATION ${DESKTOP_DIR}
80 )
81-install(
82- FILES ${URLS_FILE}
83- DESTINATION ${URLS_DIR}
84-)
85+#install(
86+# FILES ${URLS_FILE}
87+# DESTINATION ${URLS_DIR}
88+#)
89+install(FILES manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX})
90+install(FILES "apparmor.json" DESTINATION ${DATA_DIR})
91+install(DIRECTORY "images" DESTINATION ${DATA_DIR})
92+install(DIRECTORY "ui" DESTINATION ${DATA_DIR})
93+install(DIRECTORY "js" DESTINATION ${DATA_DIR})
94
95+# Ensure all source files appear in QtCreator's UI
96+add_subdirectory(library)
97+add_subdirectory(components)
98+file(GLOB QML_JS_FILES *.qml *.js ui/*.qml js/*.js)
99+add_custom_target(QML_JS_TARGET ALL SOURCES ${QML_JS_FILES})
100
101=== modified file 'README.org'
102--- README.org 2014-07-17 20:28:07 +0000
103+++ README.org 2014-07-31 03:01:55 +0000
104@@ -43,3 +43,7 @@
105 ** TODO Decide if we use i18n.tr() or qsTr() for translation.
106 ** TODO Could we get rid of qtmultimedia5-dev build-dep?
107
108+Building in the IDE
109+* be sure to import CMakeLists.txt and not the qmlproject
110+* "maintain" the armhf chroot and install bzr libssl-dev:armhf libsqlite3-dev:armhf
111+* add -DCLICK_MODE=on as a cmake command line arg
112
113=== modified file 'build.sh'
114--- build.sh 2014-07-22 05:32:18 +0000
115+++ build.sh 2014-07-31 03:01:55 +0000
116@@ -33,15 +33,9 @@
117 # ignore consoletelegram and uitest
118 sed '/\(add_subdirectory(consoletelegram)\|add_subdirectory(uitest)\)/d' ./CMakeLists.txt > tmp.txt
119 mv tmp.txt CMakeLists.txt
120-mkdir -p build && cd build
121-cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib/$ARCH_TRIPLET
122-make
123
124 cd ..
125
126-if [ "$#" -eq 1 ]; then
127- rm -rf build
128-fi
129-
130+rm -rf build
131 mkdir -p build && cd build
132-cmake .. && make
133+cmake .. -DCLICK_MODE=1 && make
134
135=== modified file 'click.sh'
136--- click.sh 2014-07-15 23:03:19 +0000
137+++ click.sh 2014-07-31 03:01:55 +0000
138@@ -8,23 +8,21 @@
139
140 rm -rf click
141 mkdir -p click
142-mkdir -p click/lib/$ARCH
143-
144-cp build/manifest.json click/
145-cp build/telegram.desktop click/
146-cp -r build/modules/* click/lib/$ARCH_TRIPLET/
147-
148-cp telegram.json click/
149+mkdir -p click/lib/$ARCH_TRIPLET
150+
151+cp manifest.json click/
152+cp telegram.desktop click/
153+
154+cp -a build/library/lib/libqtelegram.so* click/lib/$ARCH_TRIPLET
155+cp -a build/library/qmlplugin/Telegram click/lib/$ARCH_TRIPLET
156+
157+cp apparmor.json click/
158 cp telegram.qml click/
159-cp -r components click/
160-cp -r images click/
161-cp -r ui click/
162+cp telegram.pub click/
163+cp -a components click/
164+cp -a images click/
165+cp -a ui click/
166+cp -a js click/
167
168-if [ $ARCH = "armhf" ]; then
169- echo "Building and installing click package."
170- click build ./click
171- pkcon install-local *.click
172- echo "Done."
173-else
174- echo "Done."
175-fi
176+echo "Building and installing click package."
177+click build ./click
178
179=== modified file 'deps.sh'
180--- deps.sh 2014-07-29 16:28:13 +0000
181+++ deps.sh 2014-07-31 03:01:55 +0000
182@@ -1,3 +1,3 @@
183 #!/bin/bash
184
185-apt-get -y install build-essential cmake pkg-config libssl-dev qt5-default qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev libsqlite3-dev qtdeclarative5-ubuntu-telephony-phonenumber0.1 python3-simplejson qml-module-qt-labs-settings
186+apt-get -y install build-essential cmake pkg-config libssl-dev qt5-default qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev libsqlite3-dev qtdeclarative5-ubuntu-telephony-phonenumber0.1 python3-simplejson qml-module-qt-labs-settings bzr
187
188=== modified file 'images/telegram.png'
189Binary files images/telegram.png 2014-07-15 23:03:19 +0000 and images/telegram.png 2014-07-31 03:01:55 +0000 differ
190=== modified file 'manifest.json.in'
191--- manifest.json.in 2014-07-15 23:03:19 +0000
192+++ manifest.json.in 2014-07-31 03:01:55 +0000
193@@ -8,8 +8,7 @@
194 "hooks": {
195 "@APP_NAME@": {
196 "apparmor": "apparmor.json",
197- "desktop": "@APP_NAME@.desktop",
198- "urls": "@APP_NAME@.url-dispatcher"
199+ "desktop": "@APP_NAME@.desktop"
200 }
201 },
202 "icon": "@APP_ICON@",
203
204=== modified file 'run.sh'
205--- run.sh 2014-07-18 22:46:26 +0000
206+++ run.sh 2014-07-31 03:01:55 +0000
207@@ -1,6 +1,6 @@
208 #!/bin/bash
209
210-LIBDIR="library/build/qmlplugin"
211+LIBDIR="build/library/qmlplugin"
212 if [ ! -d "$LIBDIR" ]; then
213 echo "Library not present. Invoke ./getlib.sh first."
214 exit -1
215
216=== removed file 'telegram.json'
217--- telegram.json 2014-07-15 23:03:19 +0000
218+++ telegram.json 1970-01-01 00:00:00 +0000
219@@ -1,6 +0,0 @@
220-{
221- "policy_groups": [
222- "networking"
223- ],
224- "policy_version": 1.2
225-}
226\ No newline at end of file
227
228=== modified file 'telegram.qml'
229--- telegram.qml 2014-07-29 17:07:46 +0000
230+++ telegram.qml 2014-07-31 03:01:55 +0000
231@@ -1,7 +1,7 @@
232 import QtQuick 2.0
233 import Qt.labs.settings 1.0
234 import Ubuntu.Components 1.1
235-import Ubuntu.Plugins.Telegram 0.1
236+import Telegram 0.1
237 import "ui"
238
239 MainView {
240
241=== modified file 'ui/ContactsPage.qml'
242--- ui/ContactsPage.qml 2014-07-30 16:54:56 +0000
243+++ ui/ContactsPage.qml 2014-07-31 03:01:55 +0000
244@@ -3,7 +3,7 @@
245 import "../components"
246 import "../components/listitems"
247 import "../js/time.js" as Time
248-import Ubuntu.Plugins.Telegram 0.1
249+import Telegram 0.1
250
251 TelegramPage {
252 title: i18n.tr('Contacts');
253
254=== modified file 'ui/DialogPage.qml'
255--- ui/DialogPage.qml 2014-07-29 17:07:46 +0000
256+++ ui/DialogPage.qml 2014-07-31 03:01:55 +0000
257@@ -1,7 +1,7 @@
258 import QtQuick 2.0
259 import Ubuntu.Components 0.1
260 import "../components"
261-import Ubuntu.Plugins.Telegram 0.1
262+import Telegram 0.1
263
264 TelegramPage {
265 id: page
266
267=== modified file 'ui/DialogsPage.qml'
268--- ui/DialogsPage.qml 2014-07-30 16:54:56 +0000
269+++ ui/DialogsPage.qml 2014-07-31 03:01:55 +0000
270@@ -4,7 +4,7 @@
271 import "../components"
272 import "../components/listitems"
273 import "../js/time.js" as Time
274-import Ubuntu.Plugins.Telegram 0.1
275+import Telegram 0.1
276
277 TelegramPage {
278 title: i18n.tr('Telegram');

Subscribers

People subscribed via source and target branches

to all changes: