summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Vaclav <jvaclav@redhat.com>2024-01-29 14:21:39 +0100
committerJan Vaclav <jvaclav@redhat.com>2024-01-29 14:21:39 +0100
commite081c716f1d03103a9eb66b1145acc21bf2c439d (patch)
tree5f6531a0380f1be942c6070734b63d33677854c8
parent750278795907062a571eb2148ce1f308913d3a8f (diff)
parent43c3409081eb4f001682678389bd6419e6f157c2 (diff)
merge: branch 'jv/meson-build-clean'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1845
-rw-r--r--.gitlab-ci.yml4
-rwxr-xr-xcontrib/fedora/REQUIRED_PACKAGES1
-rwxr-xr-xcontrib/fedora/rpm/build_clean.sh123
3 files changed, 88 insertions, 40 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e13995b3b1..029284bfb5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -58,9 +58,9 @@ variables:
# This is done by running `ci-fairy generate-template` and possibly bumping
# ".default_tag".
ALPINE_TAG: 'tag-7da44bbacc09'
- CENTOS_TAG: 'tag-c8090b8a9a6b'
+ CENTOS_TAG: 'tag-df11907da86a'
DEBIAN_TAG: 'tag-86a16c2d74d8'
- FEDORA_TAG: 'tag-c8090b8a9a6b'
+ FEDORA_TAG: 'tag-df11907da86a'
UBUNTU_TAG: 'tag-86a16c2d74d8'
ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh'
diff --git a/contrib/fedora/REQUIRED_PACKAGES b/contrib/fedora/REQUIRED_PACKAGES
index 7084f780b8..38ca90267f 100755
--- a/contrib/fedora/REQUIRED_PACKAGES
+++ b/contrib/fedora/REQUIRED_PACKAGES
@@ -63,6 +63,7 @@ install \
gtk-doc \
iptables \
jansson-devel \
+ jq \
libcurl-devel \
libndp-devel \
libselinux-devel \
diff --git a/contrib/fedora/rpm/build_clean.sh b/contrib/fedora/rpm/build_clean.sh
index 3f07a9b198..dfc8e96e39 100755
--- a/contrib/fedora/rpm/build_clean.sh
+++ b/contrib/fedora/rpm/build_clean.sh
@@ -19,8 +19,9 @@ usage() {
echo " -c|--clean: run \`git-clean -fdx :/\` before build"
echo " -S|--srpm: only build the SRPM"
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 " -m|--meson: use meson to create the source tarball"
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 " -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
SOURCE_FROM_GIT=1
;;
+ -m|--meson)
+ USE_MESON=1
+ WITH_LIST=("${WITH_LIST[@]}" "--with" "meson")
+ ;;
-Q|--quick)
QUICK=1
;;
@@ -188,45 +193,87 @@ if [[ $IGNORE_DIRTY != 1 ]]; then
fi
fi
+get_version_meson() {
+ meson introspect "$GITDIR/build" --projectinfo | jq -r .version
+}
+
if [[ $NO_DIST != 1 ]]; then
- ./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"
+ 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
- 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