diff options
Diffstat (limited to 'meta/classes/gtk-icon-cache.bbclass')
| -rw-r--r-- | meta/classes/gtk-icon-cache.bbclass | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass index b25636517..60e3401f4 100644 --- a/meta/classes/gtk-icon-cache.bbclass +++ b/meta/classes/gtk-icon-cache.bbclass @@ -1,5 +1,6 @@ FILES_${PN} += "${datadir}/icons/hicolor" -RDEPENDS += "hicolor-icon-theme" + +DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']}" # This could run on the host as icon cache files are architecture independent, # but there is no gtk-update-icon-cache built natively. @@ -9,37 +10,49 @@ if [ "x$D" != "x" ]; then fi # Update the pixbuf loaders in case they haven't been registered yet -gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders +GDK_PIXBUF_MODULEDIR=${libdir}/gdk-pixbuf-2.0/2.10.0/loaders gdk-pixbuf-query-loaders --update-cache -gtk-update-icon-cache -q /usr/share/icons/hicolor +for icondir in /usr/share/icons/* ; do + if [ -d $icondir ] ; then + gtk-update-icon-cache -fqt $icondir + fi +done } gtk_icon_cache_postrm() { -gtk-update-icon-cache -q /usr/share/icons/hicolor +for icondir in /usr/share/icons/* ; do + if [ -d $icondir ] ; then + gtk-update-icon-cache -qt $icondir + fi +done } python populate_packages_append () { - import os.path - packages = bb.data.getVar('PACKAGES', d, 1).split() - workdir = bb.data.getVar('WORKDIR', d, 1) + packages = d.getVar('PACKAGES', True).split() + pkgdest = d.getVar('PKGDEST', True) for pkg in packages: - icon_dir = '%s/install/%s/%s/icons/hicolor' % (workdir, pkg, bb.data.getVar('datadir', d, 1)) + icon_dir = '%s/%s/%s/icons' % (pkgdest, pkg, d.getVar('datadir', True)) if not os.path.exists(icon_dir): continue - + + bb.note("adding hicolor-icon-theme dependency to %s" % pkg) + rdepends = d.getVar('RDEPENDS_%s' % pkg, True) + rdepends = rdepends + ' ' + d.getVar('MLPREFIX') + "hicolor-icon-theme" + d.setVar('RDEPENDS_%s' % pkg, rdepends) + 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) + postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True) if not postinst: postinst = '#!/bin/sh\n' - postinst += bb.data.getVar('gtk_icon_cache_postinst', d, 1) - bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) + postinst += d.getVar('gtk_icon_cache_postinst', True) + d.setVar('pkg_postinst_%s' % pkg, postinst) - postrm = bb.data.getVar('pkg_postrm_%s' % pkg, d, 1) or bb.data.getVar('pkg_postrm', d, 1) + postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True) if not postrm: postrm = '#!/bin/sh\n' - postrm += bb.data.getVar('gtk_icon_cache_postrm', d, 1) - bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d) + postrm += d.getVar('gtk_icon_cache_postrm', True) + d.setVar('pkg_postrm_%s' % pkg, postrm) } |
