blob: 2a8875f0111935a11beaf6eed95221107aa8cc0f [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "C#-like programming language for easing GObject programming"
2DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. \
3Vala compiles to plain C and has no runtime environment nor penalities whatsoever."
4SECTION = "devel"
5DEPENDS = "bison-native flex-native libxslt-native glib-2.0"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05006
7# vala-native contains a native version of vapigen, which we use instead of the target one
8DEPENDS_append_class-target = " vala-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05009BBCLASSEXTEND = "native"
10HOMEPAGE = "http://vala-project.org"
11LICENSE = "LGPLv2.1"
12LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
13
14SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
15
16SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050017inherit autotools pkgconfig upstream-version-is-even
Patrick Williamsc124f4f2015-09-15 14:41:29 -050018
19FILES_${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
20FILES_${PN}-doc += "${datadir}/devhelp"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050021
22do_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
27vapigen-${SHRT_VER} "\$@"
28EOF
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
34do_install_append_class-target() {
35 install -d ${D}${bindir}/
36 install ${B}/vapigen-wrapper ${D}${bindir}/
37}
38
39
40SYSROOT_PREPROCESS_FUNCS_append_class-target += "vapigen_sysroot_preprocess"
41
42vapigen_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}