diff options
author | Alexander Kanavin <alexander.kanavin@linux.intel.com> | 2016-03-09 17:01:53 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-12 22:11:44 +0000 |
commit | 235455d9a7f5055ac731666c0433dd459004c3bb (patch) | |
tree | 31e5304450b0d53eb93d3b52222b906b6cc1cd71 /meta/recipes-devtools/vala/vala.inc | |
parent | d1b96f159426763c5c2ebf2037e0d0bee662713f (diff) | |
download | poky-235455d9a7f5055ac731666c0433dd459004c3bb.tar.gz |
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>
Diffstat (limited to 'meta/recipes-devtools/vala/vala.inc')
-rw-r--r-- | meta/recipes-devtools/vala/vala.inc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-devtools/vala/vala.inc b/meta/recipes-devtools/vala/vala.inc index 43f9bb3c3c..2a8875f011 100644 --- a/meta/recipes-devtools/vala/vala.inc +++ b/meta/recipes-devtools/vala/vala.inc | |||
@@ -3,6 +3,9 @@ DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. | |||
3 | Vala compiles to plain C and has no runtime environment nor penalities whatsoever." | 3 | Vala compiles to plain C and has no runtime environment nor penalities whatsoever." |
4 | SECTION = "devel" | 4 | SECTION = "devel" |
5 | DEPENDS = "bison-native flex-native libxslt-native glib-2.0" | 5 | DEPENDS = "bison-native flex-native libxslt-native glib-2.0" |
6 | |||
7 | # vala-native contains a native version of vapigen, which we use instead of the target one | ||
8 | DEPENDS_append_class-target = " vala-native" | ||
6 | BBCLASSEXTEND = "native" | 9 | BBCLASSEXTEND = "native" |
7 | HOMEPAGE = "http://vala-project.org" | 10 | HOMEPAGE = "http://vala-project.org" |
8 | LICENSE = "LGPLv2.1" | 11 | LICENSE = "LGPLv2.1" |
@@ -15,3 +18,34 @@ inherit autotools pkgconfig upstream-version-is-even | |||
15 | 18 | ||
16 | FILES_${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/" | 19 | FILES_${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/" |
17 | FILES_${PN}-doc += "${datadir}/devhelp" | 20 | FILES_${PN}-doc += "${datadir}/devhelp" |
21 | |||
22 | do_configure_prepend_class-target() { | ||
23 | # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot | ||
24 | # The wrapper will call a native vapigen | ||
25 | cat > ${B}/vapigen-wrapper << EOF | ||
26 | #!/bin/sh | ||
27 | vapigen-${SHRT_VER} "\$@" | ||
28 | EOF | ||
29 | chmod +x ${B}/vapigen-wrapper | ||
30 | } | ||
31 | |||
32 | # Vapigen wrapper needs to be available system-wide, because it will be used | ||
33 | # to build vapi files from all other packages with vala support | ||
34 | do_install_append_class-target() { | ||
35 | install -d ${D}${bindir}/ | ||
36 | install ${B}/vapigen-wrapper ${D}${bindir}/ | ||
37 | } | ||
38 | |||
39 | |||
40 | SYSROOT_PREPROCESS_FUNCS_append_class-target += "vapigen_sysroot_preprocess" | ||
41 | |||
42 | vapigen_sysroot_preprocess() { | ||
43 | # Put vapigen wrapper into target sysroot so that it can be used when building vapi files. | ||
44 | sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir} | ||
45 | |||
46 | # Also, tweak the vapigen name in vapigen pkgconfig file, so that it picks up our | ||
47 | # wrapper. | ||
48 | sed -i \ | ||
49 | -e "s|vapigen=.*|vapigen=${bindir}/vapigen-wrapper|" \ | ||
50 | ${SYSROOT_DESTDIR}${datadir}/pkgconfig/vapigen-${SHRT_VER}.pc | ||
51 | } | ||