blob: 1261c02777f758d38b07b140ee081ee4e1c007ee [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"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05005DEPENDS = "bison-native flex-native glib-2.0"
6
7# Appending libxslt-native to dependencies has an effect
8# of rebuilding the manual, which is very slow. Let's do this
9# only when api-documentation distro feature is enabled.
10DEPENDS_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'libxslt-native', '', d)}"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050011
12# vala-native contains a native version of vapigen, which we use instead of the target one
13DEPENDS_append_class-target = " vala-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014BBCLASSEXTEND = "native"
15HOMEPAGE = "http://vala-project.org"
16LICENSE = "LGPLv2.1"
17LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
18
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050020
21SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050022inherit autotools pkgconfig upstream-version-is-even
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023
24FILES_${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
25FILES_${PN}-doc += "${datadir}/devhelp"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050026
27do_configure_prepend_class-target() {
28 # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot
29 # The wrapper will call a native vapigen
30 cat > ${B}/vapigen-wrapper << EOF
31#!/bin/sh
32vapigen-${SHRT_VER} "\$@"
33EOF
34 chmod +x ${B}/vapigen-wrapper
35}
36
37# Vapigen wrapper needs to be available system-wide, because it will be used
38# to build vapi files from all other packages with vala support
39do_install_append_class-target() {
40 install -d ${D}${bindir}/
41 install ${B}/vapigen-wrapper ${D}${bindir}/
42}
43
Patrick Williamsc0f7c042017-02-23 20:41:17 -060044# Put vapigen wrapper into target sysroot so that it can be used when building
45# vapi files.
46SYSROOT_DIRS_append_class-target = " ${bindir}"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050047
Patrick Williamsc0f7c042017-02-23 20:41:17 -060048SYSROOT_PREPROCESS_FUNCS_append_class-target = " vapigen_sysroot_preprocess"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050049vapigen_sysroot_preprocess() {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060050 # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks
51 # up our wrapper.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050052 sed -i \
53 -e "s|vapigen=.*|vapigen=${bindir}/vapigen-wrapper|" \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050054 ${SYSROOT_DESTDIR}${libdir}/pkgconfig/vapigen-${SHRT_VER}.pc
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050055}