1*edff4923SAndrew GeisslerSUMMARY = "C#-like programming language for easing GObject programming"
2*edff4923SAndrew GeisslerHOMEPAGE = "http://vala-project.org"
3*edff4923SAndrew GeisslerDESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. \
4*edff4923SAndrew GeisslerVala compiles to plain C and has no runtime environment nor penalities whatsoever."
5*edff4923SAndrew GeisslerSECTION = "devel"
6*edff4923SAndrew GeisslerDEPENDS = "bison-native flex-native glib-2.0 gobject-introspection"
7*edff4923SAndrew Geissler
8*edff4923SAndrew Geissler# Appending libxslt-native to dependencies has an effect
9*edff4923SAndrew Geissler# of rebuilding the manual, which is very slow. Let's do this
10*edff4923SAndrew Geissler# only when api-documentation distro feature is enabled.
11*edff4923SAndrew GeisslerDEPENDS:append:class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'libxslt-native', '', d)}"
12*edff4923SAndrew Geissler
13*edff4923SAndrew Geissler# vala-native contains a native version of vapigen, which we use instead of the target one
14*edff4923SAndrew GeisslerDEPENDS:append:class-target = " vala-native"
15*edff4923SAndrew GeisslerBBCLASSEXTEND = "native"
16*edff4923SAndrew GeisslerLICENSE = "LGPL-2.1-only"
17*edff4923SAndrew GeisslerLIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
18*edff4923SAndrew Geissler
19*edff4923SAndrew GeisslerSHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
20*edff4923SAndrew Geissler
21*edff4923SAndrew GeisslerSRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz"
22*edff4923SAndrew GeisslerSRC_URI[sha256sum] = "26100c4e4ef0049c619275f140d97cf565883d00c7543c82bcce5a426934ed6a"
23*edff4923SAndrew Geissler
24*edff4923SAndrew Geisslerinherit autotools pkgconfig upstream-version-is-even
25*edff4923SAndrew Geissler
26*edff4923SAndrew GeisslerFILES:${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
27*edff4923SAndrew GeisslerFILES:${PN}-doc += "${datadir}/devhelp"
28*edff4923SAndrew Geissler
29*edff4923SAndrew Geissler# .gir files from gobject-introspection are installed to ${libdir} when multilib is enabled
30*edff4923SAndrew GeisslerGIRDIR_OPT = "${@'--girdir=${STAGING_LIBDIR}/gir-1.0' if d.getVar('MULTILIBS') else ''}"
31*edff4923SAndrew Geissler
32*edff4923SAndrew Geisslerdo_configure:prepend:class-target() {
33*edff4923SAndrew Geissler        # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot
34*edff4923SAndrew Geissler        # The wrapper will call a native vapigen
35*edff4923SAndrew Geissler        cat > ${B}/vapigen-wrapper << EOF
36*edff4923SAndrew Geissler#!/bin/sh
37*edff4923SAndrew Geisslervapigen-${SHRT_VER} ${GIRDIR_OPT} "\$@"
38*edff4923SAndrew GeisslerEOF
39*edff4923SAndrew Geissler        chmod +x ${B}/vapigen-wrapper
40*edff4923SAndrew Geissler}
41*edff4923SAndrew Geissler
42*edff4923SAndrew GeisslerEXTRA_OECONF += " --disable-valadoc"
43*edff4923SAndrew Geissler
44*edff4923SAndrew Geissler# Vapigen wrapper needs to be available system-wide, because it will be used
45*edff4923SAndrew Geissler# to build vapi files from all other packages with vala support
46*edff4923SAndrew Geisslerdo_install:append:class-target() {
47*edff4923SAndrew Geissler        install -d ${D}${bindir_crossscripts}/
48*edff4923SAndrew Geissler        install ${B}/vapigen-wrapper ${D}${bindir_crossscripts}/
49*edff4923SAndrew Geissler}
50*edff4923SAndrew Geissler
51*edff4923SAndrew Geissler# Put vapigen wrapper into target sysroot so that it can be used when building
52*edff4923SAndrew Geissler# vapi files.
53*edff4923SAndrew GeisslerSYSROOT_DIRS += "${bindir_crossscripts}"
54*edff4923SAndrew Geissler
55*edff4923SAndrew Geisslerinherit multilib_script
56*edff4923SAndrew GeisslerMULTILIB_SCRIPTS = "${PN}:${bindir}/vala-gen-introspect-0.56"
57*edff4923SAndrew Geissler
58*edff4923SAndrew GeisslerSYSROOT_PREPROCESS_FUNCS:append:class-target = " vapigen_sysroot_preprocess"
59*edff4923SAndrew Geisslervapigen_sysroot_preprocess() {
60*edff4923SAndrew Geissler        # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks
61*edff4923SAndrew Geissler        # up our wrapper.
62*edff4923SAndrew Geissler        sed -i \
63*edff4923SAndrew Geissler           -e "s|vapigen=.*|vapigen=${bindir_crossscripts}/vapigen-wrapper|" \
64*edff4923SAndrew Geissler           ${SYSROOT_DESTDIR}${libdir}/pkgconfig/vapigen-${SHRT_VER}.pc
65*edff4923SAndrew Geissler}
66*edff4923SAndrew Geissler
67*edff4923SAndrew GeisslerSSTATE_SCAN_FILES += "vapigen-wrapper"
68*edff4923SAndrew Geissler
69*edff4923SAndrew GeisslerPACKAGE_PREPROCESS_FUNCS += "vala_package_preprocess"
70*edff4923SAndrew Geissler
71*edff4923SAndrew Geisslervala_package_preprocess () {
72*edff4923SAndrew Geissler	rm -rf ${PKGD}${bindir_crossscripts}
73*edff4923SAndrew Geissler}
74