build_style/meson.sh: add support for using qemu as exe_wrapper

This commit is contained in:
John 2019-10-16 23:40:47 +02:00
parent 1a13424dd5
commit 260ce1acd2

View file

@ -69,6 +69,10 @@ cpu_family = '${_MESON_CPU_FAMILY}'
cpu = '${_MESON_TARGET_CPU}'
endian = '${_MESON_TARGET_ENDIAN}'
EOF
if [ "${hostmakedepends}" != "${hostmakedepends/qemu-user-static/}" ]; then
sed -e "/\[binaries\]/ a exe_wrapper = '/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static'" \
-i ${meson_crossfile}
fi
unset _MESON_CPU_FAMILY _MESON_TARGET_CPU _MESON_TARGET_ENDIAN
fi
@ -78,6 +82,7 @@ do_configure() {
: ${meson_cmd:=meson}
: ${meson_builddir:=build}
: ${meson_crossfile:=xbps_meson.cross}
export QEMU_LD_PREFIX=${XBPS_CROSS_BASE}
if [ "$CROSS_BUILD" ]; then
configure_args+=" --cross-file=${meson_crossfile}"
@ -130,6 +135,7 @@ do_build() {
: ${make_cmd:=ninja}
: ${make_build_target:=all}
: ${meson_builddir:=build}
export QEMU_LD_PREFIX=${XBPS_CROSS_BASE}
${make_cmd} -C ${meson_builddir} ${makejobs} ${make_build_args} ${make_build_target}
}
@ -146,6 +152,7 @@ do_install() {
: ${make_cmd:=ninja}
: ${make_install_target:=install}
: ${meson_builddir:=build}
export QEMU_LD_PREFIX=${XBPS_CROSS_BASE}
DESTDIR=${DESTDIR} ${make_cmd} -C ${meson_builddir} ${make_install_args} ${make_install_target}
}