Skip to content

build: Honor VALAC env var in vala-pack build rules

This is rather hacky, but seems to work..

A better way suggestion or implementation would be welcome, but this gets it building correctly for my downstream Gentoo package. We need this, because we provide multiple vala versions, and control which gets used in our "packages" via VALAC and VAPIGEN variables. Basically we need to know which version gets used, thus we make a choice in the package semi-automatically and tie the final package (at users system) to that version. This works when VALAC and VAPIGEN env vars are honored, like gnome.generate_vapi and meson.get_compiler('vala') DO honor, but find_program doesn't (at least unless we hack even more things into a cross-file for native builds..).

Other options I couldn't figure out if is possible to implement, would be reading VALAC env var ourselves (but that's not supported per ), or getting the version matching out from meson.get_compiler('vala') returned object in a cleaner way than launching the executable with --api-version. Or some even better and smarter way I couldn't think of.

Merge request reports