1 FILES_${PN} += "${datadir}/icons/hicolor"
2 # Only add runtime dependency on hicolor-icon-theme for target recipes
3 RDEPENDS_${PN} += "${@['', 'hicolor-icon-theme']['${PN}' == '${BPN}']}"
5 # This could run on the host as icon cache files are architecture independent,
6 # but there is no gtk-update-icon-cache built natively.
7 gtk_icon_cache_postinst() {
8 if [ "x$D" != "x" ]; then
12 # Update the pixbuf loaders in case they haven't been registered yet
13 gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders
15 for icondir in /usr/share/icons/* ; do
16 if [ -d $icondir ] ; then
17 gtk-update-icon-cache -qt $icondir
22 gtk_icon_cache_postrm() {
23 for icondir in /usr/share/icons/* ; do
24 if [ -d $icondir ] ; then
25 gtk-update-icon-cache -qt $icondir
30 python populate_packages_append () {
31 packages = bb.data.getVar('PACKAGES', d, 1).split()
32 pkgdest = bb.data.getVar('PKGDEST', d, 1)
35 icon_dir = '%s/%s/%s/icons' % (pkgdest, pkg, bb.data.getVar('datadir', d, 1))
36 if not os.path.exists(icon_dir):
39 bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg)
41 postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1)
43 postinst = '#!/bin/sh\n'
44 postinst += bb.data.getVar('gtk_icon_cache_postinst', d, 1)
45 bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
47 postrm = bb.data.getVar('pkg_postrm_%s' % pkg, d, 1) or bb.data.getVar('pkg_postrm', d, 1)
49 postrm = '#!/bin/sh\n'
50 postrm += bb.data.getVar('gtk_icon_cache_postrm', d, 1)
51 bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d)