Skip to contentSkip to conversation

graphviz: native: create /usr/lib/graphviz/config6 in populate_sysroot

PATCH New Christian Eggers 1 participant 1 message Feb 16, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 graphviz: native: create /usr/lib/graphviz/config6 in populate_sysroot

The dot tool requires to be run once after installation in order to create its configuration file.

The do_prepare_recipe_sysroot task uses do_populate_sysroot in order to prepare the recipe-sysroot-native. Package postinstall scripts are not executed for -native packages, but files under ${BINDIR}/postinst-* are.

This is quite the same as graphviz-setup.sh does for nativesdk. The general idea has been taken from OECORE/meta/classes/pixbufcache.bbclass.

---
 meta-oe/recipes-graphics/graphviz/graphviz_2.40.1.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)
meta-oe/recipes-graphics/graphviz/graphviz_2.40.1.bb +11 -0
index 81ab86c7622e..72e2f5cc7add 100644
@@ -55,6 +55,17 @@ do_install_append_class-native() {
     install -m755 ${B}/lib/gvpr/mkdefs ${D}${bindir}
 }
 
+# create /usr/lib/graphviz/config6
+graphviz_sstate_postinst() {
+    mkdir -p ${SYSROOT_DESTDIR}${bindir}
+    dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN}
+    echo '#!/bin/sh' > $dest
+    echo '' >> $dest
+    echo 'dot -c' >> $dest
+    chmod 0755 $dest
+}
+SYSROOT_PREPROCESS_FUNCS_append_class-native = " graphviz_sstate_postinst"
+
 PACKAGES =+ "${PN}-python ${PN}-perl ${PN}-demo"
 
 FILES_${PN}-python += "${libdir}/python*/site-packages/ ${libdir}/graphviz/python/"
Signature · 1 line
2.34.1