libgtk3: create icon-theme.cache for icon themes
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Thu, 21 Apr 2016 11:00:43 +0000 (08:00 -0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 21 Apr 2016 20:05:32 +0000 (22:05 +0200)
It makes icon lookups faster, though it's not strictly necessary.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
[Thomas: enclsoe the hook definition in the condition.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/libgtk3/libgtk3.mk

index 7bd92cad9f42f2c3947bf8fdc81803237c1171bc..55912620eba69658d3712d5bca435539ed602695 100644 (file)
@@ -180,5 +180,15 @@ define HOST_LIBGTK3_INSTALL_CMDS
                $(HOST_DIR)/usr/bin/gtk-encode-symbolic-svg
 endef
 
+# Create icon-theme.cache for each of the icon directories/themes
+# It's not strictly necessary but speeds up lookups
+ifeq ($(BR2_PACKAGE_LIBGTK3),y)
+define LIBGTK3_UPDATE_ICON_CACHE
+       find $(TARGET_DIR)/usr/share/icons -maxdepth 1 -mindepth 1 -type d \
+               -exec $(HOST_DIR)/usr/bin/gtk-update-icon-cache {} \;
+endef
+TARGET_FINALIZE_HOOKS += LIBGTK3_UPDATE_ICON_CACHE
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))