Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "C#-like programming language for easing GObject programming" |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 2 | HOMEPAGE = "http://vala-project.org" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 3 | DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. \ |
| 4 | Vala compiles to plain C and has no runtime environment nor penalities whatsoever." |
| 5 | SECTION = "devel" |
Patrick Williams | b58112e | 2024-03-07 11:16:36 -0600 | [diff] [blame^] | 6 | DEPENDS = "bison-native flex-native glib-2.0 gobject-introspection" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 11 | DEPENDS:append:class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'libxslt-native', '', d)}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 12 | |
| 13 | # vala-native contains a native version of vapigen, which we use instead of the target one |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 14 | DEPENDS:append:class-target = " vala-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 15 | BBCLASSEXTEND = "native" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 16 | LICENSE = "LGPL-2.1-only" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 17 | LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" |
| 18 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 19 | SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 20 | |
| 21 | SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 22 | inherit autotools pkgconfig upstream-version-is-even |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 23 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 24 | FILES:${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/" |
| 25 | FILES:${PN}-doc += "${datadir}/devhelp" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 26 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 27 | # .gir files from gobject-introspection are installed to ${libdir} when multilib is enabled |
| 28 | GIRDIR_OPT = "${@'--girdir=${STAGING_LIBDIR}/gir-1.0' if d.getVar('MULTILIBS') else ''}" |
| 29 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 30 | do_configure:prepend:class-target() { |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 31 | # 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 Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 35 | vapigen-${SHRT_VER} ${GIRDIR_OPT} "\$@" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 36 | EOF |
| 37 | chmod +x ${B}/vapigen-wrapper |
| 38 | } |
| 39 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 40 | EXTRA_OECONF += " --disable-valadoc" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 41 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 42 | # 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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 44 | do_install:append:class-target() { |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 45 | install -d ${D}${bindir_crossscripts}/ |
| 46 | install ${B}/vapigen-wrapper ${D}${bindir_crossscripts}/ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 47 | } |
| 48 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 49 | # Put vapigen wrapper into target sysroot so that it can be used when building |
| 50 | # vapi files. |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 51 | SYSROOT_DIRS += "${bindir_crossscripts}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 52 | |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 53 | inherit multilib_script |
| 54 | MULTILIB_SCRIPTS = "${PN}:${bindir}/vala-gen-introspect-0.56" |
| 55 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 56 | SYSROOT_PREPROCESS_FUNCS:append:class-target = " vapigen_sysroot_preprocess" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 57 | vapigen_sysroot_preprocess() { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 58 | # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks |
| 59 | # up our wrapper. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 60 | sed -i \ |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 61 | -e "s|vapigen=.*|vapigen=${bindir_crossscripts}/vapigen-wrapper|" \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 62 | ${SYSROOT_DESTDIR}${libdir}/pkgconfig/vapigen-${SHRT_VER}.pc |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 63 | } |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 64 | |
| 65 | SSTATE_SCAN_FILES += "vapigen-wrapper" |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 66 | |
| 67 | PACKAGE_PREPROCESS_FUNCS += "vala_package_preprocess" |
| 68 | |
| 69 | vala_package_preprocess () { |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 70 | rm -rf ${PKGD}${bindir_crossscripts} |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 71 | } |