Merge lp:~3v1n0/snappy-playpen/hello-unity-fixes into lp:snappy-playpen

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Michael Hall
Approved revision: 52
Merged at revision: 48
Proposed branch: lp:~3v1n0/snappy-playpen/hello-unity-fixes
Merge into: lp:snappy-playpen
Diff against target: 523 lines
To merge this branch: bzr merge lp:~3v1n0/snappy-playpen/hello-unity-fixes
Reviewer Review Type Date Requested Status
Michael Hall (community) Approve
Review via email: mp+294858@code.launchpad.net

Description of the change

Fixed hello-unity, to properly build and run in snap environment.

Since the upstream code needs some patches, I've played a little with it including an example of "quilt" plugin, which allows to use quilt patches to fix upstream code (upstream fixes parially live at lp:~3v1n0/hello-unity/sandbox-support).

To post a comment you must log in.
51. By Marco Trevisan (Treviño)

HelloUnity: use cached files and user data around

52. By Marco Trevisan (Treviño)

HelloUnity: use snap version to chose which data or cache path use

Revision history for this message
Michael Hall (mhall119) wrote :

Built a snap using this, but got apparmor error when running it:

May 16 23:00:34 mhall-thinkpad kernel: [10792.749388] audit: type=1400 audit(1463457634.502:103): apparmor="DENIED" operation="open" profile="snap.hello-unity.hello-unity" name="/home/mhall/projects/Ubuntu/snaps/snappy-playpen/hello-unity/stage/usr/lib/python2.7/os.py" pid=18146 comm="hello-unity" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
May 16 23:00:34 mhall-thinkpad kernel: [10792.749452] audit: type=1400 audit(1463457634.502:104): apparmor="DENIED" operation="open" profile="snap.hello-unity.hello-unity" name="/home/mhall/projects/Ubuntu/snaps/snappy-playpen/hello-unity/stage/usr/lib/python2.7/os.pyc" pid=18146 comm="hello-unity" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

Revision history for this message
Michael Hall (mhall119) wrote :

Even installing with --devmode running the app fails:

mhall@mhall-thinkpad:~/projects/Ubuntu/snaps/snappy-playpen/hello-unity$ /snap/bin/hello-unity
Traceback (most recent call last):
  File "/snap/hello-unity/100001/usr/bin/hello-unity", line 4, in <module>
    __import__('pkg_resources').run_script('hello-unity==0.4', 'hello-unity')
  File "/snap/hello-unity/100001/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 719, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/snap/hello-unity/100001/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1496, in run_script
    raise ResolutionError("No script named %r" % script_name)
pkg_resources.ResolutionError: No script named 'hello-unity'

review: Needs Fixing
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Mhmhmh.... Wait, are you sure you installed this snap version? Because this should run /snap/hello-unity/current/opt/bin/hello-unity which is not using the run_script thing.

I also had this problem, but also desktop files should actually run
  /snap/hello-unity/current/bin/hello-unity

Which is a wrapper that eventually calls the script above

Revision history for this message
Michael Hall (mhall119) wrote :

I removed and rebuilt everything, installed with --devmode, still getting this:

mhall@mhall-thinkpad:~/projects/Ubuntu/snaps$ hello-unity
Traceback (most recent call last):
  File "/snap/hello-unity/100001/usr/bin/hello-unity", line 4, in <module>
    __import__('pkg_resources').run_script('hello-unity==0.4', 'hello-unity')
  File "/snap/hello-unity/100001/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 719, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/snap/hello-unity/100001/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1496, in run_script
    raise ResolutionError("No script named %r" % script_name)
pkg_resources.ResolutionError: No script named 'hello-unity'

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

I get a different result. Note, I 'snap remove hello-unity' and then 'snap install ./hello-unity_0.4-snap2_amd64.snap'.

Note I didn't install it with --devmode. When I run it I see:

Traceback (most recent call last):
  File "/snap/hello-unity/100001/usr/lib/python2.7/dist-packages/site.py", line 75, in <module>
    __boot()
  File "/snap/hello-unity/100001/usr/lib/python2.7/dist-packages/site.py", line 3, in __boot
    import os
ImportError: No module named os

and the following apparmor denials:
audit: type=1400 audit(1463513788.872:142): apparmor="DENIED" operation="open" profile="snap.hello-unity.hello-unity" name="/home/jamie/bzr-pulls/snappy-playpen/hello-unity/stage/usr/lib/python2.7/os.py" pid=31432 comm="hello-unity" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
audit: type=1400 audit(1463513788.872:143): apparmor="DENIED" operation="open" profile="snap.hello-unity.hello-unity" name="/home/jamie/bzr-pulls/snappy-playpen/hello-unity/stage/usr/lib/python2.7/os.pyc" pid=31432 comm="hello-unity" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

If I do:
$ grep -r 'jamie/bzr-pulls' ./*|grep -v pyc

I see a ton of absolute paths to my snap build directory rather then the snap install directory (/snap/hello-unity/current/).

Revision history for this message
Michael Hall (mhall119) wrote :

My mistake, I messed up my bzr merge and that was causing all of the problems. I had to use --devmode, and amd also getting some apparmor denials,but the app runs and most of the Unity API use works too, approving

review: Approve
Revision history for this message
Michael Hall (mhall119) wrote :

Marco, can you propose these patches to the upstream project so I can merge them there?

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Michael, sure... Changes are already in lp:~3v1n0/hello-unity/sandbox-support (I planned to get these merged upstream too), but I also wanted to use this example to show how to patch upstream code.

However, we still need to include a patch (the one that changes the name of the .desktop file), so You could still merge it and update the downstream patches accordingly (remove the first two of the serie).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hello-unity/hello-unity.wrapper' (properties changed: +x to -x)
--- hello-unity/hello-unity.wrapper 2016-04-09 02:39:30 +0000
+++ hello-unity/hello-unity.wrapper 2016-05-17 01:04:22 +0000
@@ -1,6 +1,12 @@
1#!/bin/sh1#!/bin/bash
22
3ARCH='i386-linux-gnu'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
410
5export LD_LIBRARY_PATH=$SNAP/usr/lib/$ARCH:$LD_LIBRARY_PATH11export LD_LIBRARY_PATH=$SNAP/usr/lib/$ARCH:$LD_LIBRARY_PATH
612
@@ -12,16 +18,12 @@
12export LD_LIBRARY_PATH=$SNAP/usr/lib/$ARCH/mesa-egl:$LD_LIBRARY_PATH18export LD_LIBRARY_PATH=$SNAP/usr/lib/$ARCH/mesa-egl:$LD_LIBRARY_PATH
1319
14# XDG Config20# XDG Config
15export XDG_CONFIG_DIRS=$SNAP/etc/xdg:$XDG_CONFIG_DIRS21export XDG_CONFIG_DIRS=$SNAP/etc:$XDG_CONFIG_DIRS
16export XDG_CONFIG_DIRS=$SNAP/usr/xdg:$XDG_CONFIG_DIRS22
17# Note: this doesn't seem to work, QML's LocalStorage either ignores23# Note: this doesn't seem to work, QML's LocalStorage either ignores
18# or fails to use $SNAP_USER_DATA if defined here24# or fails to use $SNAP_USER_DATA if defined here
19export XDG_DATA_DIRS=$SNAP_USER_DATA:$XDG_DATA_DIRS
20export XDG_DATA_DIRS=$SNAP/usr/share:$XDG_DATA_DIRS25export XDG_DATA_DIRS=$SNAP/usr/share:$XDG_DATA_DIRS
2126
22# Not good, needed for fontconfig
23export XDG_DATA_HOME=$SNAP/usr/share
24
25# Font Config27# Font Config
26export FONTCONFIG_PATH=$SNAP/etc/fonts/config.d28export FONTCONFIG_PATH=$SNAP/etc/fonts/config.d
27export FONTCONFIG_FILE=$SNAP/etc/fonts/fonts.conf29export FONTCONFIG_FILE=$SNAP/etc/fonts/fonts.conf
@@ -32,5 +34,76 @@
32# Necessary for the SDK to find the translations directory34# Necessary for the SDK to find the translations directory
33export APP_DIR=$SNAP35export APP_DIR=$SNAP
3436
35cd $SNAP37# Set XDG_DATA_HOME to local path, dependent on snap version
36usr/bin/python $SNAP/usr/bin/hello-unity38export XDG_DATA_HOME=$SNAP_USER_DATA/.local-$SNAP_VERSION/share
39export XDG_DATA_DIRS=$XDG_DATA_HOME:$XDG_DATA_DIRS
40mkdir -p $XDG_DATA_HOME
41
42# Set cache folder to local path, dependent on snap version
43export XDG_CACHE_HOME=$SNAP_USER_DATA/.cache-$SNAP_VERSION
44mkdir -p $XDG_CACHE_HOME
45
46# Setup GI Repository typelibs (needed as some packages doesn't support multiarch)
47export GI_TYPELIB_PATH=$SNAP/usr/lib/$ARCH/girepository-1.0:$SNAP/usr/lib/girepository-1.0
48
49# Not good, needed for fontconfig and themes
50ln -sf $SNAP/usr/share/{fontconfig,fonts,fonts-*,themes} $XDG_DATA_HOME
51
52# Gio modules and cache
53export GIO_MODULE_DIR=$XDG_CACHE_HOME/gio-modules
54
55if [ ! -d $GIO_MODULE_DIR ]; then
56 mkdir -p $GIO_MODULE_DIR
57 ln -s $SNAP/usr/lib/$ARCH/gio/modules/*.so $GIO_MODULE_DIR
58 $SNAP/usr/lib/$ARCH/glib-2.0/gio-querymodules $GIO_MODULE_DIR
59fi
60
61# Build mime.cache
62if [ ! -d $XDG_DATA_HOME/mime ]; then
63 cp -a $SNAP/usr/share/mime $XDG_DATA_HOME
64 update-mime-database $XDG_DATA_HOME/mime
65fi
66
67# Setup GDK pixbuf loaders
68export GDK_PIXBUF_MODULE_FILE=$XDG_CACHE_HOME/gdk-pixbuf-loaders.cache
69export GDK_PIXBUF_MODULEDIR=$SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/2.10.0/loaders
70
71if [ ! -e $GDK_PIXBUF_MODULE_FILE ]; then
72 $SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders > $GDK_PIXBUF_MODULE_FILE
73fi
74
75# Keep an array of data dirs, for looping through them
76IFS=':' read -r -a data_dirs_array <<< "$XDG_DATA_DIRS"
77
78# Setup compiled gsettings schema
79GS_SCHEMA_DIR=$XDG_DATA_HOME/glib-2.0/schemas
80
81if [ ! -d $GS_SCHEMA_DIR ]; then
82 mkdir -p $GS_SCHEMA_DIR
83 for d in "${data_dirs_array[@]}"; do
84 ln -s $d/glib-2.0/schemas/*.xml $GS_SCHEMA_DIR
85 done
86
87 $SNAP/usr/lib/$ARCH/glib-2.0/glib-compile-schemas $GS_SCHEMA_DIR
88fi
89
90# Icon themes cache
91if [ ! -d $XDG_DATA_HOME/icons ]; then
92 mkdir -p $XDG_DATA_HOME/icons
93 for d in "${data_dirs_array[@]}"; do
94 for i in $d/icons/*; do
95 if [ -d "$i" ]; then
96 theme_dir=$XDG_DATA_HOME/icons/$(basename "$i")
97 mkdir -p "$theme_dir"
98 ln -s $i/* "$theme_dir"
99 $SNAP/usr/sbin/update-icon-caches "$theme_dir"
100 gtk-update-icon-cache-3.0 "$theme_dir"
101 fi
102 done
103 done
104fi
105
106# GTK modules
107export GTK_PATH=$SNAP/usr/lib/$ARCH/gtk-3.0
108
109exec $SNAP/usr/bin/python $SNAP/opt/bin/hello-unity
37110
=== added directory 'hello-unity/parts'
=== added directory 'hello-unity/parts/plugins'
=== added file 'hello-unity/parts/plugins/x-quilt.py'
--- hello-unity/parts/plugins/x-quilt.py 1970-01-01 00:00:00 +0000
+++ hello-unity/parts/plugins/x-quilt.py 2016-05-17 01:04:22 +0000
@@ -0,0 +1,106 @@
1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
2#
3# Author: Marco Trevisan <marco.trevisan@canonical.com>
4# Copyright (C) 2016 Canonical Ltd
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License version 3 as
8# published by the Free Software Foundation.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18"""A simple snapcraft plugin that allows to use quilt patches with any
19source package.
20
21In order to use this, the yaml file should contain:
22 - A part that only fetches the sources (you can use the copy plugin or
23 a dummy project plugin, that only extends BasePlugin)
24 - A part that uses this plugin (quilt) and that has the `after:` and
25 `target-part:` parameters containing the part defined above
26 - A part that uses the actual builder plugin for such sources, that has
27 the previous part (patches) in the `after:` list, and that uses as
28 `sources:` the sources part.
29
30For example:
31
32 parts:
33 upstream-src:
34 plugin: copy
35 source: https://github.com/ubuntu-core/snapcraft.git
36 files:
37 README.md: docs/README.md
38
39 patches:
40 plugin: quilt
41 source: https://github.com/3v1n0/my-snapcraft-patches.git
42 target-part: upstream-src
43 after: [upstream-src]
44
45 setup:
46 plugin: python3
47 source: ./parts/upstream-src/src/
48 build-packages:
49 - python-distutils-extra
50 after: [patches]
51"""
52
53import os
54import stat
55
56import snapcraft
57
58class QuiltPlugin(snapcraft.BasePlugin):
59
60 @classmethod
61 def schema(cls):
62 schema = super().schema()
63
64 schema['properties']['patches-dir'] = {
65 'type': 'string',
66 'default': '',
67 }
68
69 schema['properties']['target-part'] = {
70 'type': 'string'
71 }
72
73 schema['required'].append('target-part')
74
75 return schema
76
77 def __init__(self, name, options, project):
78 super().__init__(name, options, project)
79 self.build_packages.extend(['quilt'])
80
81 self.patch_dir = os.path.join(self.sourcedir, self.options.patches_dir)
82 self.target_dir = os.path.join(self.project.parts_dir, self.options.target_part)
83 self.target_src = os.path.join(self.target_dir, "src")
84
85 def build(self):
86 super().build()
87
88 if not os.path.exists(self.target_src) or \
89 not os.path.exists(os.path.join(self.target_dir, "state", "pull")):
90 raise EnvironmentError('Target part not fetched, fix order in yaml file: {}'.format(self.options.target_part))
91
92 if os.path.exists(self.patch_dir):
93 os.environ['QUILT_PATCHES'] = self.patch_dir
94 self.run(['quilt', 'push', '-a'], cwd=self.target_src)
95
96 def clean_build(self):
97 super().clean_build()
98
99 if os.path.exists(self.patch_dir) and \
100 os.path.exists(os.path.join(self.partdir, "state", "build")):
101 try:
102 os.environ['QUILT_PATCHES'] = self.patch_dir
103 self.run(['quilt', 'pop', '-a', '-f'], cwd=self.target_src)
104 except:
105 pass
106
0107
=== added directory 'hello-unity/patches'
=== added file 'hello-unity/patches/ignore-sound-tab-if-missing-indicator.patch'
--- hello-unity/patches/ignore-sound-tab-if-missing-indicator.patch 1970-01-01 00:00:00 +0000
+++ hello-unity/patches/ignore-sound-tab-if-missing-indicator.patch 2016-05-17 01:04:22 +0000
@@ -0,0 +1,22 @@
1Index: hello-unity-snapped/hello_unity/window.py
2===================================================================
3--- hello-unity-snapped.orig/hello_unity/window.py
4+++ hello-unity-snapped/hello_unity/window.py
5@@ -3,6 +3,7 @@
6 from gettext import gettext as _
7
8 from gi.repository import Gdk
9+from gi.repository import Gio
10 from gi.repository import Gtk
11 from gi.repository import GtkSource
12
13@@ -53,7 +54,8 @@ application can integrate with Ubuntu Un
14 self.add_section(_("Launcher"), HelloLauncher(self))
15 self.add_section(_("Indicator"), HelloIndicator(self))
16 self.add_section(_("Message Menu"), HelloMessageMenu(self))
17- self.add_section(_("Sound Menu"), HelloSoundMenu(self))
18+ if Gio.SettingsSchemaSource.get_default().lookup('com.canonical.indicator.sound', False):
19+ self.add_section(_("Sound Menu"), HelloSoundMenu(self))
20 #self.add_section(_("Dash"), hello_unity.HelloUnitySection(self))
21 self.add_section(_("Notifications"), HelloNotifications(self))
22
023
=== added file 'hello-unity/patches/series'
--- hello-unity/patches/series 1970-01-01 00:00:00 +0000
+++ hello-unity/patches/series 2016-05-17 01:04:22 +0000
@@ -0,0 +1,3 @@
1use-xdg-dirs-to-get-file-paths.patch
2ignore-sound-tab-if-missing-indicator.patch
3use-snappy-desktop-id.patch
04
=== added file 'hello-unity/patches/use-snappy-desktop-id.patch'
--- hello-unity/patches/use-snappy-desktop-id.patch 1970-01-01 00:00:00 +0000
+++ hello-unity/patches/use-snappy-desktop-id.patch 2016-05-17 01:04:22 +0000
@@ -0,0 +1,39 @@
1Index: hello-unity-snapped/hello_unity/launcher.py
2===================================================================
3--- hello-unity-snapped.orig/hello_unity/launcher.py
4+++ hello-unity-snapped/hello_unity/launcher.py
5@@ -34,7 +34,7 @@ class HelloLauncher(hello_unity.HelloUni
6
7 # Get a reference to the launcher for this application. The .desktop
8 # file give Unity information about the Application's name and icon
9- self.launcher = Unity.LauncherEntry.get_for_desktop_id("hello-unity.desktop")
10+ self.launcher = Unity.LauncherEntry.get_for_desktop_id("hello-unity_hello-unity.desktop")
11
12 # Create the quicklist menu
13 quicklist = Dbusmenu.Menuitem.new()
14Index: hello-unity-snapped/hello_unity/messagemenu.py
15===================================================================
16--- hello-unity-snapped.orig/hello_unity/messagemenu.py
17+++ hello-unity-snapped/hello_unity/messagemenu.py
18@@ -28,7 +28,7 @@ class HelloMessageMenu(hello_unity.Hello
19 def __init__(self, window):
20
21 # Create an "app" to represent the Hello Unity application
22- self.app = MessagingMenu.App.new("hello-unity.desktop")
23+ self.app = MessagingMenu.App.new("hello-unity_hello-unity.desktop")
24 self.app.connect("activate-source", self.remove_indication)
25
26 # Register this app with the messaging menu
27Index: hello-unity-snapped/hello_unity/soundmenu.py
28===================================================================
29--- hello-unity-snapped.orig/hello_unity/soundmenu.py
30+++ hello-unity-snapped/hello_unity/soundmenu.py
31@@ -41,7 +41,7 @@ class HelloSoundMenu(hello_unity.HelloUn
32 self.sound_menu_settings.set_strv('blacklisted-media-players', [p for p in self.blacklisted_players if p != 'hello-unity'])
33
34 # Create a hello-unity music player instance
35- self.player = Unity.MusicPlayer.new('hello-unity.desktop')
36+ self.player = Unity.MusicPlayer.new('hello-unity_hello-unity.desktop')
37 self.player.props.title = _('Hello Unity')
38
39 # What to do when the user presses the indicator buttons
040
=== added file 'hello-unity/patches/use-xdg-dirs-to-get-file-paths.patch'
--- hello-unity/patches/use-xdg-dirs-to-get-file-paths.patch 1970-01-01 00:00:00 +0000
+++ hello-unity/patches/use-xdg-dirs-to-get-file-paths.patch 2016-05-17 01:04:22 +0000
@@ -0,0 +1,78 @@
1Index: hello-unity-snapped/hello_unity/__init__.py
2===================================================================
3--- hello-unity-snapped.orig/hello_unity/__init__.py
4+++ hello-unity-snapped/hello_unity/__init__.py
5@@ -1,10 +1,20 @@
6 import os
7 from gi.repository import Gtk
8+from xdg.BaseDirectory import xdg_data_dirs
9
10 COLOR_ICON_PATH = 'hello-unity'
11 MONO_ICON_PATH = 'hello-unity-mono-dark'
12 ATTENTION_ICON_PATH = 'hello-unity-attention'
13
14+def get_icon_path(basename):
15+ for dir in xdg_data_dirs:
16+ path = '%s/pixmaps/%s.svg' % (dir, basename)
17+ icon = Gtk.Image.new_from_file(path)
18+ pixbuf = icon.get_pixbuf()
19+ if pixbuf:
20+ return path
21+
22+
23 class HelloUnitySection(object):
24
25 def get_controls(self):
26Index: hello-unity-snapped/hello_unity/soundmenu.py
27===================================================================
28--- hello-unity-snapped.orig/hello_unity/soundmenu.py
29+++ hello-unity-snapped/hello_unity/soundmenu.py
30@@ -2,6 +2,7 @@
31
32 # Used for making text translatable
33 from gettext import gettext as _
34+from xdg.BaseDirectory import xdg_data_dirs
35
36 # Import the base UI toolkit modules
37 from gi.repository import Gdk
38@@ -201,7 +202,9 @@ class HelloSoundMenu(hello_unity.HelloUn
39 data.props.album = "Unity Showcase"
40
41 # You can also set the cover art for this track
42- data.props.art_location = Gio.File.new_for_path('/usr/share/pixmaps/%s.svg' % hello_unity.ATTENTION_ICON_PATH)
43+ attention_icon = hello_unity.get_icon_path(hello_unity.ATTENTION_ICON_PATH)
44+ if attention_icon:
45+ data.props.art_location = Gio.File.new_for_path(attention_icon)
46
47 # Set the new track metadata as the current track in the sound menu
48 self.player.props.current_track = data
49Index: hello-unity-snapped/hello_unity/window.py
50===================================================================
51--- hello-unity-snapped.orig/hello_unity/window.py
52+++ hello-unity-snapped/hello_unity/window.py
53@@ -19,14 +19,21 @@ class HelloWindow(Gtk.Window):
54 Gtk.Window.__init__(self, title=_("Hello Unity"))
55
56 self.set_default_size(500, 500)
57- self.color_icon = Gtk.Image.new_from_file('/usr/share/pixmaps/%s.svg' % hello_unity.COLOR_ICON_PATH)
58-
59- self.set_icon(self.color_icon.get_pixbuf())
60+
61+ icon_path = hello_unity.get_icon_path(hello_unity.COLOR_ICON_PATH)
62+
63+ if icon_path:
64+ color_icon = Gtk.Image.new_from_file(icon_path)
65+ pixbuf = color_icon.get_pixbuf()
66+ self.set_icon(pixbuf)
67
68 self.content = Gtk.VBox()
69
70 self.header = Gtk.HBox()
71- self.header.pack_start(Gtk.Image.new_from_pixbuf(self.color_icon.get_pixbuf().scale_simple(64, 64, 0)), False, False, 10)
72+ if icon_path:
73+ img = Gtk.Image.new_from_pixbuf(pixbuf.scale_simple(64, 64, 0))
74+ self.header.pack_start(img, False, False, 10)
75+
76 intro = Gtk.Label()
77 intro.set_markup(_('''
78 <b>Hello Unity!</b>
079
=== added directory 'hello-unity/setup'
=== added directory 'hello-unity/setup/gui'
=== added file 'hello-unity/setup/gui/hello-unity.desktop'
--- hello-unity/setup/gui/hello-unity.desktop 1970-01-01 00:00:00 +0000
+++ hello-unity/setup/gui/hello-unity.desktop 2016-05-17 01:04:22 +0000
@@ -0,0 +1,10 @@
1[Desktop Entry]
2Name=HelloUnity
3X-GNOME-FullName=Hello Unity
4Comment=Unity Integration Showcase
5Categories=GNOME;Utility;
6Exec=hello-unity
7Icon=${SNAP}/usr/share/pixmaps/hello-unity.svg
8Terminal=false
9Type=Application
10Version=0.4
011
=== removed file 'hello-unity/snapcraft.log'
--- hello-unity/snapcraft.log 2016-04-09 02:39:30 +0000
+++ hello-unity/snapcraft.log 1970-01-01 00:00:00 +0000
@@ -1,40 +0,0 @@
1Preparing to pull hello-unity
2
3Hit http://us.archive.ubuntu.com/ubuntu xenial InRelease0Hit http://us.archive.ubuntu.com/ubuntu xenial InRelease
4
5Hit http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease1Hit http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease
6
7Hit http://security.ubuntu.com/ubuntu xenial-security InRelease2Hit http://security.ubuntu.com/ubuntu xenial-security InRelease
8
9Fetched 0 B in 0s (0 B/s)3Fetched 0 B in 0s (0 B/s)
10Skipping blacklisted from manifest packages: ['adduser', 'apt', 'apt-utils', 'base-files', 'base-passwd', 'bash', 'bsdutils', 'coreutils', 'dash', 'debconf', 'debconf-i18n', 'debianutils', 'diffutils', 'dmsetup', 'dpkg', 'e2fslibs', 'e2fsprogs', 'file', 'findutils', 'gcc-4.9-base', 'gcc-5-base', 'gnupg', 'gpgv', 'grep', 'gzip', 'hostname', 'init', 'initscripts', 'insserv', 'libacl1', 'libapparmor1', 'libattr1', 'libaudit-common', 'libaudit1', 'libblkid1', 'libbz2-1.0', 'libc-bin', 'libc6', 'libcap2', 'libcap2-bin', 'libcomerr2', 'libcryptsetup4', 'libdb5.3', 'libdebconfclient0', 'libdevmapper1.02.1', 'libgcc1', 'libgcrypt20', 'libgpg-error0', 'libgpm2', 'libkmod2', 'liblocale-gettext-perl', 'liblzma5', 'libmagic1', 'libmount1', 'libncurses5', 'libncursesw5', 'libpam-modules', 'libpam-modules-bin', 'libpam-runtime', 'libpam0g', 'libpcre3', 'libreadline6', 'libselinux1', 'libsemanage-common', 'libsemanage1', 'libsepol1', 'libslang2', 'libsmartcols1', 'libss2', 'libstdc++6', 'libsystemd0', 'libtext-charwidth-perl', 'libtext-iconv-perl', 'libtext-wrapi18n-perl', 'libtinfo5', 'libudev1', 'libusb-0.1-4', 'libustr-1.0-1', 'libuuid1', 'locales', 'login', 'lsb-base', 'makedev', 'manpages', 'manpages-dev', 'mawk', 'mount', 'multiarch-support', 'ncurses-base', 'ncurses-bin', 'passwd', 'perl-base', 'procps', 'readline-common', 'sed', 'sensible-utils', 'systemd', 'systemd-sysv', 'sysv-rc', 'sysvinit-utils', 'tar', 'tzdata', 'ubuntu-keyring', 'udev', 'util-linux', 'zlib1g']
11
12Fetched 0 B in 0s (0 B/s)4Fetched 0 B in 0s (0 B/s)
13Pulling hello-unity
14No revisions or tags to pull.
15python2 /home/mhall/projects/Ubuntu/snaps/snappy-playpen/hello-unity/parts/hello-unity/install/usr/bin/easy_install --prefix /home/mhall/projects/Ubuntu/snaps/snappy-playpen/hello-unity/parts/hello-unity/install/usr pip
16Searching for pip
17Best match: pip 8.1.1
18Processing pip-8.1.1-py2.7.egg
19pip 8.1.1 is already the active version in easy-install.pth
20Installing pip script to /home/mhall/projects/Ubuntu/snaps/snappy-playpen/hello-unity/parts/hello-unity/install/usr/bin
21Installing pip2.7 script to /home/mhall/projects/Ubuntu/snaps/snappy-playpen/hello-unity/parts/hello-unity/install/usr/bin
22Installing pip2 script to /home/mhall/projects/Ubuntu/snaps/snappy-playpen/hello-unity/parts/hello-unity/install/usr/bin
23
24Using /home/mhall/projects/Ubuntu/snaps/snappy-playpen/hello-unity/parts/hello-unity/install/usr/lib/python2.7/dist-packages/pip-8.1.1-py2.7.egg
25Processing dependencies for pip
26Finished processing dependencies for pip
27python2 /home/mhall/projects/Ubuntu/snaps/snappy-playpen/hello-unity/parts/hello-unity/install/usr/bin/pip2 install --global-option=build_ext --global-option=-I/home/mhall/projects/Ubuntu/snaps/snappy-playpen/hello-unity/parts/hello-unity/install/usr/include/python2.7 --target /home/mhall/projects/Ubuntu/snaps/snappy-playpen/hello-unity/parts/hello-unity/install/usr/lib/python2.7/site-packages .
28Processing /home/mhall/projects/Ubuntu/snaps/snappy-playpen/hello-unity/parts/hello-unity/src
29Installing collected packages: hello-unity
30 Running setup.py install for hello-unity: started
31 Running setup.py install for hello-unity: finished with status 'error'
32 Complete output from command /home/mhall/projects/Ubuntu/snaps/snappy-playpen/hello-unity/parts/hello-unity/install/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-WmPupa-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" build_ext -I/home/mhall/projects/Ubuntu/snaps/snappy-playpen/hello-unity/parts/hello-unity/install/usr/include/python2.7 install --record /tmp/pip-GIIwsc-record/install-record.txt --single-version-externally-managed --compile --home=/tmp/tmpKTEaYf:
33 ERROR: Python module indicator not found
34 ERROR: Python module launcher not found
35 ERROR: Python module messagemenu not found
36 ERROR: Python module soundmenu not found
37 ERROR: Python module notifications not found
38 usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
39 or: -c --help [cmd1 cmd2 ...]
40 or: -c --help-commands
41 or: -c cmd --help
42
43 error: option --single-version-externally-managed not recognized
44
45 ----------------------------------------
465
=== modified file 'hello-unity/snapcraft.yaml'
--- hello-unity/snapcraft.yaml 2016-04-14 14:47:59 +0000
+++ hello-unity/snapcraft.yaml 2016-05-17 01:04:22 +0000
@@ -1,5 +1,5 @@
1name: hello-unity1name: hello-unity
2version: 0.4-snap12version: 0.4-snap2
3summary: Unity APIs demonstration tool3summary: Unity APIs demonstration tool
4description: Simple tool for demonstrating Unity's integration APIs4description: Simple tool for demonstrating Unity's integration APIs
55
@@ -9,21 +9,54 @@
9 plugs: [unity7]9 plugs: [unity7]
1010
11parts:11parts:
12 hello-unity:12 upstream-src:
13 plugin: python213 plugin: copy
14 source: lp:hello-unity14 source: lp:hello-unity
15 source-type: bzr15 source-type: bzr
16 files:
17 hello-unity: opt/bin/hello-unity
18 hello-unity.svg: usr/share/pixmaps/hello-unity.svg
19 hello-unity-mono-light.svg: usr/share/pixmaps/hello-unity-mono-light.svg
20 hello-unity-attention.svg: usr/share/pixmaps/hello-unity-attention.svg
21 hello-unity-mono-dark.svg: usr/share/pixmaps/hello-unity-mono-dark.svg
22
23 patches:
24 plugin: quilt
25 source: ./patches
26 stage-packages: [python-xdg]
27 target-part: upstream-src
28 after: [upstream-src]
29
30 setup:
31 plugin: python2
32 source: ./parts/upstream-src/src/
16 build-packages:33 build-packages:
17 - python-distutils-extra34 - python-distutils-extra
35 after: [patches]
36
37 deps:
38 plugin: nil
18 stage-packages:39 stage-packages:
19 - python-distutils-extra40 - python-gi
20 - gir1.2-unity-5.041 - gir1.2-unity-5.0
21 - gir1.2-notify-0.742 - gir1.2-notify-0.7
22 - gir1.2-appindicator3-0.143 - gir1.2-appindicator3-0.1
23 - gir1.2-indicate-0.744 - gir1.2-indicate-0.7
45 - gir1.2-messagingmenu-1.0
24 - gir1.2-gtk-3.046 - gir1.2-gtk-3.0
25 - gir1.2-gtksource-3.047 - gir1.2-gtksource-3.0
2648
49 integration:
50 plugin: nil
51 stage-packages:
52 - dmz-cursor-theme
53 - indicator-sound
54 - light-themes
55 - ttf-ubuntu-font-family
56 snap:
57 - usr/share
58 - -usr/share/doc
59
27 environment:60 environment:
28 plugin: copy61 plugin: copy
29 files:62 files:

Subscribers

People subscribed via source and target branches