poky/meta/classes-recipe/fontcache.bbclass
Martin Jansa f92b7ddc73 fontcache.bbclass: avoid native recipes depending on target fontconfig
* this caused liberation-font-native to depend on TUNE_PKGARCH target fontconfig
  because ${MLPREFIX}fontconfig-utils is added to RDEPENDS in anonymous python

* the dependency tree for liberation-font-native got much shorter
  (just quilt-native and liberation-font-native itself):
   2 after/pn-buildlist
  78 before/pn-buildlist

* fixes graphviz-native signature issue as well as detected with sstate-diff-machines.sh

  $ bitbake-diffsigs \
    sstate-after/mako/x86_64-linux/graphviz-native/8.1.0.do_populate_sysroot.sigdata.184d4fd355f1e7a2d7d929ef4b5f62b94e2071df9dd674b2067ec21bfc7bcc1b \
    sstate-after/qemux86-64/x86_64-linux/graphviz-native/8.1.0.do_populate_sysroot.sigdata.35da674d2dbc275bac02869dfce4165466315023910bdef65a6026e2cb942a46
  Hash for task dependency liberation-fonts-native:do_populate_sysroot changed from 310d3da04ad9abf8ee99997e53d1ffa71c2b7d9d60fb0e8de85171a9ab6a77d3 to 048420ad1410c2b8d95498fc3c11681207335a2c722836f1f3e683cc449814da

(From OE-Core rev: 998d4da9d89aea77dc0f2cbac60ea64258331756)

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-20 23:51:11 +01:00

65 lines
2.1 KiB
Plaintext

#
# Copyright OpenEmbedded Contributors
#
# SPDX-License-Identifier: MIT
#
#
# This class will generate the proper postinst/postrm scriptlets for font
# packages.
#
PACKAGE_WRITE_DEPS += "qemu-native"
inherit qemu
FONT_PACKAGES ??= "${PN}"
FONT_PACKAGES:class-native = ""
FONT_EXTRA_RDEPENDS ?= "${MLPREFIX}fontconfig-utils"
FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
FONTCONFIG_CACHE_PARAMS ?= "-v"
# You can change this to e.g. FC_DEBUG=16 to debug fc-cache issues,
# something has to be set, because qemuwrapper is using this variable after -E
# multiple variables aren't allowed because for qemu they are separated
# by comma and in -n "$D" case they should be separated by space
FONTCONFIG_CACHE_ENV ?= "FC_DEBUG=1"
fontcache_common() {
if [ -n "$D" ] ; then
$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX} \
'bindir="${bindir}"' \
'libdir="${libdir}"' \
'libexecdir="${libexecdir}"' \
'base_libdir="${base_libdir}"' \
'fontconfigcachedir="${FONTCONFIG_CACHE_DIR}"' \
'fontconfigcacheparams="${FONTCONFIG_CACHE_PARAMS}"' \
'fontconfigcacheenv="${FONTCONFIG_CACHE_ENV}"'
else
${FONTCONFIG_CACHE_ENV} fc-cache ${FONTCONFIG_CACHE_PARAMS}
fi
}
python () {
font_pkgs = d.getVar('FONT_PACKAGES').split()
deps = d.getVar("FONT_EXTRA_RDEPENDS")
for pkg in font_pkgs:
if deps: d.appendVar('RDEPENDS:' + pkg, ' '+deps)
}
python add_fontcache_postinsts() {
for pkg in d.getVar('FONT_PACKAGES').split():
bb.note("adding fonts postinst and postrm scripts to %s" % pkg)
postinst = d.getVar('pkg_postinst:%s' % pkg) or d.getVar('pkg_postinst')
if not postinst:
postinst = '#!/bin/sh\n'
postinst += d.getVar('fontcache_common')
d.setVar('pkg_postinst:%s' % pkg, postinst)
postrm = d.getVar('pkg_postrm:%s' % pkg) or d.getVar('pkg_postrm')
if not postrm:
postrm = '#!/bin/sh\n'
postrm += d.getVar('fontcache_common')
d.setVar('pkg_postrm:%s' % pkg, postrm)
}
PACKAGEFUNCS =+ "add_fontcache_postinsts"