2006-07-19 16:12:45 +00:00
|
|
|
FILES_${PN} += "${datadir}/icons/hicolor"
|
2007-08-08 20:46:45 +00:00
|
|
|
RDEPENDS += "hicolor-icon-theme"
|
2006-07-19 16:12:45 +00:00
|
|
|
|
2007-04-16 12:41:25 +00:00
|
|
|
# This could run on the host as icon cache files are architecture independent,
|
|
|
|
# but there is no gtk-update-icon-cache built natively.
|
2008-05-20 08:40:02 +00:00
|
|
|
gtk_icon_cache_postinst() {
|
2006-07-19 16:12:45 +00:00
|
|
|
if [ "x$D" != "x" ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
2008-01-08 15:54:04 +00:00
|
|
|
|
|
|
|
# Update the pixbuf loaders in case they haven't been registered yet
|
2010-11-25 06:42:43 +00:00
|
|
|
GDK_PIXBUF_MODULEDIR=${libdir}/gdk-pixbuf-2.0/2.10.0/loaders gdk-pixbuf-query-loaders --update-cache
|
2008-01-08 15:54:04 +00:00
|
|
|
|
2009-11-16 10:13:39 +00:00
|
|
|
for icondir in /usr/share/icons/* ; do
|
|
|
|
if [ -d $icondir ] ; then
|
|
|
|
gtk-update-icon-cache -qt $icondir
|
|
|
|
fi
|
|
|
|
done
|
2006-07-19 16:12:45 +00:00
|
|
|
}
|
|
|
|
|
2008-05-20 08:40:02 +00:00
|
|
|
gtk_icon_cache_postrm() {
|
2009-11-16 10:13:39 +00:00
|
|
|
for icondir in /usr/share/icons/* ; do
|
|
|
|
if [ -d $icondir ] ; then
|
|
|
|
gtk-update-icon-cache -qt $icondir
|
|
|
|
fi
|
|
|
|
done
|
2006-07-19 16:12:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
python populate_packages_append () {
|
|
|
|
packages = bb.data.getVar('PACKAGES', d, 1).split()
|
2009-11-16 10:13:39 +00:00
|
|
|
pkgdest = bb.data.getVar('PKGDEST', d, 1)
|
2006-07-19 16:12:45 +00:00
|
|
|
|
|
|
|
for pkg in packages:
|
2009-11-16 10:52:35 +00:00
|
|
|
icon_dir = '%s/%s/%s/icons' % (pkgdest, pkg, bb.data.getVar('datadir', d, 1))
|
2006-07-19 16:12:45 +00:00
|
|
|
if not os.path.exists(icon_dir):
|
|
|
|
continue
|
|
|
|
|
|
|
|
bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg)
|
|
|
|
|
|
|
|
postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1)
|
|
|
|
if not postinst:
|
|
|
|
postinst = '#!/bin/sh\n'
|
2008-05-20 08:40:02 +00:00
|
|
|
postinst += bb.data.getVar('gtk_icon_cache_postinst', d, 1)
|
2006-07-19 16:12:45 +00:00
|
|
|
bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
|
|
|
|
|
|
|
|
postrm = bb.data.getVar('pkg_postrm_%s' % pkg, d, 1) or bb.data.getVar('pkg_postrm', d, 1)
|
|
|
|
if not postrm:
|
|
|
|
postrm = '#!/bin/sh\n'
|
2008-05-20 08:40:02 +00:00
|
|
|
postrm += bb.data.getVar('gtk_icon_cache_postrm', d, 1)
|
2006-07-19 16:12:45 +00:00
|
|
|
bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d)
|
|
|
|
}
|
|
|
|
|