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:
@@ -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,7 +193,48 @@ 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
|
||||||
|
if [[ $USE_MESON = 1 ]]; then
|
||||||
|
meson setup "$GITDIR/build" \
|
||||||
|
--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 \
|
||||||
|
-Ddocs=true \
|
||||||
|
-Dintrospection=true \
|
||||||
|
-Difcfg_rh=true \
|
||||||
|
-Difupdown=true \
|
||||||
|
-Dconfig_logging_backend_default=syslog \
|
||||||
|
-Dconfig_wifi_backend_default=wpa_supplicant \
|
||||||
|
-Dlibaudit=yes-disabled-by-default \
|
||||||
|
-Dpolkit=true \
|
||||||
|
-Dnm_cloud_setup=true \
|
||||||
|
-Dconfig_dhcp_default=internal \
|
||||||
|
-Dconfig_dns_rc_manager_default=auto \
|
||||||
|
-Diptables=/usr/sbin/iptables \
|
||||||
|
-Dnft=/usr/bin/nft \
|
||||||
|
|| die "Error meson setup"
|
||||||
|
|
||||||
|
VERSION="${VERSION:-$(get_version_meson || die "Could not read $VERSION")}"
|
||||||
|
if [[ $QUICK == 1 ]]; then
|
||||||
|
meson dist --allow-dirty -C "$GITDIR/build/" --no-tests || die "Error meson dist"
|
||||||
|
else
|
||||||
|
meson dist --allow-dirty -C "$GITDIR/build/" || die "Error meson dist with tests"
|
||||||
|
fi
|
||||||
|
export SOURCE="$(ls -1 "$GITDIR/build/meson-dist/NetworkManager-${VERSION}.tar.xz" 2>/dev/null | head -n1)"
|
||||||
|
else
|
||||||
./autogen.sh \
|
./autogen.sh \
|
||||||
--with-runstatedir=/run \
|
--with-runstatedir=/run \
|
||||||
--program-prefix= \
|
--program-prefix= \
|
||||||
@@ -228,6 +274,7 @@ if [[ $NO_DIST != 1 ]]; then
|
|||||||
else
|
else
|
||||||
make distcheck -j 7 || die "Error make distcheck"
|
make distcheck -j 7 || die "Error make distcheck"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$ADD_WITH_TEST" == 1 ]]; then
|
if [[ "$ADD_WITH_TEST" == 1 ]]; then
|
||||||
|
Reference in New Issue
Block a user