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

Proposed by Cris Dywan
Status: Merged
Approved by: Cody Garver
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
axlrose112 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.
Revision history for this message
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);

Revision history for this message
RabbitBot (rabbitbot-a) wrote :

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

Revision history for this message
Cody Garver (codygarver) :
review: Approve

Preview Diff

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

Subscribers

People subscribed via source and target branches

to all changes: