]> code.ossystems Code Review - openembedded-core.git/commitdiff
gtk-icon-cache: run the icon generation at rootfs time
authorLaurentiu Palcu <laurentiu.palcu@intel.com>
Tue, 18 Sep 2012 15:56:04 +0000 (18:56 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 6 Dec 2012 12:30:34 +0000 (12:30 +0000)
This change will allow for the icon cache generation at rootfs time and
only once, at the end. So, even though there will be many packages
depending on gtk+, the icon cache generation will be done once.
Hopefully, this will lower the target's first boot time significantly
by using the power of the host machine to generate the cache.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/classes/gtk-icon-cache.bbclass

index 01fb2f39464a6b2c2abf0fd895daaa6ec74bad01..f87a30fd5b9a88f47b74c6907cb04d55ab3dbe0f 100644 (file)
@@ -1,12 +1,22 @@
 FILES_${PN} += "${datadir}/icons/hicolor"
 
-DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']}"
+DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} gtk+-native"
 
-# This could run on the host as icon cache files are architecture independent,
-# but there is no gtk-update-icon-cache built natively.
 gtk_icon_cache_postinst() {
 if [ "x$D" != "x" ]; then
-        exit 1
+    if [ ! -f $INTERCEPT_DIR/update_icon_cache ]; then
+        cat << "EOF" > $INTERCEPT_DIR/update_icon_cache
+#!/bin/sh
+
+# update native pixbuf loaders
+gdk-pixbuf-query-loaders --update-cache
+
+for icondir in $D/usr/share/icons/*/ ; do
+       gtk-update-icon-cache -fqt  $icondir
+done
+EOF
+    fi
+    exit 0
 fi
 
 # Update the pixbuf loaders in case they haven't been registered yet