summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorJussi Kukkonen <jussi.kukkonen@intel.com>2015-06-09 16:46:38 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-16 20:39:15 +0100
commit5e7f26d082bfedbbdac9607b5e0d4ed90a01d50f (patch)
tree9a84efa5acd14d34dc2971d932ed4b3461a935b3 /meta
parent5863080b299fe8c8751f4c30dbd5d2e553df3d27 (diff)
downloadpoky-5e7f26d082bfedbbdac9607b5e0d4ed90a01d50f.tar.gz
gtk-icon-utils: Rename, upgrade, add binary
* Rename from gtk-update-icon-cache to gtk-icon-utils to better reflect the content. Fix references in other recipes and classes * Upgrade to GTK+ 3.16.4 * Add gtk-encode-symbolic-svg binary: it is used by icon themes (e.g. Adwaita) to generate png versions of svg icons. * Depend on librsvg-native for gtk-encode-symbolic-svg * Add a patch that removes Gdk dependency from gtk-encode-symbolic-svg: this way the native build stays slim. (From OE-Core rev: 5f4fe36f735ff8b97c5112b16bd90e794053573d) Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/gtk-icon-cache.bbclass2
-rw-r--r--meta/classes/sstate.bbclass2
-rw-r--r--meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.16.4.bb63
-rw-r--r--meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch102
-rw-r--r--meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb47
5 files changed, 167 insertions, 49 deletions
diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass
index 16e31b94b9..12358e3aed 100644
--- a/meta/classes/gtk-icon-cache.bbclass
+++ b/meta/classes/gtk-icon-cache.bbclass
@@ -1,6 +1,6 @@
1FILES_${PN} += "${datadir}/icons/hicolor" 1FILES_${PN} += "${datadir}/icons/hicolor"
2 2
3DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} gtk-update-icon-cache-native" 3DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} gtk-icon-utils-native"
4 4
5gtk_icon_cache_postinst() { 5gtk_icon_cache_postinst() {
6if [ "x$D" != "x" ]; then 6if [ "x$D" != "x" ]; then
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 2a050dc7bc..4e6afef541 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -815,7 +815,7 @@ def setscene_depvalid(task, taskdependees, notneeded, d):
815 return x.endswith("-native") or "-cross-" in x or "-crosssdk" in x 815 return x.endswith("-native") or "-cross-" in x or "-crosssdk" in x
816 816
817 def isPostInstDep(x): 817 def isPostInstDep(x):
818 if x in ["qemu-native", "gdk-pixbuf-native", "qemuwrapper-cross", "depmodwrapper-cross", "systemd-systemctl-native", "gtk-update-icon-cache-native"]: 818 if x in ["qemu-native", "gdk-pixbuf-native", "qemuwrapper-cross", "depmodwrapper-cross", "systemd-systemctl-native", "gtk-icon-utils-native"]:
819 return True 819 return True
820 return False 820 return False
821 821
diff --git a/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.16.4.bb b/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.16.4.bb
new file mode 100644
index 0000000000..d433b9077b
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.16.4.bb
@@ -0,0 +1,63 @@
1SUMMARY = "Native icon utils for GTK+"
2DESCRIPTION = "gtk-update-icon-cache and gtk-encode-symbolic-svg built from GTK+ natively, for build time and on-host postinst script execution."
3SECTION = "libs"
4
5DEPENDS = "glib-2.0-native gdk-pixbuf-native librsvg-native"
6
7LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
8
9MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
10
11SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar.xz \
12 file://Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch"
13SRC_URI[md5sum] = "c7497aaf6730524a127597b768a73bd7"
14SRC_URI[sha256sum] = "1ee5dbd7a4cb81a91eaa1b7ae64ba5a3eab6a3c0a764155583ab96524590fc8e"
15
16LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
17 file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \
18 file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \
19 file://tests/testgtk.c;endline=25;md5=cb732daee1d82af7a2bf953cf3cf26f1"
20
21S = "${WORKDIR}/gtk+-${PV}"
22
23inherit pkgconfig native
24
25PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native"
26
27do_configure() {
28 # Quite ugly but defines enough to compile the tools.
29 if ! test -f gtk/config.h; then
30 echo "#define GETTEXT_PACKAGE \"gtk30\"" >> gtk/config.h
31 echo "#define HAVE_UNISTD_H 1" >> gtk/config.h
32 echo "#define HAVE_FTW_H 1" >> gtk/config.h
33 fi
34 if ! test -f gdk/config.h; then
35 touch gdk/config.h
36 fi
37}
38
39do_compile() {
40 ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
41 ${S}/gtk/updateiconcache.c \
42 $(${PKG_CONFIG_FOR_BUILD} --cflags --libs gdk-pixbuf-2.0) \
43 -o gtk-update-icon-cache
44
45 ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
46 ${S}/gtk/encodesymbolic.c \
47 $(${PKG_CONFIG_FOR_BUILD} --cflags --libs gio-2.0 gdk-pixbuf-2.0) \
48 -o gtk-encode-symbolic-svg
49}
50
51do_install() {
52 install -d ${D}${bindir}
53 install -m 0755 ${B}/gtk-update-icon-cache ${D}${bindir}
54 install -m 0755 ${B}/gtk-encode-symbolic-svg ${D}${bindir}
55
56 create_wrapper ${D}/${bindir}/gtk-update-icon-cache \
57 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
58 create_wrapper ${D}/${bindir}/gtk-encode-symbolic-svg \
59 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
60}
61
62# Prevent bitbake from optimizing away the native librsvg sysroot population
63do_populate_sysroot_setscene[depends] += "librsvg-native:do_populate_sysroot_setscene"
diff --git a/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch b/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch
new file mode 100644
index 0000000000..237f803755
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch
@@ -0,0 +1,102 @@
1From 4d09ff324419fe4e671233044e424378da53969b Mon Sep 17 00:00:00 2001
2From: Jussi Kukkonen <jussi.kukkonen@intel.com>
3Date: Tue, 9 Jun 2015 14:20:30 +0300
4Subject: [PATCH] Remove Gdk-dependency from gtk-encode-symbolic-svg
5
6Building gtk-encode-symbolic-svg without building Gdk is useful
7as only the icon tools are needed on the native build: this makes
8native build much faster and requires much less dependencies.
9
10Upstream-Status: Pending
11
12Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
13---
14 gtk/encodesymbolic.c | 36 ++++++++++--------------------------
15 1 file changed, 10 insertions(+), 26 deletions(-)
16
17diff --git a/gtk/encodesymbolic.c b/gtk/encodesymbolic.c
18index 9f7d015..1f07563 100644
19--- a/gtk/encodesymbolic.c
20+++ b/gtk/encodesymbolic.c
21@@ -19,7 +19,6 @@
22
23 #include <glib.h>
24 #include <gdk-pixbuf/gdk-pixdata.h>
25-#include <gdk/gdk.h>
26 #include <glib/gi18n.h>
27
28 #ifdef HAVE_UNISTD_H
29@@ -43,30 +42,18 @@ static GdkPixbuf *
30 load_symbolic_svg (char *file_data, gsize file_len,
31 int width,
32 int height,
33- const GdkRGBA *fg,
34- const GdkRGBA *success_color,
35- const GdkRGBA *warning_color,
36- const GdkRGBA *error_color,
37+ const char *css_fg,
38+ const char *css_success,
39+ const char *css_warning,
40+ const char *css_error,
41 GError **error)
42 {
43 GInputStream *stream;
44 GdkPixbuf *pixbuf;
45- gchar *css_fg;
46- gchar *css_success;
47- gchar *css_warning;
48- gchar *css_error;
49 gchar *data;
50 gchar *svg_width, *svg_height;
51 gchar *escaped_file_data;
52
53- css_fg = gdk_rgba_to_string (fg);
54-
55- css_success = css_warning = css_error = NULL;
56-
57- css_warning = gdk_rgba_to_string (warning_color);
58- css_error = gdk_rgba_to_string (error_color);
59- css_success = gdk_rgba_to_string (success_color);
60-
61 /* Fetch size from the original icon */
62 stream = g_memory_input_stream_new_from_data (file_data, file_len, NULL);
63 pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, error);
64@@ -105,10 +92,6 @@ load_symbolic_svg (char *file_data, gsize file_len,
65 "</svg>",
66 NULL);
67 g_free (escaped_file_data);
68- g_free (css_fg);
69- g_free (css_warning);
70- g_free (css_error);
71- g_free (css_success);
72 g_free (svg_width);
73 g_free (svg_height);
74
75@@ -167,7 +150,8 @@ make_symbolic_pixbuf (char *file,
76 GError **error)
77
78 {
79- GdkRGBA r = { 1,0,0,1}, g = {0,1,0,1};
80+ const char r[] = "rgba(255,0,0,1)";
81+ const char g[] = "rgba(0,255,0,1)";
82 GdkPixbuf *loaded;
83 GdkPixbuf *pixbuf;
84 int plane;
85@@ -196,10 +180,10 @@ make_symbolic_pixbuf (char *file,
86 * the "rest", as all color fractions should add up to 1.
87 */
88 loaded = load_symbolic_svg (file_data, file_len, width, height,
89- &g,
90- plane == 0 ? &r : &g,
91- plane == 1 ? &r : &g,
92- plane == 2 ? &r : &g,
93+ g,
94+ plane == 0 ? r : g,
95+ plane == 1 ? r : g,
96+ plane == 2 ? r : g,
97 error);
98 if (loaded == NULL)
99 return NULL;
100--
1012.1.4
102
diff --git a/meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb b/meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb
deleted file mode 100644
index 73b7644845..0000000000
--- a/meta/recipes-gnome/gtk+/gtk-update-icon-cache-native_3.4.4.bb
+++ /dev/null
@@ -1,47 +0,0 @@
1SUMMARY = "gtk-update-icon-cache built natively"
2DESCRIPTION = "Just gtk-update-icon-cache built from GTK+ natively, for on-host postinst script execution."
3SECTION = "libs"
4
5DEPENDS = "gdk-pixbuf-native"
6
7LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
8
9LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
10 file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \
11 file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \
12 file://tests/testgtk.c;endline=25;md5=cb732daee1d82af7a2bf953cf3cf26f1"
13
14SRC_URI = "http://download.gnome.org/sources/gtk+/3.4/gtk+-${PV}.tar.xz"
15SRC_URI[md5sum] = "1b2cf29502a6394e8d4b30f7f5bb9131"
16SRC_URI[sha256sum] = "f154e460075034da4c0ce89c320025dcd459da2a1fdf32d92a09522eaca242c7"
17
18S = "${WORKDIR}/gtk+-${PV}"
19
20inherit pkgconfig native
21
22PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native"
23
24do_configure() {
25 # Quite ugly but defines enough to compile the tool.
26 if ! test -f gtk/config.h; then
27 echo "#define GETTEXT_PACKAGE \"gtk30\"" >> gtk/config.h
28 echo "#define HAVE_UNISTD_H 1" >> gtk/config.h
29 echo "#define HAVE_FTW_H 1" >> gtk/config.h
30
31 fi
32}
33
34do_compile() {
35 ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} ${S}/gtk/updateiconcache.c \
36 $(${PKG_CONFIG_FOR_BUILD} --cflags --libs gdk-pixbuf-2.0) \
37 -o gtk-update-icon-cache
38}
39
40do_install() {
41 install -d ${D}${bindir}
42 install -m 0755 ${B}/gtk-update-icon-cache ${D}${bindir}
43
44 create_wrapper ${D}/${bindir}/gtk-update-icon-cache \
45 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
46
47}