diff options
Diffstat (limited to 'meta/classes/fontcache.bbclass')
-rw-r--r-- | meta/classes/fontcache.bbclass | 36 |
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 | |||
6 | DEPENDS += "qemu-native" | ||
7 | inherit qemu | ||
8 | |||
9 | FONT_PACKAGES ??= "${PN}" | ||
10 | |||
11 | fontcache_common() { | ||
12 | if [ "x$D" != "x" ] ; then | ||
13 | $INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} bindir=${bindir} \ | ||
14 | libdir=${libdir} base_libdir=${base_libdir} | ||
15 | else | ||
16 | fc-cache | ||
17 | fi | ||
18 | } | ||
19 | |||
20 | python 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 | } | ||