summaryrefslogtreecommitdiffstats
path: root/meta/classes/fontcache.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-10 14:35:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-12 15:27:17 +0100
commitfd1517e2b51a170f2427122c6b95396db251d827 (patch)
treedabfe3e631339c2fc99a9ee7febb0f9c128e325e /meta/classes/fontcache.bbclass
parent10317912ee319ccf7f83605d438b5cbf9663f296 (diff)
downloadpoky-fd1517e2b51a170f2427122c6b95396db251d827.tar.gz
classes: Update classes to match new bitbake class scope functionality
Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. (From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/fontcache.bbclass')
-rw-r--r--meta/classes/fontcache.bbclass63
1 files changed, 0 insertions, 63 deletions
diff --git a/meta/classes/fontcache.bbclass b/meta/classes/fontcache.bbclass
deleted file mode 100644
index 0d496b72dd..0000000000
--- a/meta/classes/fontcache.bbclass
+++ /dev/null
@@ -1,63 +0,0 @@
1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7#
8# This class will generate the proper postinst/postrm scriptlets for font
9# packages.
10#
11
12PACKAGE_WRITE_DEPS += "qemu-native"
13inherit qemu
14
15FONT_PACKAGES ??= "${PN}"
16FONT_EXTRA_RDEPENDS ?= "${MLPREFIX}fontconfig-utils"
17FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
18FONTCONFIG_CACHE_PARAMS ?= "-v"
19# You can change this to e.g. FC_DEBUG=16 to debug fc-cache issues,
20# something has to be set, because qemuwrapper is using this variable after -E
21# multiple variables aren't allowed because for qemu they are separated
22# by comma and in -n "$D" case they should be separated by space
23FONTCONFIG_CACHE_ENV ?= "FC_DEBUG=1"
24fontcache_common() {
25if [ -n "$D" ] ; then
26 $INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX} \
27 'bindir="${bindir}"' \
28 'libdir="${libdir}"' \
29 'libexecdir="${libexecdir}"' \
30 'base_libdir="${base_libdir}"' \
31 'fontconfigcachedir="${FONTCONFIG_CACHE_DIR}"' \
32 'fontconfigcacheparams="${FONTCONFIG_CACHE_PARAMS}"' \
33 'fontconfigcacheenv="${FONTCONFIG_CACHE_ENV}"'
34else
35 ${FONTCONFIG_CACHE_ENV} fc-cache ${FONTCONFIG_CACHE_PARAMS}
36fi
37}
38
39python () {
40 font_pkgs = d.getVar('FONT_PACKAGES').split()
41 deps = d.getVar("FONT_EXTRA_RDEPENDS")
42
43 for pkg in font_pkgs:
44 if deps: d.appendVar('RDEPENDS:' + pkg, ' '+deps)
45}
46
47python add_fontcache_postinsts() {
48 for pkg in d.getVar('FONT_PACKAGES').split():
49 bb.note("adding fonts postinst and postrm scripts to %s" % pkg)
50 postinst = d.getVar('pkg_postinst:%s' % pkg) or d.getVar('pkg_postinst')
51 if not postinst:
52 postinst = '#!/bin/sh\n'
53 postinst += d.getVar('fontcache_common')
54 d.setVar('pkg_postinst:%s' % pkg, postinst)
55
56 postrm = d.getVar('pkg_postrm:%s' % pkg) or d.getVar('pkg_postrm')
57 if not postrm:
58 postrm = '#!/bin/sh\n'
59 postrm += d.getVar('fontcache_common')
60 d.setVar('pkg_postrm:%s' % pkg, postrm)
61}
62
63PACKAGEFUNCS =+ "add_fontcache_postinsts"