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
=== added directory 'setup'
=== added directory 'setup/gui'
=== added file 'setup/gui/gallery-app.desktop'
--- setup/gui/gallery-app.desktop 1970-01-01 00:00:00 +0000
+++ setup/gui/gallery-app.desktop 2016-10-06 01:34:16 +0000
@@ -0,0 +1,18 @@
1[Desktop Entry]
2Version=1.0
3Name=Gallery
4GenericName=Ubuntu Photo Viewer
5Comment=Browse your photographs
6Keywords=Photographs;Pictures;Albums
7Exec=gallery-app %u
8Icon=/snap/gallery-app/current/setup/gui/icon.png
9StartupNotify=true
10Terminal=false
11Type=Application
12MimeType=image/jpg;image/jpeg;
13Categories=Graphics;Photography;RasterGraphics;Viewer;
14X-Ayatana-Appmenu-Show-Stubs=false
15X-Ubuntu-Touch=true
16X-Ubuntu-Single-Instance=true
17X-Ubuntu-Default-Department-ID=accessories
18X-Ubuntu-Splash-Show-Header=true
019
=== added file 'setup/gui/icon.png'
1Binary files setup/gui/icon.png 1970-01-01 00:00:00 +0000 and setup/gui/icon.png 2016-10-06 01:34:16 +0000 differ20Binary 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
=== modified file 'snapcraft.yaml'
--- snapcraft.yaml 2016-09-02 15:59:56 +0000
+++ snapcraft.yaml 2016-10-06 01:34:16 +0000
@@ -2,16 +2,16 @@
2version: 2.9.12version: 2.9.1
3summary: Gallery app3summary: Gallery app
4description: Gallery application for your photo collection4description: Gallery application for your photo collection
5confinement: strict5confinement: devmode # use "strict" to enforce system access only via declared interfaces
66
7apps:7apps:
8 gallery-app:8 gallery-app:
9 command: bin/wrapper9 command: bin/wrapper --desktop_file_hint=unity8 "$@"
10 plugs: [unity7, opengl, home, thumbnailer]10 plugs: [unity7, opengl, home] # FIXME: Add 'thumbnailer' interface when it gets merged on snapd
1111
12parts:12parts:
13 gallery:13 gallery:
14 source: ./14 source: .
15 plugin: cmake15 plugin: cmake
16 configflags: [-DCMAKE_INSTALL_PREFIX=/usr, -DCLICK_MODE=off]16 configflags: [-DCMAKE_INSTALL_PREFIX=/usr, -DCLICK_MODE=off]
17 build-packages:17 build-packages:
@@ -32,6 +32,10 @@
32 - xdg-user-dirs32 - xdg-user-dirs
33 - qtdeclarative5-ubuntu-ui-extras0.233 - qtdeclarative5-ubuntu-ui-extras0.2
34 - qtdeclarative5-ubuntu-thumbnailer0.134 - qtdeclarative5-ubuntu-thumbnailer0.1
35 - suru-icon-theme
36 - mir-graphics-drivers-desktop
37 # FIXME: This is necessary for now, to detect mouse and keyboard
38 - unity8-private
35 after: [desktop/qt5]39 after: [desktop/qt5]
3640
37 gallery-copy:41 gallery-copy:
@@ -39,5 +43,4 @@
39 plugin: dump43 plugin: dump
40 organize:44 organize:
41 wrapper: bin/wrapper45 wrapper: bin/wrapper
42 test.jpg: test/test.jpg
4346
4447
=== modified file 'src/config.h.in'
--- src/config.h.in 2015-05-08 14:55:36 +0000
+++ src/config.h.in 2016-10-06 01:34:16 +0000
@@ -23,6 +23,8 @@
23#include <QtCore/QDir>23#include <QtCore/QDir>
24#include <QtCore/QString>24#include <QtCore/QString>
2525
26static QString SNAP_ENV = qgetenv("SNAP");
27
26inline bool isClick() {28inline bool isClick() {
27#ifdef CLICK_MODE29#ifdef CLICK_MODE
28 return true;30 return true;
@@ -37,18 +39,24 @@
37 return installed;39 return installed;
38}40}
3941
42inline bool isSnap() {
43 return !SNAP_ENV.isEmpty();
44}
45
40inline void setOrganization() {46inline void setOrganization() {
41 QCoreApplication::setOrganizationName("@APP_PACKAGE_NAME@");47 QCoreApplication::setOrganizationName("@APP_PACKAGE_NAME@");
42}48}
4349
44inline QString galleryDirectory()50inline QString galleryDirectory()
45{51{
46 if (isClick()) {52 if (isSnap()) {
47 return QString(".");53 return SNAP_ENV + "@CMAKE_INSTALL_PREFIX@/@GALLERY_DIR@/";
54 } else if (isClick()) {
55 return QDir::currentPath();
48 } else if (isRunningInstalled()) {56 } else if (isRunningInstalled()) {
49 return QString("@CMAKE_INSTALL_PREFIX@/@GALLERY_DIR@");57 return QString("@CMAKE_INSTALL_PREFIX@/@GALLERY_DIR@/");
50 } else {58 } else {
51 return QString("@gallery_src_SOURCE_DIR@");59 return QString("@CMAKE_SOURCE_DIR@/");
52 }60 }
53}61}
54#endif // __CONFIG_H__62#endif // __CONFIG_H__
5563
=== modified file 'src/util/resource.cpp'
--- src/util/resource.cpp 2016-08-26 18:16:34 +0000
+++ src/util/resource.cpp 2016-10-06 01:34:16 +0000
@@ -41,7 +41,7 @@
41 m_databaseDirectory(""),41 m_databaseDirectory(""),
42 m_thumbnailDirectory("")42 m_thumbnailDirectory("")
43{43{
44 if (isClick()) {44 if (isSnap() || isClick()) {
45 setOrganization();45 setOrganization();
46 }46 }
47 if (!pictureDir.isEmpty() && QDir(pictureDir).exists()) {47 if (!pictureDir.isEmpty() && QDir(pictureDir).exists()) {
@@ -97,7 +97,7 @@
97 */97 */
98QUrl Resource::getRcUrl(const QString& path)98QUrl Resource::getRcUrl(const QString& path)
99{99{
100 if (isClick() || isRunningInstalled()) {100 if (isSnap() || isClick() || isRunningInstalled()) {
101 return QUrl::fromLocalFile(galleryDirectory() + "/rc/" + path);101 return QUrl::fromLocalFile(galleryDirectory() + "/rc/" + path);
102 } else {102 } else {
103 return QUrl::fromLocalFile(galleryDirectory() + "/../rc/" + path);103 return QUrl::fromLocalFile(galleryDirectory() + "/../rc/" + path);
104104
=== modified file 'wrapper'
--- wrapper 2016-09-21 18:18:58 +0000
+++ wrapper 2016-10-06 01:34:16 +0000
@@ -1,4 +1,27 @@
1#!/bin/sh1#!/bin/bash
2
3if [ "$SNAP_ARCH" == "amd64" ]; then
4 ARCH="x86_64-linux-gnu"
5elif [ "$SNAP_ARCH" == "armhf" ]; then
6 ARCH="arm-linux-gnueabihf"
7else
8 ARCH="$SNAP_ARCH-linux-gnu"
9fi
10
11if [ "$DESKTOP_SESSION" == "unity8" ]; then
12 # Qt Platform to Mir
13 export QT_QPA_PLATFORM=ubuntumirclient
14 # Mir runtime
15 export MIR_SOCKET=$XDG_RUNTIME_DIR/mir_socket
16 export MIR_CLIENT_PLATFORM_PATH=$SNAP/usr/lib/$ARCH/mir/client-platform
17fi
18
19# Unity8 private
20export QML2_IMPORT_PATH=$QML2_IMPORT_PATH:$SNAP/usr/lib/$ARCH/unity8/qml
21
22# Tell libGL where to find the drivers
23export LIBGL_DRIVERS_PATH=$SNAP/usr/lib/$ARCH/dri
24export LD_LIBRARY_PATH="$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH"
225
3# FIXME: this is a workaround for XDG variables26# FIXME: this is a workaround for XDG variables
4# not being set adequately27# not being set adequately

Subscribers

People subscribed via source and target branches