xz: update to 5.6.2.
[void-pkg.git] / common / build-style / meson.sh
blob5ea2eeda40097d204384c59fd105bcb4d4ac32ba
2 # This helper is for templates using meson.
5 do_configure() {
6 : ${meson_cmd:=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.
20 export AR="gcc-ar"
22 # unbuffered output for continuous logging
23 PYTHONUNBUFFERED=1 ${meson_cmd} setup \
24 --prefix=/usr \
25 --libdir=/usr/lib${XBPS_TARGET_WORDSIZE} \
26 --libexecdir=/usr/libexec \
27 --bindir=/usr/bin \
28 --sbindir=/usr/bin \
29 --includedir=/usr/include \
30 --datadir=/usr/share \
31 --mandir=/usr/share/man \
32 --infodir=/usr/share/info \
33 --localedir=/usr/share/locale \
34 --sysconfdir=/etc \
35 --localstatedir=/var \
36 --sharedstatedir=/var/lib \
37 --buildtype=plain \
38 --auto-features=auto \
39 --wrap-mode=nodownload \
40 -Db_lto=true -Db_ndebug=true \
41 -Db_staticpic=true \
42 ${configure_args} . ${meson_builddir}
45 do_build() {
46 : ${make_cmd:=ninja}
47 : ${make_build_target:=all}
48 : ${meson_builddir:=build}
50 ${make_cmd} -C ${meson_builddir} ${makejobs} ${make_build_args} ${make_build_target}
53 do_check() {
54 : ${make_cmd:=ninja}
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}
61 do_install() {
62 : ${make_cmd:=ninja}
63 : ${make_install_target:=install}
64 : ${meson_builddir:=build}
66 DESTDIR=${DESTDIR} ${make_cmd} -C ${meson_builddir} ${make_install_args} ${make_install_target}