blob: 1c8e4fc6737657176a775c198112398a427a0d88 [file] [log] [blame]
Patrick Williams03514f12024-04-05 07:04:11 -05001SUMMARY = "C#-like programming language for easing GObject programming"
2HOMEPAGE = "http://vala-project.org"
3DESCRIPTION = "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"
6DEPENDS = "bison-native flex-native glib-2.0 gobject-introspection"
Patrick Williamsb58112e2024-03-07 11:16:36 -06007
Patrick Williams03514f12024-04-05 07:04:11 -05008# 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.
11DEPENDS:append:class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'libxslt-native', '', d)}"
12
13# vala-native contains a native version of vapigen, which we use instead of the target one
14DEPENDS:append:class-target = " vala-native"
15BBCLASSEXTEND = "native"
16LICENSE = "LGPL-2.1-only"
17LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
18
19SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
20
Patrick Williams44b3caf2024-04-12 16:51:14 -050021SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz"
22SRC_URI[sha256sum] = "05487b5600f5d2f09e66a753cccd8f39c1bff9f148aea1b7774d505b9c8bca9b"
Patrick Williams03514f12024-04-05 07:04:11 -050023
24inherit autotools pkgconfig upstream-version-is-even
25
26FILES:${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
27FILES:${PN}-doc += "${datadir}/devhelp"
28
29# .gir files from gobject-introspection are installed to ${libdir} when multilib is enabled
30GIRDIR_OPT = "${@'--girdir=${STAGING_LIBDIR}/gir-1.0' if d.getVar('MULTILIBS') else ''}"
31
32do_configure:prepend:class-target() {
33 # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot
34 # The wrapper will call a native vapigen
35 cat > ${B}/vapigen-wrapper << EOF
36#!/bin/sh
37vapigen-${SHRT_VER} ${GIRDIR_OPT} "\$@"
38EOF
39 chmod +x ${B}/vapigen-wrapper
40}
41
42EXTRA_OECONF += " --disable-valadoc"
43
44# Vapigen wrapper needs to be available system-wide, because it will be used
45# to build vapi files from all other packages with vala support
46do_install:append:class-target() {
47 install -d ${D}${bindir_crossscripts}/
48 install ${B}/vapigen-wrapper ${D}${bindir_crossscripts}/
49}
50
51# Put vapigen wrapper into target sysroot so that it can be used when building
52# vapi files.
53SYSROOT_DIRS += "${bindir_crossscripts}"
54
55inherit multilib_script
56MULTILIB_SCRIPTS = "${PN}:${bindir}/vala-gen-introspect-0.56"
57
58SYSROOT_PREPROCESS_FUNCS:append:class-target = " vapigen_sysroot_preprocess"
59vapigen_sysroot_preprocess() {
60 # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks
61 # up our wrapper.
62 sed -i \
63 -e "s|vapigen=.*|vapigen=${bindir_crossscripts}/vapigen-wrapper|" \
64 ${SYSROOT_DESTDIR}${libdir}/pkgconfig/vapigen-${SHRT_VER}.pc
65}
66
67SSTATE_SCAN_FILES += "vapigen-wrapper"
68
69PACKAGE_PREPROCESS_FUNCS += "vala_package_preprocess"
70
71vala_package_preprocess () {
72 rm -rf ${PKGD}${bindir_crossscripts}
73}