From fe8d02d0d6055645018db8713c71c3e5a80a3d72 Mon Sep 17 00:00:00 2001 From: maxice8 Date: Tue, 5 Feb 2019 15:25:15 -0200 Subject: [PATCH] vala: prefix important variables in pkg-config file with pc_sysrootdir To allow cross compilation we need to pass those variables with the pc_sysrootdir prefix, otherwise the values will be from the host system. --- srcpkgs/vala/template | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/srcpkgs/vala/template b/srcpkgs/vala/template index 5dcf0a9f870..aa02d8a4322 100644 --- a/srcpkgs/vala/template +++ b/srcpkgs/vala/template @@ -1,7 +1,7 @@ # Template file for 'vala' pkgname=vala version=0.42.5 -revision=1 +revision=2 build_style=gnu-configure configure_args="--disable-graphviz" hostmakedepends="flex libxslt pkg-config automake libtool" @@ -28,6 +28,18 @@ pre_configure() { autoreconf -fi } +post_install() { + # Prefix the variables 'datadir' 'vapidir' and 'vapidir_versioned' + # with pc_sysrootdir so it gets expanded to the value of + # PKG_CONFIG_SYSROOT_DIR, this is necessary for packages that + # query pkg-config for the variables as we need to return the + # values from the cross environment not the native one. + vsed -e 's|^datadir=.*|datadir=${pc_sysrootdir}/${datarootdir}|g' \ + -e 's|^vapidir=.*|vapidir=${pc_sysrootdir}/${datadir}/vala/vapi|g' \ + -e 's|^vapidir_versioned=.*|vapidir_versioned=${pc_sysrootdir}/${datadir}/vala-0.42/vapi|g' \ + -i ${DESTDIR}/usr/lib/pkgconfig/vapigen-0.42.pc +} + libvala_package() { short_desc+=" - shared library" pkg_install() {