Skip to contentSkip to conversation

gdk-pixbuf and librsvg fixes

PATCH In review Ross Burton 1 participant 7 messages May 17, 2013

lore
Share & tools
lore
#0 lore raw

cover gdk-pixbuf and librsvg fixes

Hi,

A collection of fixes to gdk-pixbuf and librsvg, mainly improving the native packages.

Ross

The following changes since commit 88a7b041fbf2583472aa9408a33dd8881223a0c1:

bitbake: pysh: Say what kind of token isn't implemented (2013-05-10 13:35:10 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib ross/pixbuf

for you to fetch changes up to 28ba5f0003c131377c4cff9bcd35c7eeabbb4f21:

librsvg: small cleanups (2013-05-17 10:36:19 +0100)

----------------------------------------------------------------
Ross Burton (5):
pixbufcache: update the loader cache when installing natively
gdk-pixbuf: remove native loader cache generation, use the class
librsvg: add more PACKAGECONFIG options
librsvg: clean up native depends
librsvg: small cleanups

 meta/classes/pixbufcache.bbclass                   |   13 +++++++++
 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.26.5.bb |    3 --
 meta/recipes-gnome/librsvg/librsvg_2.32.1.bb       |   30 +++++++++-----------
 3 files changed, 27 insertions(+), 19 deletions(-)

Ross Burton (5):
pixbufcache: update the loader cache when installing natively
gdk-pixbuf: remove native loader cache generation, use the class
librsvg: add more PACKAGECONFIG options
librsvg: clean up native depends
librsvg: small cleanups

 meta/classes/pixbufcache.bbclass                   |   13 +++++++++
 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.26.5.bb |    3 --
 meta/recipes-gnome/librsvg/librsvg_2.32.1.bb       |   30 +++++++++-----------
 3 files changed, 27 insertions(+), 19 deletions(-)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/5 pixbufcache: update the loader cache when installing natively

Register a sstate postinst function so that when installing a native package, the gdk-pixbuf loader cache is updated.

---
 meta/classes/pixbufcache.bbclass |   13 +++++++++++++
 1 file changed, 13 insertions(+)
meta/classes/pixbufcache.bbclass +13 -0
index 37bf812..0596018 100644
@@ -44,3 +44,16 @@ python populate_packages_append() {
         postrm += d.getVar('pixbufcache_common', True)
         d.setVar('pkg_postrm_%s' % pkg, postrm)
 }
+
+#
+# Add a sstate postinst hook to update the cache for native packages
+#
+DEPENDS_append_class-native = " gdk-pixbuf-native"
+SSTATEPOSTINSTFUNCS_append_class-native = " pixbufcache_sstate_postinst"
+
+pixbufcache_sstate_postinst() {
+	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+	then
+		gdk-pixbuf-query-loaders --update-cache
+	fi
+}
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 2/5 gdk-pixbuf: remove native loader cache generation, use the class

In reply to Ross Burton

We assumed that the only relevant gdk-pixbuf loaders in the native environment were the ones in gdk-pixbuf itself, as the icon cache is only for PNG files. However, glib-compile-resources can transform SVG files to raw image data, and done natively this requires the SVG loader to be registered. The current implementation relies on this assumption by generating the cache based on the staging directory during install, so if gdk-pixbuf-native is re-installed to the sysroot after librsvg-native it will overwrite the loader cache.

So, remove the code in do_install that updated the cache, and rely on the new logic in pixbufcache.bbclass that updates the cache when it's installed into the sysroot itself.

---
 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.26.5.bb |    3 ---
 1 file changed, 3 deletions(-)
meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.26.5.bb +0 -3
index b35f7c6..b85bbaf 100644
@@ -69,9 +69,6 @@ python populate_packages_prepend () {
 }
 
 do_install_append_class-native() {
-#Use wrapper script rather than binary as required libtool library is not installed now
-	GDK_PIXBUF_MODULEDIR=${D}${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders ${B}/gdk-pixbuf/gdk-pixbuf-query-loaders > ${D}${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
-	sed -i -e 's#${D}##g' ${D}${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
 	find ${D}${libdir} -name "libpixbufloader-*.la" -exec rm \{\} \;
 
 	create_wrapper ${D}/${bindir}/gdk-pixbuf-csource \
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH 3/5 librsvg: add more PACKAGECONFIG options

In reply to Ross Burton

Add options for the gdk-pixbuf loaders and the GTK+ 2 theme engine. The theme engine is generally unused so don't enable that by default, but enable the gdk-pixbuf loader and also enable the croco feature which is required for parsing CSS embedded into SVG.

---
 meta/recipes-gnome/librsvg/librsvg_2.32.1.bb |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
meta/recipes-gnome/librsvg/librsvg_2.32.1.bb +7 -4
index ff17cf7..980c01c 100644
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
                     file://rsvg.h;beginline=3;endline=24;md5=20b4113c4909bbf0d67e006778302bc6"
 
 SECTION = "x11/utils"
-DEPENDS = "gtk+ cairo libxml2"
+DEPENDS = "cairo glib-2.0 gdk-pixbuf fontconfig freetype libxml2 pango"
 DEPENDS_class-native = "cairo-native pango-native gdk-pixbuf-native"
 BBCLASSEXTEND = "native"
 
@@ -17,11 +17,14 @@ inherit autotools pkgconfig gnome gtk-doc pixbufcache
 
 EXTRA_OECONF = "--disable-mozilla-plugin --without-svgz"
 
-PACKAGECONFIG ??= "croco"
-# When native we can manage without croco, as it's only for GTK+
-PACKAGECONFIG_class-native = ""
+PACKAGECONFIG ??= "croco gdkpixbuf"
 
+# Support embedded CSS stylesheets (recommended upstream)
 PACKAGECONFIG[croco] = "--with-croco,--without-croco,libcroco"
+# gdk-pixbuf loader
+PACKAGECONFIG[gdkpixbuf] = "--enable-pixbuf-loader,--disable-pixbuf-loader"
+# GTK+ 2 theme engine
+PACKAGECONFIG[gtk] = "--enable-gtk-theme,--disable-gtk-theme,gtk+"
 
 SRC_URI += "file://doc_Makefile.patch \
 	    file://librsvg-CVE-2011-3146.patch \
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH 4/5 librsvg: clean up native depends

In reply to Ross Burton

inherit gnome was only used for the SRC_URI, so just inherit gnomebase and remove the native-specific DEPENDS which was only required as the gnome class pulls in an impossible hicolor-icon-theme-native dependency.

---
 meta/recipes-gnome/librsvg/librsvg_2.32.1.bb |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta/recipes-gnome/librsvg/librsvg_2.32.1.bb +1 -2
index 980c01c..f50c1a8 100644
@@ -8,12 +8,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
 
 SECTION = "x11/utils"
 DEPENDS = "cairo glib-2.0 gdk-pixbuf fontconfig freetype libxml2 pango"
-DEPENDS_class-native = "cairo-native pango-native gdk-pixbuf-native"
 BBCLASSEXTEND = "native"
 
 PR = "r12"
 
-inherit autotools pkgconfig gnome gtk-doc pixbufcache
+inherit autotools pkgconfig gnomebase gtk-doc pixbufcache
 
 EXTRA_OECONF = "--disable-mozilla-plugin --without-svgz"
 
Signature · 1 line
1.7.10.4
#6 lore raw

PATCH 5/5 librsvg: small cleanups

In reply to Ross Burton

Re-order fields to a more logical order.

Remove the unrecognised --disable-mozilla-plugin option.

Remove the unrequired setting of GDK_PIXBUF_QUERYLOADERS, it's found automatically.

---
 meta/recipes-gnome/librsvg/librsvg_2.32.1.bb |   20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
meta/recipes-gnome/librsvg/librsvg_2.32.1.bb +8 -12
index f50c1a8..6594bf0 100644
@@ -14,7 +14,14 @@ PR = "r12"
 
 inherit autotools pkgconfig gnomebase gtk-doc pixbufcache
 
-EXTRA_OECONF = "--disable-mozilla-plugin --without-svgz"
+SRC_URI += "file://doc_Makefile.patch \
+            file://librsvg-CVE-2011-3146.patch \
+           "
+
+SRC_URI[archive.md5sum] = "4b00d0fee130c936644892c152f42db7"
+SRC_URI[archive.sha256sum] = "91b98051f352fab8a6257688d6b2fd665b4648ed66144861f2f853ccf876d334"
+
+EXTRA_OECONF = "--without-svgz"
 
 PACKAGECONFIG ??= "croco gdkpixbuf"
 
@@ -25,17 +32,6 @@ PACKAGECONFIG[gdkpixbuf] = "--enable-pixbuf-loader,--disable-pixbuf-loader"
 # GTK+ 2 theme engine
 PACKAGECONFIG[gtk] = "--enable-gtk-theme,--disable-gtk-theme,gtk+"
 
-SRC_URI += "file://doc_Makefile.patch \
-	    file://librsvg-CVE-2011-3146.patch \
-	    "
-
-SRC_URI[archive.md5sum] = "4b00d0fee130c936644892c152f42db7"
-SRC_URI[archive.sha256sum] = "91b98051f352fab8a6257688d6b2fd665b4648ed66144861f2f853ccf876d334"
-
-do_configure_prepend () {
-	export GDK_PIXBUF_QUERYLOADERS="${libdir}/gdk-pixbuf-2.0/2.10.0/loaders"
-}
-
 PACKAGES =+ "librsvg-gtk librsvg-gtk-dbg librsvg-gtk-dev rsvg"
 FILES_${PN} = "${libdir}/*.so.*"
 FILES_${PN}-staticdev += "${libdir}/gdk-pixbuf-2.0/*.a ${libdir}/gdk-pixbuf-2.0/*/*/*.a \
Signature · 1 line
1.7.10.4
#2 lore raw

Re: [PATCH 1/5] pixbufcache: update the loader cache when installing natively

In reply to Ross Burton
Quoted 2 lines · Ross Burton

Register a sstate postinst function so that when installing a native package, the gdk-pixbuf loader cache is updated.

Retracting this, a last-minute change introduced a dependency cycle. V2 coming shortly.

Ross