[2/2] gtk-doc: improve calling of gtkdocize

Message ID 20180314112225.22192-2-ross.burton@intel.com
State New
Headers show
Series
  • [1/2] gtk-doc: always inherit python3native
Related show

Commit Message

Ross Burton March 14, 2018, 11:22 a.m.
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.

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta/classes/gtk-doc.bbclass | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

-- 
2.11.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/classes/gtk-doc.bbclass b/meta/classes/gtk-doc.bbclass
index 3f731cb93bf..cfeb49a1d00 100644
--- a/meta/classes/gtk-doc.bbclass
+++ b/meta/classes/gtk-doc.bbclass
@@ -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 () {