[oe-commits] [openembedded-core] 34/54: vala: provide a wrapper script to native vapigen for target vala-dependent recipes

git at git.openembedded.org git at git.openembedded.org
Mon Mar 7 11:57:01 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 62f1bbf3489b5e31141d2d53452efafff5b4f022
Author: Alexander Kanavin <alexander.kanavin at linux.intel.com>
AuthorDate: Wed Mar 2 16:47:27 2016 +0200

    vala: provide a wrapper script to native vapigen for target vala-dependent recipes
    
    Previously native vapigen was provided via a symlink to target sysroot
    which was causing build issues.
    
    Signed-off-by: Alexander Kanavin <alexander.kanavin at linux.intel.com>
---
 meta/recipes-devtools/vala/vala.inc | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/vala/vala.inc b/meta/recipes-devtools/vala/vala.inc
index e4e1fc0..2a8875f 100644
--- a/meta/recipes-devtools/vala/vala.inc
+++ b/meta/recipes-devtools/vala/vala.inc
@@ -19,9 +19,33 @@ inherit autotools pkgconfig upstream-version-is-even
 FILES_${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
 FILES_${PN}-doc += "${datadir}/devhelp"
 
+do_configure_prepend_class-target() {
+        # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot
+        # The wrapper will call a native vapigen
+        cat > ${B}/vapigen-wrapper << EOF
+#!/bin/sh
+vapigen-${SHRT_VER} "\$@"
+EOF
+        chmod +x ${B}/vapigen-wrapper
+}
+
+# Vapigen wrapper needs to be available system-wide, because it will be used
+# to build vapi files from all other packages with vala support
+do_install_append_class-target() {
+        install -d ${D}${bindir}/
+        install ${B}/vapigen-wrapper ${D}${bindir}/
+}
+
+
 SYSROOT_PREPROCESS_FUNCS_append_class-target += "vapigen_sysroot_preprocess"
 
-# Link native vapigen into target sysroot so that it is used when building vapi files.
 vapigen_sysroot_preprocess() {
-        ln -f -s ${STAGING_BINDIR_NATIVE}/vapigen* ${STAGING_BINDIR}
+        # Put vapigen wrapper into target sysroot so that it can be used when building vapi files.
+        sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir}
+
+        # Also, tweak the vapigen name in vapigen pkgconfig file, so that it picks up our
+        # wrapper.
+        sed -i \
+           -e "s|vapigen=.*|vapigen=${bindir}/vapigen-wrapper|" \
+           ${SYSROOT_DESTDIR}${datadir}/pkgconfig/vapigen-${SHRT_VER}.pc
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list