automation: adapt build_from_source to use meson

As autotools is deprecated, we must build with meson for
NetworkManager-1.47 or greater. As we plan to drop autotools in
NetworkManager-1.50, we must do the change as soon as possible.
This commit is contained in:
Fernando Fernandez Mancera 2024-05-13 12:06:47 +02:00
parent 271ec6dde5
commit a287659c5f

View file

@ -163,44 +163,89 @@ echo "HEAD is $(git rev-parse HEAD)"
# enable randomization for unit-tests. # enable randomization for unit-tests.
export NMTST_SEED_RAND= export NMTST_SEED_RAND=
LAST_TAG=$(git describe | cut -d "." -f 2)
if [ "$LAST_TAG" -lt "47" ]; then
export USE_AUTOTOOLS=1
fi
if [[ "$DO_TEST_BUILD" == yes ]]; then if [[ "$DO_TEST_BUILD" == yes ]]; then
NOCONFIGURE=yes ./autogen.sh
./configure \ if [[ $USE_AUTOTOOLS != 1 ]]; then
PYTHON="${PYTHON}" \ meson setup "./build" \
--enable-maintainer-mode \ -Dwarning_level=2 \
--enable-more-warnings=error \ --prefix=/opt/test \
--prefix=/opt/test \ --sysconfdir=/etc \
--sysconfdir=/etc \ -Ddocs=true \
--enable-gtk-doc \ -Dmore_asserts=all \
--enable-more-asserts \ -Dmore_logging=true \
--with-more-asserts=100 \ -Dintrospection=true \
--enable-more-logging \ -Dvalgrind=true \
--enable-compile-warnings=yes\ -Dconcheck=true \
--with-valgrind=no \ -Difcfg_rh=true \
--enable-concheck \ -Difupdown=true \
--enable-ifcfg-rh \ -Dvapi=true \
--enable-ifcfg-suse \ -Dpolkit=true \
--enable-ifupdown \ -Dnmtui=true \
--enable-ifnet \ -Dmodem_manager=true \
--enable-vala=yes \ -Dsuspend_resume=systemd \
--enable-polkit=yes \ -Dteamdctl=true \
--with-nmtui=yes \ -Dtests=root \
--with-modem-manager-1 \ -Dnetconfig=no \
--with-suspend-resume=systemd \ -Dresolvconf=no \
--enable-teamdctl=yes \ -Dcrypto=nss \
--enable-tests=root \ -Dsession_tracking=systemd \
--with-netconfig=/path/does/not/exist/netconfig \ -Dconsole_kit=true \
--with-resolvconf=/path/does/not/exist/resolvconf \ -Dsystemd_logind=true \
--with-crypto=nss \ -Dconfig_logging_backend_default=syslog \
--with-session-tracking=systemd \ -Dconfig_wifi_backend_default=wpa_supplicant \
--with-consolekit=yes \ -Dlibaudit=yes-disabled-by-default \
--with-systemd-logind=yes \ -Dnm_cloud_setup=true \
--with-consolekit=yes -Dconfig_dhcp_default=internal \
-Dconfig_dns_rc_manager_default=auto \
-Diptables=/usr/sbin/iptables \
-Dnft=/usr/bin/nft
make -j20 ninja -C ./build
make check -k ninja test -C ./build
else
NOCONFIGURE=yes ./autogen.sh
./configure \
PYTHON="${PYTHON}" \
--enable-maintainer-mode \
--enable-more-warnings=error \
--prefix=/opt/test \
--sysconfdir=/etc \
--enable-gtk-doc \
--enable-more-asserts \
--with-more-asserts=100 \
--enable-more-logging \
--enable-compile-warnings=yes \
--with-valgrind=no \
--enable-concheck \
--enable-ifcfg-rh \
--enable-ifcfg-suse \
--enable-ifupdown \
--enable-ifnet \
--enable-vala=yes \
--enable-polkit=yes \
--with-nmtui=yes \
--with-modem-manager-1 \
--with-suspend-resume=systemd \
--enable-teamdctl=yes \
--enable-tests=root \
--with-netconfig=/path/does/not/exist/netconfig \
--with-resolvconf=/path/does/not/exist/resolvconf \
--with-crypto=nss \
--with-session-tracking=systemd \
--with-consolekit=yes \
--with-systemd-logind=yes \
--with-consolekit=yes
make -j20
make check -k
fi
fi fi
if [[ "$DO_TEST_PACKAGE" == yes || "$DO_INSTALL" == yes ]]; then if [[ "$DO_TEST_PACKAGE" == yes || "$DO_INSTALL" == yes ]]; then