diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
commit | c527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch) | |
tree | bb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/classes/fontcache.bbclass | |
download | poky-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/fontcache.bbclass')
-rw-r--r-- | meta/classes/fontcache.bbclass | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/meta/classes/fontcache.bbclass b/meta/classes/fontcache.bbclass new file mode 100644 index 0000000000..afd3fd2252 --- /dev/null +++ b/meta/classes/fontcache.bbclass | |||
@@ -0,0 +1,40 @@ | |||
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 | FONT_EXTRA_RDEPENDS ?= "fontconfig-utils" | ||
11 | |||
12 | fontcache_common() { | ||
13 | if [ "x$D" != "x" ] ; then | ||
14 | $INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} bindir=${bindir} \ | ||
15 | libdir=${libdir} base_libdir=${base_libdir} | ||
16 | else | ||
17 | fc-cache | ||
18 | fi | ||
19 | } | ||
20 | |||
21 | python populate_packages_append() { | ||
22 | font_pkgs = d.getVar('FONT_PACKAGES', True).split() | ||
23 | deps = d.getVar("FONT_EXTRA_RDEPENDS", True) | ||
24 | |||
25 | for pkg in font_pkgs: | ||
26 | if deps: d.appendVar('RDEPENDS_' + pkg, ' '+deps) | ||
27 | |||
28 | bb.note("adding fonts postinst and postrm scripts to %s" % pkg) | ||
29 | postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True) | ||
30 | if not postinst: | ||
31 | postinst = '#!/bin/sh\n' | ||
32 | postinst += d.getVar('fontcache_common', True) | ||
33 | d.setVar('pkg_postinst_%s' % pkg, postinst) | ||
34 | |||
35 | postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True) | ||
36 | if not postrm: | ||
37 | postrm = '#!/bin/sh\n' | ||
38 | postrm += d.getVar('fontcache_common', True) | ||
39 | d.setVar('pkg_postrm_%s' % pkg, postrm) | ||
40 | } | ||