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
=== modified file 'README.md'
--- README.md 2016-11-22 08:45:33 +0000
+++ README.md 2016-11-22 22:06:28 +0000
@@ -225,8 +225,63 @@
225> 3. Enable Send button - #326 - Remove `connected || !NetworkingStatus` IF statement so you only have `if (state == “attach”) {...}` in225> 3. Enable Send button - #326 - Remove `connected || !NetworkingStatus` IF statement so you only have `if (state == “attach”) {...}` in
226> `onClicked:`.226> `onClicked:`.
227227
228## **Snap Package**
229
230Alternative to click you can build snap packages instead, to be used in Ubuntu Core and Ubuntu Personal enabled devices.
231Here are the steps:
232
233### Clean
234
235On project folder execute
236
237```sh
238snapcraft clean
239```
240
241### Build
242
243```sh
244snapcraft
245```
246
247### Install snap
248
249You need to install previously ubuntu-snap-platform
250```sh
251snap install ubuntu-app-platform
252```
253
254In case you are not logged in to the store it is needed execute install as sudoer. You can login using
255```sh
256snap login <username>
257```
258
259You will be asked for credential(s)
260
261The 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:
262
263```sh
264snap install ubuntu-app-platform
265```
266
267```sh
268snap install telegram-app_<version>_<arch>.snap --devmode --edge
269snap connect telegram-app:platform ubuntu-app-platform:platform
270```
271NOTE: --devmode and --edge modifiers are needed while deploying in a non strict mode.
272
273NOTE: 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.
274
275### Execute
276
277```sh
278telegram-app
279```
280
228## **References & Tutorials**281## **References & Tutorials**
229- [Autopilot Tutorials and Guides](https://developer.ubuntu.com/api/autopilot/python/1.5.0/)282- [Autopilot Tutorials and Guides](https://developer.ubuntu.com/api/autopilot/python/1.5.0/)
230- [Autopilot at a glance](http://www.theorangenotebook.com/2012/11/a-glance-at-autopilot.html)283- [Autopilot at a glance](http://www.theorangenotebook.com/2012/11/a-glance-at-autopilot.html)
231- [Getting started with Autopilot](http://www.theorangenotebook.com/2012/11/getting-started-with-autopilot.html)284- [Getting started with Autopilot](http://www.theorangenotebook.com/2012/11/getting-started-with-autopilot.html)
232- [Your first autopilot test case](http://www.theorangenotebook.com/2012/11/our-first-autopilot-testcase.html)285- [Your first autopilot test case](http://www.theorangenotebook.com/2012/11/our-first-autopilot-testcase.html)
286- [Snap packaging](http://snapcraft.io)
287
233288
=== added file 'make-snap.sh'
--- make-snap.sh 1970-01-01 00:00:00 +0000
+++ make-snap.sh 2016-11-22 22:06:28 +0000
@@ -0,0 +1,4 @@
1#!/bin/sh
2SNAP_DESKTOP_FILE=setup/gui/telegram-app.desktop
3intltool-merge -d -u po $SNAP_DESKTOP_FILE.in $SNAP_DESKTOP_FILE
4snapcraft
05
=== added directory 'setup'
=== modified file 'setup.sh'
--- setup.sh 2016-11-22 07:01:33 +0000
+++ setup.sh 2016-11-22 22:06:28 +0000
@@ -67,7 +67,7 @@
67function askForLXD() {67function askForLXD() {
68 #ask using cli for the lxd alias to use, as that name can be selected by the user when downloaded the image68 #ask using cli for the lxd alias to use, as that name can be selected by the user when downloaded the image
69 if [ -z "$LXD_IMAGE_ALIAS" ]; then69 if [ -z "$LXD_IMAGE_ALIAS" ]; then
70 LXD_IMAGE_ALIAS=builder-armhf70 LXD_IMAGE_ALIAS=ubuntu-sdk-15.04-armhf
71 fi71 fi
72 read -p "LXD image to use [$LXD_IMAGE_ALIAS]: " RESPONSE72 read -p "LXD image to use [$LXD_IMAGE_ALIAS]: " RESPONSE
73 RESPONSE="${RESPONSE:-$LXD_IMAGE_ALIAS}"73 RESPONSE="${RESPONSE:-$LXD_IMAGE_ALIAS}"
7474
=== added directory 'setup/gui'
=== added file 'setup/gui/icon-large.png'
75Binary 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 differ75Binary 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
=== added file 'setup/gui/icon.png'
76Binary files setup/gui/icon.png 1970-01-01 00:00:00 +0000 and setup/gui/icon.png 2016-11-22 22:06:28 +0000 differ76Binary 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
=== added file 'setup/gui/telegram-app.desktop'
--- setup/gui/telegram-app.desktop 1970-01-01 00:00:00 +0000
+++ setup/gui/telegram-app.desktop 2016-11-22 22:06:28 +0000
@@ -0,0 +1,13 @@
1[Desktop Entry]
2Version=0.1
3Type=Application
4Terminal=false
5Exec=telegram %u
6Name=Telegram
7Icon=${SNAP}/meta/gui/icon.png
8X-Ubuntu-Touch=true
9X-Ubuntu-Default-Department-ID=communication
10X-Ubuntu-Splash-Show-Header=false
11X-Ubuntu-Splash-Color=White
12X-Ubuntu-Splash-Title=Telegram
13X-Ubuntu-SymbolicIcon=${SNAP}/meta/gui/icon-large.png
014
=== added file 'setup/gui/telegram-app.desktop.in'
--- setup/gui/telegram-app.desktop.in 1970-01-01 00:00:00 +0000
+++ setup/gui/telegram-app.desktop.in 2016-11-22 22:06:28 +0000
@@ -0,0 +1,13 @@
1[Desktop Entry]
2Version=0.1
3Type=Application
4Terminal=false
5Exec=telegram %u
6_Name=Telegram
7Icon=${SNAP}/meta/gui/icon.png
8X-Ubuntu-Touch=true
9X-Ubuntu-Default-Department-ID=communication
10X-Ubuntu-Splash-Show-Header=false
11X-Ubuntu-Splash-Color=White
12_X-Ubuntu-Splash-Title=Telegram
13X-Ubuntu-SymbolicIcon=${SNAP}/meta/gui/icon-large.png
014
=== added directory 'snap'
=== added file 'snap/telegram-app.wrapper'
--- snap/telegram-app.wrapper 1970-01-01 00:00:00 +0000
+++ snap/telegram-app.wrapper 2016-11-22 22:06:28 +0000
@@ -0,0 +1,17 @@
1#!/bin/sh
2
3if [ "$SNAP_ARCH" = "amd64" ]; then
4 ARCH="x86_64-linux-gnu"
5elif [ "$SNAP_ARCH" = "armhf" ]; then
6 ARCH="arm-linux-gnueabihf"
7elif [ "$SNAP_ARCH" = "arm64" ]; then
8 ARCH="aarch64-linux-gnu"
9else
10 ARCH="$SNAP_ARCH-linux-gnu"
11fi
12
13export LD_LIBRARY_PATH=$SNAP/usr/lib/$ARCH:$LD_LIBRARY_PATH
14export LD_LIBRARY_PATH=$SNAP/lib/$ARCH:$LD_LIBRARY_PATH
15
16exec $SNAP/lib/$ARCH/bin/telegram
17
018
=== added directory 'snap/ubuntu-app-platform'
=== added file 'snapcraft.yaml'
--- snapcraft.yaml 1970-01-01 00:00:00 +0000
+++ snapcraft.yaml 2016-11-22 22:06:28 +0000
@@ -0,0 +1,91 @@
1name: telegram-app
2version: 2.3.37.2
3summary: Ubuntu Telegram Applicaiton
4description: The Ubuntu Telegram for all Ubuntu devices
5grade: devel
6confinement: devmode
7
8apps:
9 telegram-app:
10 command: desktop-launch $SNAP/bin/telegram-app.wrapper --desktop_file_hint=unity8 "$@"
11 plugs: [unity7, opengl, network, home, platform, camera, pulseaudio]
12
13plugs:
14 platform:
15 interface: content
16 content: ubuntu-app-platform1
17 target: ubuntu-app-platform
18 default-provider: ubuntu-app-platform
19
20parts:
21 libqtelegram-ae:
22 source: https://github.com/Aseman-Land/libqtelegram-aseman-edition.git
23 source-type: git
24 source-commit: 7bc3c3d54c744d675aa261bd4a0d335291052ee6
25 plugin: qmake
26 qt-version: qt5
27 options:
28 - PREFIX=/usr
29 - -r
30 # FIXME: workaround for skip gcc 6 build issue with stdlib.h
31 - QMAKE_CFLAGS_ISYSTEM=
32 build-packages:
33 - build-essential
34 - libssl-dev
35 - qtmultimedia5-dev
36 stage-packages:
37 - libthumbnailer-qt-dev
38 - qml-module-ubuntu-connectivity
39 - qtdeclarative5-ubuntu-contacts0.1
40
41 telegramqml:
42 source: https://github.com/Aseman-Land/TelegramQML.git
43 source-type: git
44 source-commit: 7d5110a454af7d9be2370da6de217941bb9d1f1b
45 plugin: qmake
46 qt-version: qt5
47 options:
48 - INCLUDEPATH+=$SNAPCRAFT_STAGE/usr/include/libqtelegram-ae
49 - INCLUDEPATH+=$SNAPCRAFT_STAGE/usr/include/thumbnailer-qt-1.0/unity/thumbnailer/qt
50 - LIBS+=-Lqtelegram-ae
51 - LIBS+=-Lthumbnailer-qt
52 - PREFIX=/usr
53 - -r
54 - BUILD_MODE+=lib
55 - DEFINES+=UBUNTU_PHONE
56 # FIXME: workaround for skip gcc 6 build issue with stdlib.h
57 - QMAKE_CFLAGS_ISYSTEM=
58 build-packages:
59 - intltool
60 - qtdeclarative5-dev
61 - qt5-default
62 - qtbase5-dev
63 after: [libqtelegram-ae]
64
65 telegram-app:
66 source: telegram
67 source-subdir: app
68 plugin: qmake
69 qt-version: qt5
70 options:
71 - INCLUDEPATH+=$SNAPCRAFT_STAGE/usr/include/libqtelegram-ae
72 - INCLUDEPATH+=$SNAPCRAFT_STAGE/usr/include/telegramqml
73 - PREFIX=/usr
74 - DEFINES+=SNAP_MODE
75 - -r
76 snap:
77 - -database
78 - -emojis
79 - -icons
80 - -scope
81 - -stickers
82 after: [telegramqml, desktop-ubuntu-app-platform]
83
84 wrapper:
85 source: snap
86 plugin: dump
87 organize:
88 telegram-app.wrapper: bin/telegram-app.wrapper
89
90
91
092
=== modified file 'telegram/app/app.pro'
--- telegram/app/app.pro 2016-04-06 08:01:54 +0000
+++ telegram/app/app.pro 2016-11-22 22:06:28 +0000
@@ -13,7 +13,7 @@
1313
14isEmpty(OPENSSL_INCLUDE_PATH): OPENSSL_INCLUDE_PATH = /usr/include/openssl /usr/local/include/openssl14isEmpty(OPENSSL_INCLUDE_PATH): OPENSSL_INCLUDE_PATH = /usr/include/openssl /usr/local/include/openssl
1515
16LIBS += -lssl -lcrypto -lz -lqtelegram-ae -ltelegramqml16LIBS += -lssl -lcrypto -lz -lqtelegram-ae -ltelegramqml -lthumbnailer-qt
1717
18INCLUDEPATH += $${OPENSSL_INCLUDE_PATH} 18INCLUDEPATH += $${OPENSSL_INCLUDE_PATH}
1919
2020
=== modified file 'telegram/app/stickerfilemanager.cpp'
--- telegram/app/stickerfilemanager.cpp 2016-02-29 10:22:26 +0000
+++ telegram/app/stickerfilemanager.cpp 2016-11-22 22:06:28 +0000
@@ -2,7 +2,12 @@
2#include "asemantools/asemandevices.h"2#include "asemantools/asemandevices.h"
33
4#include <telegramqml.h>4#include <telegramqml.h>
5
6#ifdef SNAP_MODE
7#include <libqtelegram-ae/telegram.h>
8#else
5#include "../../deps/libqtelegram-ae/telegram.h"9#include "../../deps/libqtelegram-ae/telegram.h"
10#endif
611
7#include <QList>12#include <QList>
8#include <QHash>13#include <QHash>

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: