summaryrefslogtreecommitdiffstats
path: root/meta/classes/fontcache.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/fontcache.bbclass')
-rw-r--r--meta/classes/fontcache.bbclass36
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/classes/fontcache.bbclass b/meta/classes/fontcache.bbclass
new file mode 100644
index 0000000000..325bcae58f
--- /dev/null
+++ b/meta/classes/fontcache.bbclass
@@ -0,0 +1,36 @@
1#
2# This class will generate the proper postinst/postrm scriptlets for font
3# packages.
4#
5
6DEPENDS += "qemu-native"
7inherit qemu
8
9FONT_PACKAGES ??= "${PN}"
10
11fontcache_common() {
12if [ "x$D" != "x" ] ; then
13 $INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} bindir=${bindir} \
14 libdir=${libdir} base_libdir=${base_libdir}
15else
16 fc-cache
17fi
18}
19
20python populate_packages_append() {
21 font_pkgs = d.getVar('FONT_PACKAGES', True).split()
22
23 for pkg in font_pkgs:
24 bb.note("adding fonts postinst and postrm scripts to %s" % pkg)
25 postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
26 if not postinst:
27 postinst = '#!/bin/sh\n'
28 postinst += d.getVar('fontcache_common', True)
29 d.setVar('pkg_postinst_%s' % pkg, postinst)
30
31 postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True)
32 if not postrm:
33 postrm = '#!/bin/sh\n'
34 postrm += d.getVar('fontcache_common', True)
35 d.setVar('pkg_postrm_%s' % pkg, postrm)
36}