angstrom: prefer the git version of tslib
[openembedded.git] / classes / gtk-icon-cache.bbclass
blob2449e954ce18b875c91bf8a3dfd62717c233b9d3
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
9         exit 1
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
18     fi
19 done
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
26     fi
27 done
30 python populate_packages_append () {
31         packages = bb.data.getVar('PACKAGES', d, 1).split()
32         pkgdest =  bb.data.getVar('PKGDEST', d, 1)
33         
34         for pkg in packages:
35                 icon_dir = '%s/%s/%s/icons' % (pkgdest, pkg, bb.data.getVar('datadir', d, 1))
36                 if not os.path.exists(icon_dir):
37                         continue
38                 
39                 bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg)
40                 
41                 postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1)
42                 if not postinst:
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)
48                 if not postrm:
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)