blob: 915ddd8e4d6cc1577b547122b027cb950381f6e7 [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
21SRC_URI = " \
22 http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz \
23 file://0001-gtk4-Preserve-compatibility-with-4.14.patch \
24"
Patrick Williamsb58112e2024-03-07 11:16:36 -060025SRC_URI[sha256sum] = "535b6452ed310fd5fb5c7dd6794b6213dac3b48e645e5bff3173741ec2cb3f2b"
Patrick Williams03514f12024-04-05 07:04:11 -050026
27inherit autotools pkgconfig upstream-version-is-even
28
29FILES:${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
30FILES:${PN}-doc += "${datadir}/devhelp"
31
32# .gir files from gobject-introspection are installed to ${libdir} when multilib is enabled
33GIRDIR_OPT = "${@'--girdir=${STAGING_LIBDIR}/gir-1.0' if d.getVar('MULTILIBS') else ''}"
34
35do_configure:prepend:class-target() {
36 # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot
37 # The wrapper will call a native vapigen
38 cat > ${B}/vapigen-wrapper << EOF
39#!/bin/sh
40vapigen-${SHRT_VER} ${GIRDIR_OPT} "\$@"
41EOF
42 chmod +x ${B}/vapigen-wrapper
43}
44
45EXTRA_OECONF += " --disable-valadoc"
46
47# Vapigen wrapper needs to be available system-wide, because it will be used
48# to build vapi files from all other packages with vala support
49do_install:append:class-target() {
50 install -d ${D}${bindir_crossscripts}/
51 install ${B}/vapigen-wrapper ${D}${bindir_crossscripts}/
52}
53
54# Put vapigen wrapper into target sysroot so that it can be used when building
55# vapi files.
56SYSROOT_DIRS += "${bindir_crossscripts}"
57
58inherit multilib_script
59MULTILIB_SCRIPTS = "${PN}:${bindir}/vala-gen-introspect-0.56"
60
61SYSROOT_PREPROCESS_FUNCS:append:class-target = " vapigen_sysroot_preprocess"
62vapigen_sysroot_preprocess() {
63 # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks
64 # up our wrapper.
65 sed -i \
66 -e "s|vapigen=.*|vapigen=${bindir_crossscripts}/vapigen-wrapper|" \
67 ${SYSROOT_DESTDIR}${libdir}/pkgconfig/vapigen-${SHRT_VER}.pc
68}
69
70SSTATE_SCAN_FILES += "vapigen-wrapper"
71
72PACKAGE_PREPROCESS_FUNCS += "vala_package_preprocess"
73
74vala_package_preprocess () {
75 rm -rf ${PKGD}${bindir_crossscripts}
76}