Skip to contentSkip to conversation

gtk-doc: always inherit python3native

PATCH New Ross Burton 1 participant 2 messages Mar 14, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 gtk-doc: always inherit python3native

My attempt at only inheriting python3native if it was needed was broken and didn't work, so back it out and always inherit.

---
 meta/classes/gtk-doc.bbclass | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
meta/classes/gtk-doc.bbclass +2 -4
index b8db4280bcd..3f731cb93bf 100644
@@ -28,10 +28,8 @@ GTKDOC_DOCDIR ?= "${S}"
 
 export STAGING_DIR_HOST
 
-inherit ${@oe.utils.ifelse(d.getVar('GTKDOC_ENABLED') == 'True', 'python3native', '')}
-
-inherit pkgconfig qemu
-DEPENDS_append = "${@oe.utils.ifelse(d.getVar('GTKDOC_ENABLED') == 'True', ' qemu-native', '')}"
+inherit python3native pkgconfig qemu
+DEPENDS_append = "${@' qemu-native' if d.getVar('GTKDOC_ENABLED') == 'True' else ''}"
 
 do_configure_prepend () {
 	( cd ${S}; gtkdocize --docdir ${GTKDOC_DOCDIR} || true )
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 gtk-doc: improve calling of gtkdocize

gtkdocize is only needed if the recipe is using autotools, so instead of hiding all errors from it, only run it if we're also inheriting autotools.

Also instead of cd'ing into ${S}, pass --srcdir.

---
 meta/classes/gtk-doc.bbclass | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
meta/classes/gtk-doc.bbclass +9 -2
index 3f731cb93bf..cfeb49a1d00 100644
@@ -31,8 +31,15 @@ export STAGING_DIR_HOST
 inherit python3native pkgconfig qemu
 DEPENDS_append = "${@' qemu-native' if d.getVar('GTKDOC_ENABLED') == 'True' else ''}"
 
-do_configure_prepend () {
-	( cd ${S}; gtkdocize --docdir ${GTKDOC_DOCDIR} || true )
+# Run gtkdocize if the recipe is using autotools
+run_gtkdocize () {
+	bbnote Running gtkdocize...
+	gtkdocize --srcdir ${S} --docdir ${GTKDOC_DOCDIR}
+}
+
+python () {
+    if bb.data.inherits_class("autotools", d):
+        d.appendVarFlag('do_configure', 'prefuncs', ' run_gtkdocize')
 }
 
 do_compile_prepend_class-target () {
Signature · 1 line
2.11.0