summaryrefslogtreecommitdiffstats
path: root/meta/classes/gtk-icon-cache.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/gtk-icon-cache.bbclass')
-rw-r--r--meta/classes/gtk-icon-cache.bbclass84
1 files changed, 0 insertions, 84 deletions
diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass
deleted file mode 100644
index 340a283851..0000000000
--- a/meta/classes/gtk-icon-cache.bbclass
+++ /dev/null
@@ -1,84 +0,0 @@
1FILES_${PN} += "${datadir}/icons/hicolor"
2
3#gtk+3 reqiure GTK3DISTROFEATURES, DEPENDS on it make all the
4#recipes inherit this class require GTK3DISTROFEATURES
5inherit features_check
6ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
7
8DEPENDS +=" ${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} \
9 ${@['gdk-pixbuf', '']['${BPN}' == 'gdk-pixbuf']} \
10 ${@['gtk+3', '']['${BPN}' == 'gtk+3']} \
11 gtk+3-native \
12"
13
14PACKAGE_WRITE_DEPS += "gtk+3-native gdk-pixbuf-native"
15
16gtk_icon_cache_postinst() {
17if [ "x$D" != "x" ]; then
18 $INTERCEPT_DIR/postinst_intercept update_gtk_icon_cache ${PKG} \
19 mlprefix=${MLPREFIX} \
20 libdir_native=${libdir_native}
21else
22
23 # Update the pixbuf loaders in case they haven't been registered yet
24 ${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache
25
26 for icondir in /usr/share/icons/* ; do
27 if [ -d $icondir ] ; then
28 gtk-update-icon-cache -fqt $icondir
29 fi
30 done
31fi
32}
33
34gtk_icon_cache_postrm() {
35if [ "x$D" != "x" ]; then
36 $INTERCEPT_DIR/postinst_intercept update_gtk_icon_cache ${PKG} \
37 mlprefix=${MLPREFIX} \
38 libdir=${libdir}
39else
40 for icondir in /usr/share/icons/* ; do
41 if [ -d $icondir ] ; then
42 gtk-update-icon-cache -qt $icondir
43 fi
44 done
45fi
46}
47
48python populate_packages_append () {
49 packages = d.getVar('PACKAGES').split()
50 pkgdest = d.getVar('PKGDEST')
51
52 for pkg in packages:
53 icon_dir = '%s/%s/%s/icons' % (pkgdest, pkg, d.getVar('datadir'))
54 if not os.path.exists(icon_dir):
55 continue
56
57 bb.note("adding hicolor-icon-theme dependency to %s" % pkg)
58 rdepends = ' ' + d.getVar('MLPREFIX', False) + "hicolor-icon-theme"
59 d.appendVar('RDEPENDS_%s' % pkg, rdepends)
60
61 #gtk_icon_cache_postinst depend on gdk-pixbuf and gtk+3
62 bb.note("adding gdk-pixbuf dependency to %s" % pkg)
63 rdepends = ' ' + d.getVar('MLPREFIX', False) + "gdk-pixbuf"
64 d.appendVar('RDEPENDS_%s' % pkg, rdepends)
65
66 bb.note("adding gtk+3 dependency to %s" % pkg)
67 rdepends = ' ' + d.getVar('MLPREFIX', False) + "gtk+3"
68 d.appendVar('RDEPENDS_%s' % pkg, rdepends)
69
70 bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg)
71
72 postinst = d.getVar('pkg_postinst_%s' % pkg)
73 if not postinst:
74 postinst = '#!/bin/sh\n'
75 postinst += d.getVar('gtk_icon_cache_postinst')
76 d.setVar('pkg_postinst_%s' % pkg, postinst)
77
78 postrm = d.getVar('pkg_postrm_%s' % pkg)
79 if not postrm:
80 postrm = '#!/bin/sh\n'
81 postrm += d.getVar('gtk_icon_cache_postrm')
82 d.setVar('pkg_postrm_%s' % pkg, postrm)
83}
84