Merge lp:~libqtelegram-team/telegram-app/snap-telegram-app-take3 into lp:telegram-app

Proposed by Roberto Mier Escandon
Status: Merged
Approved by: Jin
Approved revision: 256
Merged at revision: 255
Proposed branch: lp:~libqtelegram-team/telegram-app/snap-telegram-app-take3
Merge into: lp:telegram-app
Diff against target: 281 lines (+200/-2)
9 files modified
README.md (+55/-0)
make-snap.sh (+4/-0)
setup.sh (+1/-1)
setup/gui/telegram-app.desktop (+13/-0)
setup/gui/telegram-app.desktop.in (+13/-0)
snap/telegram-app.wrapper (+17/-0)
snapcraft.yaml (+91/-0)
telegram/app/app.pro (+1/-1)
telegram/app/stickerfilemanager.cpp (+5/-0)
To merge this branch: bzr merge lp:~libqtelegram-team/telegram-app/snap-telegram-app-take3
Reviewer Review Type Date Requested Status
Jin (community) Approve
Review via email: mp+311506@code.launchpad.net

Commit message

Rewritting snapcraft.yaml for have

- snap dependencies got from git instead of having them already locally
- build in yakkety distro (tested ok)
- having available old way of creating click packages, also, as usual
- set as default LXD_IMAGE_ALIAS the value ubuntu-sdk-15.04-armhf

Description of the change

Rewritting snapcraft.yaml for have

- snap dependencies got from git instead of having them already locally
- build in yakkety distro (tested ok)
- having available old way of creating click packages, also, as usual
- set as default LXD_IMAGE_ALIAS the value ubuntu-sdk-15.04-armhf

To post a comment you must log in.
253. By Roberto Mier Escandon

set as default value for LXD_IMAGE_ALIAS ubuntu-sdk-15.04-armhf

254. By Roberto Mier Escandon

removed not needed definition

255. By Roberto Mier Escandon

added snap subfolder

256. By Roberto Mier Escandon

added base qt5 packages to build the app

Revision history for this message
Jin (jindallo) wrote :

@Roberto,

Awesome work, Roberto!

This MP works good and verified pass,
I will merge it for you.

Then for the .snap size reducing work,
will also do after verified.

Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2016-11-22 08:45:33 +0000
3+++ README.md 2016-11-22 22:06:28 +0000
4@@ -225,8 +225,63 @@
5 > 3. Enable Send button - #326 - Remove `connected || !NetworkingStatus` IF statement so you only have `if (state == “attach”) {...}` in
6 > `onClicked:`.
7
8+## **Snap Package**
9+
10+Alternative to click you can build snap packages instead, to be used in Ubuntu Core and Ubuntu Personal enabled devices.
11+Here are the steps:
12+
13+### Clean
14+
15+On project folder execute
16+
17+```sh
18+snapcraft clean
19+```
20+
21+### Build
22+
23+```sh
24+snapcraft
25+```
26+
27+### Install snap
28+
29+You need to install previously ubuntu-snap-platform
30+```sh
31+snap install ubuntu-app-platform
32+```
33+
34+In case you are not logged in to the store it is needed execute install as sudoer. You can login using
35+```sh
36+snap login <username>
37+```
38+
39+You will be asked for credential(s)
40+
41+The first time you install our just created snap package, it is needed also installing ubuntu-app-platform snap. Once installed, it can be used by any other qt application snap:
42+
43+```sh
44+snap install ubuntu-app-platform
45+```
46+
47+```sh
48+snap install telegram-app_<version>_<arch>.snap --devmode --edge
49+snap connect telegram-app:platform ubuntu-app-platform:platform
50+```
51+NOTE: --devmode and --edge modifiers are needed while deploying in a non strict mode.
52+
53+NOTE: Snaps must be connected before running the applications for the first time to the ubuntu-app-platform. If telegram-app has been executed before the snap connect you will see an error message. To fix the problem, uninstall the telegram-app snap, then re-install it and run the snap connect command before executing telegram-app. This is a known limitation in snapd which will be resolved soon.
54+
55+### Execute
56+
57+```sh
58+telegram-app
59+```
60+
61 ## **References & Tutorials**
62 - [Autopilot Tutorials and Guides](https://developer.ubuntu.com/api/autopilot/python/1.5.0/)
63 - [Autopilot at a glance](http://www.theorangenotebook.com/2012/11/a-glance-at-autopilot.html)
64 - [Getting started with Autopilot](http://www.theorangenotebook.com/2012/11/getting-started-with-autopilot.html)
65 - [Your first autopilot test case](http://www.theorangenotebook.com/2012/11/our-first-autopilot-testcase.html)
66+- [Snap packaging](http://snapcraft.io)
67+
68
69=== added file 'make-snap.sh'
70--- make-snap.sh 1970-01-01 00:00:00 +0000
71+++ make-snap.sh 2016-11-22 22:06:28 +0000
72@@ -0,0 +1,4 @@
73+#!/bin/sh
74+SNAP_DESKTOP_FILE=setup/gui/telegram-app.desktop
75+intltool-merge -d -u po $SNAP_DESKTOP_FILE.in $SNAP_DESKTOP_FILE
76+snapcraft
77
78=== added directory 'setup'
79=== modified file 'setup.sh'
80--- setup.sh 2016-11-22 07:01:33 +0000
81+++ setup.sh 2016-11-22 22:06:28 +0000
82@@ -67,7 +67,7 @@
83 function askForLXD() {
84 #ask using cli for the lxd alias to use, as that name can be selected by the user when downloaded the image
85 if [ -z "$LXD_IMAGE_ALIAS" ]; then
86- LXD_IMAGE_ALIAS=builder-armhf
87+ LXD_IMAGE_ALIAS=ubuntu-sdk-15.04-armhf
88 fi
89 read -p "LXD image to use [$LXD_IMAGE_ALIAS]: " RESPONSE
90 RESPONSE="${RESPONSE:-$LXD_IMAGE_ALIAS}"
91
92=== added directory 'setup/gui'
93=== added file 'setup/gui/icon-large.png'
94Binary files setup/gui/icon-large.png 1970-01-01 00:00:00 +0000 and setup/gui/icon-large.png 2016-11-22 22:06:28 +0000 differ
95=== added file 'setup/gui/icon.png'
96Binary files setup/gui/icon.png 1970-01-01 00:00:00 +0000 and setup/gui/icon.png 2016-11-22 22:06:28 +0000 differ
97=== added file 'setup/gui/telegram-app.desktop'
98--- setup/gui/telegram-app.desktop 1970-01-01 00:00:00 +0000
99+++ setup/gui/telegram-app.desktop 2016-11-22 22:06:28 +0000
100@@ -0,0 +1,13 @@
101+[Desktop Entry]
102+Version=0.1
103+Type=Application
104+Terminal=false
105+Exec=telegram %u
106+Name=Telegram
107+Icon=${SNAP}/meta/gui/icon.png
108+X-Ubuntu-Touch=true
109+X-Ubuntu-Default-Department-ID=communication
110+X-Ubuntu-Splash-Show-Header=false
111+X-Ubuntu-Splash-Color=White
112+X-Ubuntu-Splash-Title=Telegram
113+X-Ubuntu-SymbolicIcon=${SNAP}/meta/gui/icon-large.png
114
115=== added file 'setup/gui/telegram-app.desktop.in'
116--- setup/gui/telegram-app.desktop.in 1970-01-01 00:00:00 +0000
117+++ setup/gui/telegram-app.desktop.in 2016-11-22 22:06:28 +0000
118@@ -0,0 +1,13 @@
119+[Desktop Entry]
120+Version=0.1
121+Type=Application
122+Terminal=false
123+Exec=telegram %u
124+_Name=Telegram
125+Icon=${SNAP}/meta/gui/icon.png
126+X-Ubuntu-Touch=true
127+X-Ubuntu-Default-Department-ID=communication
128+X-Ubuntu-Splash-Show-Header=false
129+X-Ubuntu-Splash-Color=White
130+_X-Ubuntu-Splash-Title=Telegram
131+X-Ubuntu-SymbolicIcon=${SNAP}/meta/gui/icon-large.png
132
133=== added directory 'snap'
134=== added file 'snap/telegram-app.wrapper'
135--- snap/telegram-app.wrapper 1970-01-01 00:00:00 +0000
136+++ snap/telegram-app.wrapper 2016-11-22 22:06:28 +0000
137@@ -0,0 +1,17 @@
138+#!/bin/sh
139+
140+if [ "$SNAP_ARCH" = "amd64" ]; then
141+ ARCH="x86_64-linux-gnu"
142+elif [ "$SNAP_ARCH" = "armhf" ]; then
143+ ARCH="arm-linux-gnueabihf"
144+elif [ "$SNAP_ARCH" = "arm64" ]; then
145+ ARCH="aarch64-linux-gnu"
146+else
147+ ARCH="$SNAP_ARCH-linux-gnu"
148+fi
149+
150+export LD_LIBRARY_PATH=$SNAP/usr/lib/$ARCH:$LD_LIBRARY_PATH
151+export LD_LIBRARY_PATH=$SNAP/lib/$ARCH:$LD_LIBRARY_PATH
152+
153+exec $SNAP/lib/$ARCH/bin/telegram
154+
155
156=== added directory 'snap/ubuntu-app-platform'
157=== added file 'snapcraft.yaml'
158--- snapcraft.yaml 1970-01-01 00:00:00 +0000
159+++ snapcraft.yaml 2016-11-22 22:06:28 +0000
160@@ -0,0 +1,91 @@
161+name: telegram-app
162+version: 2.3.37.2
163+summary: Ubuntu Telegram Applicaiton
164+description: The Ubuntu Telegram for all Ubuntu devices
165+grade: devel
166+confinement: devmode
167+
168+apps:
169+ telegram-app:
170+ command: desktop-launch $SNAP/bin/telegram-app.wrapper --desktop_file_hint=unity8 "$@"
171+ plugs: [unity7, opengl, network, home, platform, camera, pulseaudio]
172+
173+plugs:
174+ platform:
175+ interface: content
176+ content: ubuntu-app-platform1
177+ target: ubuntu-app-platform
178+ default-provider: ubuntu-app-platform
179+
180+parts:
181+ libqtelegram-ae:
182+ source: https://github.com/Aseman-Land/libqtelegram-aseman-edition.git
183+ source-type: git
184+ source-commit: 7bc3c3d54c744d675aa261bd4a0d335291052ee6
185+ plugin: qmake
186+ qt-version: qt5
187+ options:
188+ - PREFIX=/usr
189+ - -r
190+ # FIXME: workaround for skip gcc 6 build issue with stdlib.h
191+ - QMAKE_CFLAGS_ISYSTEM=
192+ build-packages:
193+ - build-essential
194+ - libssl-dev
195+ - qtmultimedia5-dev
196+ stage-packages:
197+ - libthumbnailer-qt-dev
198+ - qml-module-ubuntu-connectivity
199+ - qtdeclarative5-ubuntu-contacts0.1
200+
201+ telegramqml:
202+ source: https://github.com/Aseman-Land/TelegramQML.git
203+ source-type: git
204+ source-commit: 7d5110a454af7d9be2370da6de217941bb9d1f1b
205+ plugin: qmake
206+ qt-version: qt5
207+ options:
208+ - INCLUDEPATH+=$SNAPCRAFT_STAGE/usr/include/libqtelegram-ae
209+ - INCLUDEPATH+=$SNAPCRAFT_STAGE/usr/include/thumbnailer-qt-1.0/unity/thumbnailer/qt
210+ - LIBS+=-Lqtelegram-ae
211+ - LIBS+=-Lthumbnailer-qt
212+ - PREFIX=/usr
213+ - -r
214+ - BUILD_MODE+=lib
215+ - DEFINES+=UBUNTU_PHONE
216+ # FIXME: workaround for skip gcc 6 build issue with stdlib.h
217+ - QMAKE_CFLAGS_ISYSTEM=
218+ build-packages:
219+ - intltool
220+ - qtdeclarative5-dev
221+ - qt5-default
222+ - qtbase5-dev
223+ after: [libqtelegram-ae]
224+
225+ telegram-app:
226+ source: telegram
227+ source-subdir: app
228+ plugin: qmake
229+ qt-version: qt5
230+ options:
231+ - INCLUDEPATH+=$SNAPCRAFT_STAGE/usr/include/libqtelegram-ae
232+ - INCLUDEPATH+=$SNAPCRAFT_STAGE/usr/include/telegramqml
233+ - PREFIX=/usr
234+ - DEFINES+=SNAP_MODE
235+ - -r
236+ snap:
237+ - -database
238+ - -emojis
239+ - -icons
240+ - -scope
241+ - -stickers
242+ after: [telegramqml, desktop-ubuntu-app-platform]
243+
244+ wrapper:
245+ source: snap
246+ plugin: dump
247+ organize:
248+ telegram-app.wrapper: bin/telegram-app.wrapper
249+
250+
251+
252
253=== modified file 'telegram/app/app.pro'
254--- telegram/app/app.pro 2016-04-06 08:01:54 +0000
255+++ telegram/app/app.pro 2016-11-22 22:06:28 +0000
256@@ -13,7 +13,7 @@
257
258 isEmpty(OPENSSL_INCLUDE_PATH): OPENSSL_INCLUDE_PATH = /usr/include/openssl /usr/local/include/openssl
259
260-LIBS += -lssl -lcrypto -lz -lqtelegram-ae -ltelegramqml
261+LIBS += -lssl -lcrypto -lz -lqtelegram-ae -ltelegramqml -lthumbnailer-qt
262
263 INCLUDEPATH += $${OPENSSL_INCLUDE_PATH}
264
265
266=== modified file 'telegram/app/stickerfilemanager.cpp'
267--- telegram/app/stickerfilemanager.cpp 2016-02-29 10:22:26 +0000
268+++ telegram/app/stickerfilemanager.cpp 2016-11-22 22:06:28 +0000
269@@ -2,7 +2,12 @@
270 #include "asemantools/asemandevices.h"
271
272 #include <telegramqml.h>
273+
274+#ifdef SNAP_MODE
275+#include <libqtelegram-ae/telegram.h>
276+#else
277 #include "../../deps/libqtelegram-ae/telegram.h"
278+#endif
279
280 #include <QList>
281 #include <QHash>

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: