vala: add vala/valac wrapper
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Wed, 9 Mar 2016 13:15:43 +0000 (10:15 -0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 22 Mar 2016 22:29:39 +0000 (23:29 +0100)
vala/valac can use gir and vapi data files installed by other packages,
but since these are normally installed to staging and host-vala looks
for them in the host directory (logically) this leads to failure.
So wrap them to call the real tool and add this information via
command-line parameters to them.

This is required for vala-in-vala bindings (vapi).

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/vala/vala-wrapper [new file with mode: 0644]
package/vala/vala.mk

diff --git a/package/vala/vala-wrapper b/package/vala/vala-wrapper
new file mode 100644 (file)
index 0000000..ae2f7ca
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+$0-@VALA_VERSION@ --vapidir=${STAGING_DIR}/usr/share/vala/vapi --girdir=${STAGING_DIR}/usr/share/gir-1.0 $@
index 57a695670e6973e5e7791ba077645281764b522a..b236c54f9cda063f81777169d6691b7369139c49 100644 (file)
@@ -16,4 +16,17 @@ HOST_VALA_DEPENDENCIES = host-bison host-flex host-libglib2
 # available".
 HOST_VALA_CONF_ENV = ac_cv_path_XSLTPROC=:
 
+# We wrap vala & valac to point to the proper gir and vapi data dirs
+# Otherwise we'll get host directory data which isn't enough
+define HOST_VALA_INSTALL_WRAPPER
+       $(INSTALL) -D -m 0755 package/vala/vala-wrapper \
+               $(HOST_DIR)/usr/bin/vala
+       $(INSTALL) -D -m 0755 package/vala/vala-wrapper \
+               $(HOST_DIR)/usr/bin/valac
+       $(SED) 's,@VALA_VERSION@,$(VALA_VERSION_MAJOR),' \
+               $(HOST_DIR)/usr/bin/vala \
+               $(HOST_DIR)/usr/bin/valac
+endef
+HOST_VALA_POST_INSTALL_HOOKS += HOST_VALA_INSTALL_WRAPPER
+
 $(eval $(host-autotools-package))