[OE-core] [RFC 5/7] gdk-pixbuf: generate the pixbuf loader's cache ar rootfs time
Laurentiu Palcu
laurentiu.palcu at intel.com
Wed Sep 19 11:49:23 UTC 2012
This will generate the loaders.cache file for pixbuf, at rootfs time.
Signed-off-by: Laurentiu Palcu <laurentiu.palcu at intel.com>
---
meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb | 24 ++++++++++++--------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb
index 99f6cb4..c4afb97 100644
--- a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb
+++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.1.bb
@@ -57,18 +57,22 @@ FILES_${PN}-dbg += " \
postinst_pixbufloader () {
if [ "x$D" != "x" ]; then
- exit 1
+# Update the target's pixbuf loader's cache. Since the native binary will
+# throw an error if the shared objects do not belong to the same ELF class,
+# we trick the gdk-pixbuf-query-loaders into scanning the native shared
+# objects and then we remove the NATIVE_ROOT prefix from the paths in
+# loaders.cache.
+gdk-pixbuf-query-loaders $(find $D/${libdir}/gdk-pixbuf-2.0/2.10.0/loaders \
+ -name *.so | sed -e "s:$D:$NATIVE_ROOT:g") > \
+ $D/${libdir}/gdk-pixbuf-2.0/2.10.0/loaders.cache || exit 1
+
+sed -i -e "s:$NATIVE_ROOT:/:g" $D/${libdir}/gdk-pixbuf-2.0/2.10.0/loaders.cache
+
+exit 0
fi
-GDK_PIXBUF_MODULEDIR=${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders gdk-pixbuf-query-loaders --update-cache
-
-if [ -x ${bindir}/gtk-update-icon-cache ] && [ -d ${datadir}/icons ]; then
- for icondir in /usr/share/icons/*; do
- if [ -d ${icondir} ]; then
- gtk-update-icon-cache -t -q ${icondir}
- fi
- done
-fi
+# Update the pixbuf loaders in case they haven't been registered yet
+GDK_PIXBUF_MODULEDIR=${libdir}/gdk-pixbuf-2.0/2.10.0/loaders gdk-pixbuf-query-loaders --update-cache
}
PACKAGES_DYNAMIC += "gdk-pixbuf-loader-*"
--
1.7.9.5
More information about the Openembedded-core
mailing list