blob: 1a1115739d8e76b4a588dc9346cc1d327cf7ef5a [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "C#-like programming language for easing GObject programming"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06002HOMEPAGE = "http://vala-project.org"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. \
4Vala compiles to plain C and has no runtime environment nor penalities whatsoever."
5SECTION = "devel"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05006DEPENDS = "bison-native flex-native glib-2.0"
7
8# Appending libxslt-native to dependencies has an effect
9# of rebuilding the manual, which is very slow. Let's do this
10# only when api-documentation distro feature is enabled.
Patrick Williams213cb262021-08-07 19:21:33 -050011DEPENDS:append:class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'libxslt-native', '', d)}"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050012
13# vala-native contains a native version of vapigen, which we use instead of the target one
Patrick Williams213cb262021-08-07 19:21:33 -050014DEPENDS:append:class-target = " vala-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050015BBCLASSEXTEND = "native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050016LICENSE = "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
Patrick Williams213cb262021-08-07 19:21:33 -050024FILES:${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
25FILES:${PN}-doc += "${datadir}/devhelp"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050026
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080027# .gir files from gobject-introspection are installed to ${libdir} when multilib is enabled
28GIRDIR_OPT = "${@'--girdir=${STAGING_LIBDIR}/gir-1.0' if d.getVar('MULTILIBS') else ''}"
29
Patrick Williams213cb262021-08-07 19:21:33 -050030do_configure:prepend:class-target() {
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050031 # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot
32 # The wrapper will call a native vapigen
33 cat > ${B}/vapigen-wrapper << EOF
34#!/bin/sh
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080035vapigen-${SHRT_VER} ${GIRDIR_OPT} "\$@"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050036EOF
37 chmod +x ${B}/vapigen-wrapper
38}
39
Brad Bishopc342db32019-05-15 21:57:59 -040040EXTRA_OECONF += " --disable-valadoc"
Brad Bishop316dfdd2018-06-25 12:45:53 -040041
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050042# Vapigen wrapper needs to be available system-wide, because it will be used
43# to build vapi files from all other packages with vala support
Patrick Williams213cb262021-08-07 19:21:33 -050044do_install:append:class-target() {
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050045 install -d ${D}${bindir}/
46 install ${B}/vapigen-wrapper ${D}${bindir}/
47}
48
Patrick Williamsc0f7c042017-02-23 20:41:17 -060049# Put vapigen wrapper into target sysroot so that it can be used when building
50# vapi files.
Patrick Williams213cb262021-08-07 19:21:33 -050051SYSROOT_DIRS:append:class-target = " ${bindir}"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050052
Patrick Williams213cb262021-08-07 19:21:33 -050053SYSROOT_PREPROCESS_FUNCS:append:class-target = " vapigen_sysroot_preprocess"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050054vapigen_sysroot_preprocess() {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060055 # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks
56 # up our wrapper.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050057 sed -i \
58 -e "s|vapigen=.*|vapigen=${bindir}/vapigen-wrapper|" \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050059 ${SYSROOT_DESTDIR}${libdir}/pkgconfig/vapigen-${SHRT_VER}.pc
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050060}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080061
62SSTATE_SCAN_FILES += "vapigen-wrapper"