vala: enable the use of vapigen by packages with vala support
Now that gobject-introspection is supported, generation of .vapi files for develeloping Vala code against gobject-based libraries should be supported as well. (From OE-Core rev: 1e2739169fe0db8c6727f3c17dc79e3846033d62) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
d1b96f1594
commit
235455d9a7
|
@ -3,6 +3,9 @@ DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming.
|
|||
Vala compiles to plain C and has no runtime environment nor penalities whatsoever."
|
||||
SECTION = "devel"
|
||||
DEPENDS = "bison-native flex-native libxslt-native glib-2.0"
|
||||
|
||||
# vala-native contains a native version of vapigen, which we use instead of the target one
|
||||
DEPENDS_append_class-target = " vala-native"
|
||||
BBCLASSEXTEND = "native"
|
||||
HOMEPAGE = "http://vala-project.org"
|
||||
LICENSE = "LGPLv2.1"
|
||||
|
@ -15,3 +18,34 @@ 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"
|
||||
|
||||
vapigen_sysroot_preprocess() {
|
||||
# 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
|
||||
}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
From dbb1c58e86f2af4613f3ac9571d9b163d4bca675 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Kanavin <alex.kanavin@gmail.com>
|
||||
Date: Fri, 23 Oct 2015 16:13:54 +0300
|
||||
Subject: [PATCH] vapigen.m4: use $PKG_CONFIG_SYSROOT_DIR
|
||||
|
||||
This is necessary in cross-compiling environments, where directories
|
||||
returned by pkg-config should be prefixed with sysroot location.
|
||||
|
||||
Upstream-Status: Pending [review in oe-core list]
|
||||
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
|
||||
---
|
||||
vapigen/vapigen.m4 | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/vapigen/vapigen.m4 b/vapigen/vapigen.m4
|
||||
index 2c435e7..6228991 100644
|
||||
--- a/vapigen/vapigen.m4
|
||||
+++ b/vapigen/vapigen.m4
|
||||
@@ -82,12 +82,12 @@ AC_DEFUN([VAPIGEN_CHECK],
|
||||
|
||||
AS_CASE([$enable_vala],
|
||||
[yes], [
|
||||
- VAPIGEN=`$PKG_CONFIG --variable=vapigen $vapigen_pkg_name`
|
||||
- VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir $vapigen_pkg_name`/vala/Makefile.vapigen
|
||||
+ VAPIGEN=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=vapigen $vapigen_pkg_name`
|
||||
+ VAPIGEN_MAKEFILE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=datadir $vapigen_pkg_name`/vala/Makefile.vapigen
|
||||
AS_IF([test "x$2" = "x"], [
|
||||
- VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir $vapigen_pkg_name`
|
||||
+ VAPIGEN_VAPIDIR=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=vapidir $vapigen_pkg_name`
|
||||
], [
|
||||
- VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned $vapigen_pkg_name`
|
||||
+ VAPIGEN_VAPIDIR=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=vapidir_versioned $vapigen_pkg_name`
|
||||
])
|
||||
])
|
||||
|
||||
--
|
||||
2.1.4
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
require ${BPN}.inc
|
||||
|
||||
SRC_URI += " file://0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch"
|
||||
SRC_URI += " file://0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch \
|
||||
file://0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "cc2eb2384fc10038b643753d734a5a51"
|
||||
SRC_URI[sha256sum] = "23add78e5c6a5e6df019d4a885c9c79814c9e0b957519ec8a4f4d826c4e5df2c"
|
||||
|
|
Loading…
Reference in New Issue