From 237da231cb340629ea94145a23148acdbbf6dcf3 Mon Sep 17 00:00:00 2001 From: maxice8 Date: Tue, 26 Feb 2019 11:56:47 -0300 Subject: [PATCH] build-style/meson: use do_patch to create crossfile --- common/build-style/meson.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/common/build-style/meson.sh b/common/build-style/meson.sh index afc080ce033..272b63c6ce1 100644 --- a/common/build-style/meson.sh +++ b/common/build-style/meson.sh @@ -1,9 +1,7 @@ # # This helper is for templates using meson. # -do_configure() { - : ${meson_cmd:=meson} - : ${meson_builddir:=build} +do_patch() { : ${meson_crossfile:=xbps_meson.cross} if [ "$CROSS_BUILD" ]; then @@ -71,6 +69,16 @@ cpu_family = '${_MESON_CPU_FAMILY}' cpu = '${_MESON_TARGET_CPU}' endian = '${_MESON_TARGET_ENDIAN}' EOF + + unset _MESON_CPU_FAMILY _MESON_TARGET_CPU _MESON_TARGET_ENDIAN + fi +} + +do_configure() { + : ${meson_cmd:=meson} + : ${meson_builddir:=build} + + if [ "$CROSS_BUILD" ]; then configure_args+=" --cross-file=${meson_crossfile}" # Meson tries to compile natively with CC, CXX, LD, AR @@ -88,8 +96,6 @@ EOF # is set, so set the PKG_CONFIG variable to tell Meson which pkg-config # it should use when searching for stuff in the build machine export PKG_CONFIG="/usr/bin/pkg-config" - - unset _MESON_CPU_FAMILY _MESON_TARGET_CPU _MESON_TARGET_ENDIAN fi # The binutils ar cannot perform LTO on static libraries so we have to use