Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "C#-like programming language for easing GObject programming" |
| 2 | DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. \ |
| 3 | Vala compiles to plain C and has no runtime environment nor penalities whatsoever." |
| 4 | SECTION = "devel" |
| 5 | DEPENDS = "bison-native flex-native libxslt-native glib-2.0" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 6 | |
| 7 | # vala-native contains a native version of vapigen, which we use instead of the target one |
| 8 | DEPENDS_append_class-target = " vala-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 9 | BBCLASSEXTEND = "native" |
| 10 | HOMEPAGE = "http://vala-project.org" |
| 11 | LICENSE = "LGPLv2.1" |
| 12 | LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" |
| 13 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 14 | SHRT_VER = "${@d.getVar('PV', True).split('.')[0]}.${@d.getVar('PV', True).split('.')[1]}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 15 | |
| 16 | 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] | 17 | inherit autotools pkgconfig upstream-version-is-even |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 18 | |
| 19 | FILES_${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/" |
| 20 | FILES_${PN}-doc += "${datadir}/devhelp" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 21 | |
| 22 | do_configure_prepend_class-target() { |
| 23 | # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot |
| 24 | # The wrapper will call a native vapigen |
| 25 | cat > ${B}/vapigen-wrapper << EOF |
| 26 | #!/bin/sh |
| 27 | vapigen-${SHRT_VER} "\$@" |
| 28 | EOF |
| 29 | chmod +x ${B}/vapigen-wrapper |
| 30 | } |
| 31 | |
| 32 | # Vapigen wrapper needs to be available system-wide, because it will be used |
| 33 | # to build vapi files from all other packages with vala support |
| 34 | do_install_append_class-target() { |
| 35 | install -d ${D}${bindir}/ |
| 36 | install ${B}/vapigen-wrapper ${D}${bindir}/ |
| 37 | } |
| 38 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 39 | # Put vapigen wrapper into target sysroot so that it can be used when building |
| 40 | # vapi files. |
| 41 | SYSROOT_DIRS_append_class-target = " ${bindir}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 42 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 43 | SYSROOT_PREPROCESS_FUNCS_append_class-target = " vapigen_sysroot_preprocess" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 44 | vapigen_sysroot_preprocess() { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 45 | # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks |
| 46 | # up our wrapper. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 47 | sed -i \ |
| 48 | -e "s|vapigen=.*|vapigen=${bindir}/vapigen-wrapper|" \ |
| 49 | ${SYSROOT_DESTDIR}${datadir}/pkgconfig/vapigen-${SHRT_VER}.pc |
| 50 | } |