contrib/fedora: add --meson option to build_clean

This allows the script user to complete the entire build only using meson instead of autotools.
This commit is contained in:
Jan Vaclav
2023-12-07 13:32:54 +01:00
parent 7502787959
commit 95f7c8e128

View File

@@ -19,8 +19,9 @@ usage() {
echo " -c|--clean: run \`git-clean -fdx :/\` before build" echo " -c|--clean: run \`git-clean -fdx :/\` before build"
echo " -S|--srpm: only build the SRPM" echo " -S|--srpm: only build the SRPM"
echo " -g|--git: create tarball from current git HEAD (skips make dist)" echo " -g|--git: create tarball from current git HEAD (skips make dist)"
echo " -Q|--quick: only run \`make dist\` instead of \`make distcheck\`" echo " -Q|--quick: only create the distribution tarball, without running checks"
echo " -N|--no-dist: skip creating the source tarball if you already did \`make dist\`" echo " -N|--no-dist: skip creating the source tarball if you already did \`make dist\`"
echo " -m|--meson: use meson to create the source tarball"
echo " -w|--with \$OPTION: pass --with \$OPTION to rpmbuild. For example --with debug" echo " -w|--with \$OPTION: pass --with \$OPTION to rpmbuild. For example --with debug"
echo " -W|--without \$OPTION: pass --without \$OPTION to rpmbuild. For example --without debug" echo " -W|--without \$OPTION: pass --without \$OPTION to rpmbuild. For example --without debug"
echo " -s|--snapshot TEXT: use TEXT as the snapshot version for the new package (overwrites \$NM_BUILD_SNAPSHOT environment)" echo " -s|--snapshot TEXT: use TEXT as the snapshot version for the new package (overwrites \$NM_BUILD_SNAPSHOT environment)"
@@ -97,6 +98,10 @@ while [[ $# -gt 0 ]]; do
IGNORE_DIRTY=1 IGNORE_DIRTY=1
SOURCE_FROM_GIT=1 SOURCE_FROM_GIT=1
;; ;;
-m|--meson)
USE_MESON=1
WITH_LIST=("${WITH_LIST[@]}" "--with" "meson")
;;
-Q|--quick) -Q|--quick)
QUICK=1 QUICK=1
;; ;;
@@ -188,45 +193,87 @@ if [[ $IGNORE_DIRTY != 1 ]]; then
fi fi
fi fi
get_version_meson() {
meson introspect "$GITDIR/build" --projectinfo | jq -r .version
}
if [[ $NO_DIST != 1 ]]; then if [[ $NO_DIST != 1 ]]; then
./autogen.sh \ if [[ $USE_MESON = 1 ]]; then
--with-runstatedir=/run \ meson setup "$GITDIR/build" \
--program-prefix= \ --prefix=/usr \
--prefix=/usr \ --bindir=/usr/bin \
--exec-prefix=/usr \ --sbindir=/usr/sbin \
--bindir=/usr/bin \ --sysconfdir=/etc \
--sbindir=/usr/sbin \ --datadir=/usr/share \
--sysconfdir=/etc \ --includedir=/usr/include \
--datadir=/usr/share \ --libdir=/usr/lib \
--includedir=/usr/include \ --libexecdir=/usr/libexec \
--libdir=/usr/lib \ --localstatedir=/var \
--libexecdir=/usr/libexec \ --sharedstatedir=/var/lib \
--localstatedir=/var \ --mandir=/usr/share/man \
--sharedstatedir=/var/lib \ --infodir=/usr/share/info \
--mandir=/usr/share/man \ -Ddocs=true \
--infodir=/usr/share/info \ -Dintrospection=true \
\ -Difcfg_rh=true \
--disable-dependency-tracking \ -Difupdown=true \
--enable-gtk-doc \ -Dconfig_logging_backend_default=syslog \
--enable-introspection \ -Dconfig_wifi_backend_default=wpa_supplicant \
--enable-ifcfg-rh \ -Dlibaudit=yes-disabled-by-default \
--enable-ifupdown \ -Dpolkit=true \
--with-config-logging-backend-default=syslog \ -Dnm_cloud_setup=true \
--with-config-wifi-backend-default=wpa_supplicant \ -Dconfig_dhcp_default=internal \
--with-libaudit=yes-disabled-by-default \ -Dconfig_dns_rc_manager_default=auto \
--enable-polkit=yes \ -Diptables=/usr/sbin/iptables \
--with-nm-cloud-setup=yes \ -Dnft=/usr/bin/nft \
--with-config-dhcp-default=internal \ || die "Error meson setup"
--with-config-dns-rc-manager-default=auto \
\ VERSION="${VERSION:-$(get_version_meson || die "Could not read $VERSION")}"
--with-iptables=/usr/sbin/iptables \ if [[ $QUICK == 1 ]]; then
--with-nft=/usr/sbin/nft \ meson dist --allow-dirty -C "$GITDIR/build/" --no-tests || die "Error meson dist"
\ else
|| die "Error autogen.sh" meson dist --allow-dirty -C "$GITDIR/build/" || die "Error meson dist with tests"
if [[ $QUICK == 1 ]]; then fi
make dist -j 7 || die "Error make dist" export SOURCE="$(ls -1 "$GITDIR/build/meson-dist/NetworkManager-${VERSION}.tar.xz" 2>/dev/null | head -n1)"
else else
make distcheck -j 7 || die "Error make distcheck" ./autogen.sh \
--with-runstatedir=/run \
--program-prefix= \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/var/lib \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
\
--disable-dependency-tracking \
--enable-gtk-doc \
--enable-introspection \
--enable-ifcfg-rh \
--enable-ifupdown \
--with-config-logging-backend-default=syslog \
--with-config-wifi-backend-default=wpa_supplicant \
--with-libaudit=yes-disabled-by-default \
--enable-polkit=yes \
--with-nm-cloud-setup=yes \
--with-config-dhcp-default=internal \
--with-config-dns-rc-manager-default=auto \
\
--with-iptables=/usr/sbin/iptables \
--with-nft=/usr/sbin/nft \
\
|| die "Error autogen.sh"
if [[ $QUICK == 1 ]]; then
make dist -j 7 || die "Error make dist"
else
make distcheck -j 7 || die "Error make distcheck"
fi
fi fi
fi fi