poky/meta/classes/xmlcatalog.bbclass
Chen Qi 43a08e1936 xmlcatalog: hold libxml2-native dependency
Put libxml2-native dependency in this class and remove
it from recipes inheriting this class.

In fact, if a recipe inherits this class and does not have
libxml2-native, the xmlcatalog_sstate_postinst would fail.

(From OE-Core rev: 5a72c6d5cc1c9896c7425ac20eaf82d3d489e5c7)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-11 09:32:50 +01:00

27 lines
758 B
Plaintext

DEPENDS = "libxml2-native"
# A whitespace-separated list of XML catalogs to be registered, for example
# "${sysconfdir}/xml/docbook-xml.xml".
XMLCATALOGS ?= ""
SYSROOT_PREPROCESS_FUNCS_append = " xmlcatalog_sstate_postinst"
xmlcatalog_complete() {
ROOTCATALOG="${STAGING_ETCDIR_NATIVE}/xml/catalog"
if [ ! -f $ROOTCATALOG ]; then
mkdir --parents $(dirname $ROOTCATALOG)
xmlcatalog --noout --create $ROOTCATALOG
fi
for CATALOG in ${XMLCATALOGS}; do
xmlcatalog --noout --add nextCatalog unused file://$CATALOG $ROOTCATALOG
done
}
xmlcatalog_sstate_postinst() {
mkdir -p ${SYSROOT_DESTDIR}${bindir}
dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN}-xmlcatalog
echo '#!/bin/sh' > $dest
echo '${xmlcatalog_complete}' >> $dest
chmod 0755 $dest
}