2 # This helper is for templates using meson.
7 : ${meson_builddir:=build}
8 : ${meson_crossfile:="${XBPS_WRAPPERDIR}/meson/xbps_meson.cross"}
10 if [ "$CROSS_BUILD" ]; then
11 configure_args
+=" --cross-file=${meson_crossfile}"
14 # binutils ar needs a plugin when LTO is used on static libraries, so we
15 # have to use the gcc-ar wrapper that calls the correct plugin.
16 # As seen in https://github.com/mesonbuild/meson/issues/1646 (and its
17 # solution, https://github.com/mesonbuild/meson/pull/1649), meson fixed
18 # issues with static libraries + LTO by defaulting to gcc-ar themselves.
19 # We also force gcc-ar usage in the crossfile above.
22 # unbuffered output for continuous logging
23 PYTHONUNBUFFERED
=1 ${meson_cmd} setup \
25 --libdir=/usr
/lib
${XBPS_TARGET_WORDSIZE} \
26 --libexecdir=/usr
/libexec \
29 --includedir=/usr
/include \
30 --datadir=/usr
/share \
31 --mandir=/usr
/share
/man \
32 --infodir=/usr
/share
/info \
33 --localedir=/usr
/share
/locale \
35 --localstatedir=/var \
36 --sharedstatedir=/var
/lib \
38 --auto-features=auto \
39 --wrap-mode=nodownload \
40 -Db_lto=true
-Db_ndebug=true \
42 ${configure_args} .
${meson_builddir}
47 : ${make_build_target:=all}
48 : ${meson_builddir:=build}
50 ${make_cmd} -C ${meson_builddir} ${makejobs} ${make_build_args} ${make_build_target}
55 : ${make_check_target:=test}
56 : ${meson_builddir:=build}
58 ${make_check_pre} ${make_cmd} -C ${meson_builddir} ${makejobs} ${make_check_args} ${make_check_target}
63 : ${make_install_target:=install}
64 : ${meson_builddir:=build}
66 DESTDIR
=${DESTDIR} ${make_cmd} -C ${meson_builddir} ${make_install_args} ${make_install_target}