blob: 0177e86240fb2c5a9b91de70a49422a9a9e4c643 [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"
Patrick Williamsb58112e2024-03-07 11:16:36 -06006DEPENDS = "bison-native flex-native glib-2.0 gobject-introspection"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05007
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"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000016LICENSE = "LGPL-2.1-only"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017LIC_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 Williams7784c422022-11-17 07:29:11 -060045 install -d ${D}${bindir_crossscripts}/
46 install ${B}/vapigen-wrapper ${D}${bindir_crossscripts}/
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050047}
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 Williams7784c422022-11-17 07:29:11 -060051SYSROOT_DIRS += "${bindir_crossscripts}"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050052
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050053inherit multilib_script
54MULTILIB_SCRIPTS = "${PN}:${bindir}/vala-gen-introspect-0.56"
55
Patrick Williams213cb262021-08-07 19:21:33 -050056SYSROOT_PREPROCESS_FUNCS:append:class-target = " vapigen_sysroot_preprocess"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050057vapigen_sysroot_preprocess() {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060058 # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks
59 # up our wrapper.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050060 sed -i \
Patrick Williams7784c422022-11-17 07:29:11 -060061 -e "s|vapigen=.*|vapigen=${bindir_crossscripts}/vapigen-wrapper|" \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050062 ${SYSROOT_DESTDIR}${libdir}/pkgconfig/vapigen-${SHRT_VER}.pc
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050063}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080064
65SSTATE_SCAN_FILES += "vapigen-wrapper"
Andrew Geissler615f2f12022-07-15 14:00:58 -050066
67PACKAGE_PREPROCESS_FUNCS += "vala_package_preprocess"
68
69vala_package_preprocess () {
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050070 rm -rf ${PKGD}${bindir_crossscripts}
Andrew Geissler615f2f12022-07-15 14:00:58 -050071}