Merge lp:~artmello/gallery-app/gallery-app-snap_u8 into lp:gallery-app

Proposed by Arthur Mello
Status: Needs review
Proposed branch: lp:~artmello/gallery-app/gallery-app-snap_u8
Merge into: lp:gallery-app
Diff against target: 165 lines (+64/-12)
5 files modified
setup/gui/gallery-app.desktop (+18/-0)
snapcraft.yaml (+8/-5)
src/config.h.in (+12/-4)
src/util/resource.cpp (+2/-2)
wrapper (+24/-1)
To merge this branch: bzr merge lp:~artmello/gallery-app/gallery-app-snap_u8
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+307776@code.launchpad.net

Commit message

Changes to snapcraft.yaml to handle wrapper/setup folder changes
Add setup folder with icon and desktop file
Fix runningInstalled checks to handle when running from snap pkg

Description of the change

Changes to snapcraft.yaml to handle wrapper/setup folder changes
Add setup folder with icon and desktop file
Fix runningInstalled checks to handle when running from snap pkg

To post a comment you must log in.
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:1337
https://jenkins.canonical.com/system-apps/job/lp-gallery-app-ci/24/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/1760
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/428
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1760
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1605
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1605/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1605
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1605/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1605
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1605/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1605
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1605/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1605
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1605/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1605
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1605/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1605
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1605/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1605
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1605/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1605
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1605/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-gallery-app-ci/24/rebuild

review: Approve (continuous-integration)

Unmerged revisions

1337. By Arthur Mello

Merge renato changes to enable snap to work on unity8

1336. By Arthur Mello

Make snap work correctly on unity 7 by checking if it is running like a snap

1335. By Arthur Mello

Add missing var

1334. By Arthur Mello

Update config.h.in to handle bug #1629009

1333. By Arthur Mello

Changes to make gallery snap work on unity8

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'setup'
2=== added directory 'setup/gui'
3=== added file 'setup/gui/gallery-app.desktop'
4--- setup/gui/gallery-app.desktop 1970-01-01 00:00:00 +0000
5+++ setup/gui/gallery-app.desktop 2016-10-06 01:34:16 +0000
6@@ -0,0 +1,18 @@
7+[Desktop Entry]
8+Version=1.0
9+Name=Gallery
10+GenericName=Ubuntu Photo Viewer
11+Comment=Browse your photographs
12+Keywords=Photographs;Pictures;Albums
13+Exec=gallery-app %u
14+Icon=/snap/gallery-app/current/setup/gui/icon.png
15+StartupNotify=true
16+Terminal=false
17+Type=Application
18+MimeType=image/jpg;image/jpeg;
19+Categories=Graphics;Photography;RasterGraphics;Viewer;
20+X-Ayatana-Appmenu-Show-Stubs=false
21+X-Ubuntu-Touch=true
22+X-Ubuntu-Single-Instance=true
23+X-Ubuntu-Default-Department-ID=accessories
24+X-Ubuntu-Splash-Show-Header=true
25
26=== added file 'setup/gui/icon.png'
27Binary files setup/gui/icon.png 1970-01-01 00:00:00 +0000 and setup/gui/icon.png 2016-10-06 01:34:16 +0000 differ
28=== modified file 'snapcraft.yaml'
29--- snapcraft.yaml 2016-09-02 15:59:56 +0000
30+++ snapcraft.yaml 2016-10-06 01:34:16 +0000
31@@ -2,16 +2,16 @@
32 version: 2.9.1
33 summary: Gallery app
34 description: Gallery application for your photo collection
35-confinement: strict
36+confinement: devmode # use "strict" to enforce system access only via declared interfaces
37
38 apps:
39 gallery-app:
40- command: bin/wrapper
41- plugs: [unity7, opengl, home, thumbnailer]
42+ command: bin/wrapper --desktop_file_hint=unity8 "$@"
43+ plugs: [unity7, opengl, home] # FIXME: Add 'thumbnailer' interface when it gets merged on snapd
44
45 parts:
46 gallery:
47- source: ./
48+ source: .
49 plugin: cmake
50 configflags: [-DCMAKE_INSTALL_PREFIX=/usr, -DCLICK_MODE=off]
51 build-packages:
52@@ -32,6 +32,10 @@
53 - xdg-user-dirs
54 - qtdeclarative5-ubuntu-ui-extras0.2
55 - qtdeclarative5-ubuntu-thumbnailer0.1
56+ - suru-icon-theme
57+ - mir-graphics-drivers-desktop
58+ # FIXME: This is necessary for now, to detect mouse and keyboard
59+ - unity8-private
60 after: [desktop/qt5]
61
62 gallery-copy:
63@@ -39,5 +43,4 @@
64 plugin: dump
65 organize:
66 wrapper: bin/wrapper
67- test.jpg: test/test.jpg
68
69
70=== modified file 'src/config.h.in'
71--- src/config.h.in 2015-05-08 14:55:36 +0000
72+++ src/config.h.in 2016-10-06 01:34:16 +0000
73@@ -23,6 +23,8 @@
74 #include <QtCore/QDir>
75 #include <QtCore/QString>
76
77+static QString SNAP_ENV = qgetenv("SNAP");
78+
79 inline bool isClick() {
80 #ifdef CLICK_MODE
81 return true;
82@@ -37,18 +39,24 @@
83 return installed;
84 }
85
86+inline bool isSnap() {
87+ return !SNAP_ENV.isEmpty();
88+}
89+
90 inline void setOrganization() {
91 QCoreApplication::setOrganizationName("@APP_PACKAGE_NAME@");
92 }
93
94 inline QString galleryDirectory()
95 {
96- if (isClick()) {
97- return QString(".");
98+ if (isSnap()) {
99+ return SNAP_ENV + "@CMAKE_INSTALL_PREFIX@/@GALLERY_DIR@/";
100+ } else if (isClick()) {
101+ return QDir::currentPath();
102 } else if (isRunningInstalled()) {
103- return QString("@CMAKE_INSTALL_PREFIX@/@GALLERY_DIR@");
104+ return QString("@CMAKE_INSTALL_PREFIX@/@GALLERY_DIR@/");
105 } else {
106- return QString("@gallery_src_SOURCE_DIR@");
107+ return QString("@CMAKE_SOURCE_DIR@/");
108 }
109 }
110 #endif // __CONFIG_H__
111
112=== modified file 'src/util/resource.cpp'
113--- src/util/resource.cpp 2016-08-26 18:16:34 +0000
114+++ src/util/resource.cpp 2016-10-06 01:34:16 +0000
115@@ -41,7 +41,7 @@
116 m_databaseDirectory(""),
117 m_thumbnailDirectory("")
118 {
119- if (isClick()) {
120+ if (isSnap() || isClick()) {
121 setOrganization();
122 }
123 if (!pictureDir.isEmpty() && QDir(pictureDir).exists()) {
124@@ -97,7 +97,7 @@
125 */
126 QUrl Resource::getRcUrl(const QString& path)
127 {
128- if (isClick() || isRunningInstalled()) {
129+ if (isSnap() || isClick() || isRunningInstalled()) {
130 return QUrl::fromLocalFile(galleryDirectory() + "/rc/" + path);
131 } else {
132 return QUrl::fromLocalFile(galleryDirectory() + "/../rc/" + path);
133
134=== modified file 'wrapper'
135--- wrapper 2016-09-21 18:18:58 +0000
136+++ wrapper 2016-10-06 01:34:16 +0000
137@@ -1,4 +1,27 @@
138-#!/bin/sh
139+#!/bin/bash
140+
141+if [ "$SNAP_ARCH" == "amd64" ]; then
142+ ARCH="x86_64-linux-gnu"
143+elif [ "$SNAP_ARCH" == "armhf" ]; then
144+ ARCH="arm-linux-gnueabihf"
145+else
146+ ARCH="$SNAP_ARCH-linux-gnu"
147+fi
148+
149+if [ "$DESKTOP_SESSION" == "unity8" ]; then
150+ # Qt Platform to Mir
151+ export QT_QPA_PLATFORM=ubuntumirclient
152+ # Mir runtime
153+ export MIR_SOCKET=$XDG_RUNTIME_DIR/mir_socket
154+ export MIR_CLIENT_PLATFORM_PATH=$SNAP/usr/lib/$ARCH/mir/client-platform
155+fi
156+
157+# Unity8 private
158+export QML2_IMPORT_PATH=$QML2_IMPORT_PATH:$SNAP/usr/lib/$ARCH/unity8/qml
159+
160+# Tell libGL where to find the drivers
161+export LIBGL_DRIVERS_PATH=$SNAP/usr/lib/$ARCH/dri
162+export LD_LIBRARY_PATH="$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH"
163
164 # FIXME: this is a workaround for XDG variables
165 # not being set adequately

Subscribers

People subscribed via source and target branches