Merge lp:~midori/midori/snapcraft into lp:midori

Proposed by Christian Dywan on 2017-09-03
Status: Merged
Approved by: Cody Garver on 2017-10-06
Approved revision: 7171
Merged at revision: 7166
Proposed branch: lp:~midori/midori/snapcraft
Merge into: lp:midori
Diff against target: 185 lines (+121/-21)
4 files modified
config/CMakeLists.txt (+1/-1)
midori/midori-app.c (+5/-17)
midori/midori-view.c (+6/-3)
snap/snapcraft.yaml (+109/-0)
To merge this branch: bzr merge lp:~midori/midori/snapcraft
Reviewer Review Type Date Requested Status
Cody Garver (community) Approve on 2017-10-06
axlrose112 2017-09-03 Pending
Review via email: mp+330129@code.launchpad.net

Commit message

Snap packaging

Description of the change

Adds a snapcraft.yaml to build a Midori snap, built with WebKit2 and GTK+3.

This also includes a CMake build fix, a missing icon info NULL-check and uses a simpler hash for the GApplication.name exposed over DBus so that it works with confinement.

To post a comment you must log in.
axlrose112 (axlrose112) wrote :

I got Segmentation fault and after ran it with gb I got:

Program received signal SIGSEGV, Segmentation fault.
0x00000008008c18de in midori_view_apply_icon (view=0x856444200, icon=0x856451790, icon_name=0x0)
at /home/jamesaxl/Hacking/LaunchPad/snapcraft/midori/midori-view.c:449
449 g_warning ("Could not load pixbuf for icon '%s': %s\n", icon_name, error->message);

RabbitBot (rabbitbot-a) wrote :

Voting does not meet specified criteria. Required: Approve >= 1. Got: 1 Pending.

Cody Garver (codygarver) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config/CMakeLists.txt'
2--- config/CMakeLists.txt 2013-10-11 21:08:57 +0000
3+++ config/CMakeLists.txt 2017-10-05 23:14:53 +0000
4@@ -6,7 +6,7 @@
5 file (GLOB_RECURSE CONFIG_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
6 list (REMOVE_ITEM CONFIG_FILES "CMakeLists.txt")
7
8-if (${CMAKE_INSTALL_PREFIX} STREQUAL "/usr")
9+if (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
10 set(CMAKE_INSTALL_SYSCONFDIR "/etc")
11 endif()
12
13
14=== modified file 'midori/midori-app.c'
15--- midori/midori-app.c 2016-01-15 19:18:17 +0000
16+++ midori/midori-app.c 2017-10-05 23:14:53 +0000
17@@ -593,26 +593,14 @@
18 return;
19
20 const gchar* config = midori_paths_get_config_dir_for_reading ();
21- gchar* config_hash = g_compute_checksum_for_string (G_CHECKSUM_MD5, config, -1);
22- gchar* name_hash = g_compute_checksum_for_string (G_CHECKSUM_MD5, app_name, -1);
23- katze_assign (app_name, g_strconcat (PACKAGE_NAME,
24- "_", config_hash, "_", name_hash, NULL));
25+ gchar* config_hash = g_strdup_printf ("%u", g_str_hash (config));
26+ gchar* config_hash_truncated = g_strndup (config_hash, 5);
27+ katze_assign (app_name, g_strdup_printf (
28+ "de.twotoasts.%s-%s", PACKAGE_NAME, config_hash_truncated));
29 g_free (config_hash);
30- g_free (name_hash);
31+ g_free (config_hash_truncated);
32 g_object_notify (G_OBJECT (app), "name");
33
34- GdkDisplay* display = gdk_display_get_default ();
35- #ifdef GDK_WINDOWING_X11
36- /* On X11: :0 or :0.0 which is equivalent */
37- gchar* display_name = g_strndup (gdk_display_get_name (display), 2);
38- #else
39- gchar* display_name = g_strdup (gdk_display_get_name (display));
40- #endif
41- g_strdelimit (display_name, ":.\\/", '_');
42- gchar* instance_name = g_strdup_printf ("de.twotoasts.%s_%s", app_name, display_name);
43- g_free (display_name);
44- katze_assign (app_name, instance_name);
45-
46 if (midori_debug ("app"))
47 g_print ("app registering %s\n", app_name);
48 g_object_set (app,
49
50=== modified file 'midori/midori-view.c'
51--- midori/midori-view.c 2016-02-28 00:07:54 +0000
52+++ midori/midori-view.c 2017-10-05 23:14:53 +0000
53@@ -442,11 +442,14 @@
54 #endif
55 0);
56
57- pixbuf = gtk_icon_info_load_icon (icon_info, &error);
58+ if (icon_info)
59+ pixbuf = gtk_icon_info_load_icon (icon_info, &error);
60 g_strfreev (icon_names);
61 if (pixbuf == NULL) {
62- g_warning ("Could not load pixbuf for icon '%s': %s\n", icon_name, error->message);
63- g_clear_error (&error);
64+ if (error != NULL) {
65+ g_warning ("Could not load pixbuf for icon '%s': %s\n", icon_name, error->message);
66+ g_clear_error (&error);
67+ }
68
69 /* view->icon cannot be set to NULL, so we simply leave it as-is */
70 return;
71
72=== added directory 'snap'
73=== added file 'snap/snapcraft.yaml'
74--- snap/snapcraft.yaml 1970-01-01 00:00:00 +0000
75+++ snap/snapcraft.yaml 2017-10-05 23:14:53 +0000
76@@ -0,0 +1,109 @@
77+name: midori
78+version: bzr
79+version-script: |
80+ set -x
81+ VERSION=$(grep -r "^set(VERSION" CMakeLists.txt | sed -r "s@.+ ([0-9.]+)\)@\1@")
82+ REVISION=$(bzr revno)
83+ echo $VERSION~r$REVISION
84+summary: a lightweight, fast, and free web browser
85+description: |
86+ Midori is a fast little WebKit browser with support for HTML5. It can manage
87+ many open tabs and windows. The URL bar completes history, bookmarks, search
88+ engines and open tabs out of the box. Web developers can use the powerful
89+ web inspector that is a part of WebKit. Individual pages can easily be turned
90+ into web apps and new profiles can be created on demand.
91+
92+ A number of extensions are included by default:
93+
94+ * Adblock with support for ABP filter lists and custom rules is built-in.
95+ * You can download files with Aria2 or SteadyFlow.
96+ * User scripts and styles support a la Greasemonkey.
97+ * Managing cookies and scripts via NoJS and Cookie Security Manager.
98+ * Switching open tabs in a vertical panel or a popup window.
99+
100+grade: stable
101+confinement: strict
102+icon: icons/scalable/apps/midori.svg
103+
104+apps:
105+ midori:
106+ command: desktop-launch snapcraft-preload midori
107+ plugs:
108+ - home
109+ - pulseaudio
110+ - network
111+ - camera
112+ - removable-media
113+ - unity7
114+ - wayland
115+ - mir
116+ - screen-inhibit-control
117+ - password-manager-service
118+ - gsettings
119+ - network-bind
120+ - location-observe
121+ - network-status
122+ desktop: share/applications/midori.desktop
123+ environment:
124+ LD_LIBRARY_PATH: $SNAP/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/:$LD_LIBRARY_PATH
125+ # Work-around GPU crash https://bugs.webkit.org/show_bug.cgi?id=126122
126+ WEBKIT_DISABLE_COMPOSITING_MODE: 1
127+ GTK_CSD: 1
128+ # No Netscape plugins
129+ MOZ_PLUGIN_PATH: /
130+
131+slots:
132+ dbus:
133+ name: de.twotoasts.midori
134+ bus: session
135+
136+parts:
137+ midori:
138+ plugin: cmake
139+ configflags:
140+ - -DCMAKE_INSTALL_DATADIR=/usr/share
141+ - -DHALF_BRO_INCOM_WEBKIT2=1
142+ - -DUSE_ZEITGEIST=0
143+ build-packages:
144+ - bzr
145+ - valac
146+ - libwebkit2gtk-4.0-dev
147+ - libsoup-gnome2.4-dev
148+ - libgcr-3-dev
149+ - libsqlite3-dev
150+ - librsvg2-bin
151+ - intltool
152+ install: |
153+ echo "[settings]\n" \
154+ "toolbar-items=" \
155+ "TabNew,Back,NextForward,ReloadStop,BookmarkAdd,Location,Trash,CompactMenu\n" \
156+ "show-statusbar=false\n" \
157+ > $SNAPCRAFT_PART_INSTALL/etc/xdg/midori/config
158+ stage-packages:
159+ - libwebkit2gtk-4.0-37
160+ - libcanberra-gtk3-module
161+ - myspell-en-us
162+ - gnome-icon-theme-symbolic
163+ - gstreamer1.0-x
164+ - gstreamer1.0-plugins-base
165+ - gstreamer1.0-plugins-good
166+ - gstreamer1.0-plugins-bad
167+ - gstreamer1.0-plugins-ugly
168+ - gstreamer1.0-pulseaudio
169+ - pulseaudio-module-x11
170+ - libmirclient9
171+ stage:
172+ - -share/applications/midori-private.desktop
173+ - -usr/lib/x86_64-linux-gnu/libcups.so.2
174+ - -usr/share/doc/libcups2/changelog.Debian.gz
175+ - -usr/share/doc
176+ after:
177+ - desktop-gtk3
178+ - snapcraft-preload
179+ snapcraft-preload:
180+ source: https://github.com/kalikiana/snapcraft-preload.git
181+ source-branch: webkitgtk2
182+ plugin: cmake
183+ build-packages:
184+ - gcc-multilib
185+ - g++-multilib

Subscribers

People subscribed via source and target branches

to all changes: