summaryrefslogtreecommitdiffstats
path: root/meta/classes/gtk-icon-cache.bbclass
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
commitc527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch)
treebb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/classes/gtk-icon-cache.bbclass
downloadpoky-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/classes/gtk-icon-cache.bbclass')
-rw-r--r--meta/classes/gtk-icon-cache.bbclass62
1 files changed, 62 insertions, 0 deletions
diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass
new file mode 100644
index 0000000000..789fa38a16
--- /dev/null
+++ b/meta/classes/gtk-icon-cache.bbclass
@@ -0,0 +1,62 @@
1FILES_${PN} += "${datadir}/icons/hicolor"
2
3DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} gtk-update-icon-cache-native"
4
5gtk_icon_cache_postinst() {
6if [ "x$D" != "x" ]; then
7 $INTERCEPT_DIR/postinst_intercept update_icon_cache ${PKG} mlprefix=${MLPREFIX} libdir=${libdir} \
8 base_libdir=${base_libdir}
9else
10
11 # Update the pixbuf loaders in case they haven't been registered yet
12 GDK_PIXBUF_MODULEDIR=${libdir}/gdk-pixbuf-2.0/2.10.0/loaders gdk-pixbuf-query-loaders --update-cache
13
14 for icondir in /usr/share/icons/* ; do
15 if [ -d $icondir ] ; then
16 gtk-update-icon-cache -fqt $icondir
17 fi
18 done
19fi
20}
21
22gtk_icon_cache_postrm() {
23if [ "x$D" != "x" ]; then
24 $INTERCEPT_DIR/postinst_intercept update_icon_cache ${PKG} mlprefix=${MLPREFIX} libdir=${libdir} \
25 base_libdir=${base_libdir}
26else
27 for icondir in /usr/share/icons/* ; do
28 if [ -d $icondir ] ; then
29 gtk-update-icon-cache -qt $icondir
30 fi
31 done
32fi
33}
34
35python populate_packages_append () {
36 packages = d.getVar('PACKAGES', True).split()
37 pkgdest = d.getVar('PKGDEST', True)
38
39 for pkg in packages:
40 icon_dir = '%s/%s/%s/icons' % (pkgdest, pkg, d.getVar('datadir', True))
41 if not os.path.exists(icon_dir):
42 continue
43
44 bb.note("adding hicolor-icon-theme dependency to %s" % pkg)
45 rdepends = ' ' + d.getVar('MLPREFIX') + "hicolor-icon-theme"
46 d.appendVar('RDEPENDS_%s' % pkg, rdepends)
47
48 bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg)
49
50 postinst = d.getVar('pkg_postinst_%s' % pkg, True)
51 if not postinst:
52 postinst = '#!/bin/sh\n'
53 postinst += d.getVar('gtk_icon_cache_postinst', True)
54 d.setVar('pkg_postinst_%s' % pkg, postinst)
55
56 postrm = d.getVar('pkg_postrm_%s' % pkg, True)
57 if not postrm:
58 postrm = '#!/bin/sh\n'
59 postrm += d.getVar('gtk_icon_cache_postrm', True)
60 d.setVar('pkg_postrm_%s' % pkg, postrm)
61}
62