2017-04-28 09:28:42 +02:00
|
|
|
#
|
2017-11-24 07:43:34 +01:00
|
|
|
# This helper is for templates using meson.
|
2017-04-28 09:28:42 +02:00
|
|
|
#
|
2019-02-26 15:56:47 +01:00
|
|
|
|
|
|
|
do_configure() {
|
|
|
|
: ${meson_cmd:=meson}
|
|
|
|
: ${meson_builddir:=build}
|
2023-09-18 21:40:49 +02:00
|
|
|
: ${meson_crossfile:="${XBPS_WRAPPERDIR}/meson/xbps_meson.cross"}
|
2019-02-26 15:56:47 +01:00
|
|
|
|
|
|
|
if [ "$CROSS_BUILD" ]; then
|
2017-09-24 01:42:47 +02:00
|
|
|
configure_args+=" --cross-file=${meson_crossfile}"
|
|
|
|
fi
|
2017-04-28 09:28:42 +02:00
|
|
|
|
2021-01-13 21:37:28 +01:00
|
|
|
# binutils ar needs a plugin when LTO is used on static libraries, so we
|
|
|
|
# have to use the gcc-ar wrapper that calls the correct plugin.
|
|
|
|
# As seen in https://github.com/mesonbuild/meson/issues/1646 (and its
|
|
|
|
# solution, https://github.com/mesonbuild/meson/pull/1649), meson fixed
|
|
|
|
# issues with static libraries + LTO by defaulting to gcc-ar themselves.
|
|
|
|
# We also force gcc-ar usage in the crossfile above.
|
|
|
|
export AR="gcc-ar"
|
|
|
|
|
2021-10-12 22:35:38 +02:00
|
|
|
# unbuffered output for continuous logging
|
2022-10-31 12:06:46 +01:00
|
|
|
PYTHONUNBUFFERED=1 ${meson_cmd} setup \
|
2018-10-09 12:13:52 +02:00
|
|
|
--prefix=/usr \
|
2020-12-22 22:06:08 +01:00
|
|
|
--libdir=/usr/lib${XBPS_TARGET_WORDSIZE} \
|
2018-10-09 12:13:52 +02:00
|
|
|
--libexecdir=/usr/libexec \
|
|
|
|
--bindir=/usr/bin \
|
|
|
|
--sbindir=/usr/bin \
|
|
|
|
--includedir=/usr/include \
|
|
|
|
--datadir=/usr/share \
|
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--infodir=/usr/share/info \
|
|
|
|
--localedir=/usr/share/locale \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--sharedstatedir=/var/lib \
|
|
|
|
--buildtype=plain \
|
2020-10-15 00:03:31 +02:00
|
|
|
--auto-features=auto \
|
2018-10-09 12:13:52 +02:00
|
|
|
--wrap-mode=nodownload \
|
|
|
|
-Db_lto=true -Db_ndebug=true \
|
2019-02-05 07:40:31 +01:00
|
|
|
-Db_staticpic=true \
|
2018-10-09 12:13:52 +02:00
|
|
|
${configure_args} . ${meson_builddir}
|
2017-04-28 09:28:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
do_build() {
|
|
|
|
: ${make_cmd:=ninja}
|
|
|
|
: ${make_build_target:=all}
|
|
|
|
: ${meson_builddir:=build}
|
|
|
|
|
|
|
|
${make_cmd} -C ${meson_builddir} ${makejobs} ${make_build_args} ${make_build_target}
|
|
|
|
}
|
|
|
|
|
2017-11-27 23:22:24 +01:00
|
|
|
do_check() {
|
|
|
|
: ${make_cmd:=ninja}
|
|
|
|
: ${make_check_target:=test}
|
|
|
|
: ${meson_builddir:=build}
|
|
|
|
|
2022-02-28 14:40:07 +01:00
|
|
|
${make_check_pre} ${make_cmd} -C ${meson_builddir} ${makejobs} ${make_check_args} ${make_check_target}
|
2017-11-27 23:22:24 +01:00
|
|
|
}
|
|
|
|
|
2017-04-28 09:28:42 +02:00
|
|
|
do_install() {
|
|
|
|
: ${make_cmd:=ninja}
|
|
|
|
: ${make_install_target:=install}
|
|
|
|
: ${meson_builddir:=build}
|
|
|
|
|
|
|
|
DESTDIR=${DESTDIR} ${make_cmd} -C ${meson_builddir} ${make_install_args} ${make_install_target}
|
|
|
|
}
|