mkosi: Don't apply distribution specific patches

rpm upstream is going to imply --noprep when running with --build-in-place so let's do the same on older
versions of rpm (e0925ad6e3)

Also, to keep things consistent between distros, run with --noprepare
on Arch Linux as well (we already skip patches on Debian/Ubuntu).

To keep things working on Arch, we apply the one downstream patch
manually ourselves.
This commit is contained in:
Daan De Meyer 2024-08-27 13:17:38 +02:00
parent dbff64ddf0
commit 00a2a67d81
5 changed files with 15 additions and 0 deletions

View file

@ -67,12 +67,17 @@ sed --in-place "pkg/$PKG_SUBDIR/PKGBUILD" \
--expression "s/^_tag=.*/_tag=$(cat meson.version)/" \
--expression "s/^pkgrel=.*/pkgrel=$(date "+%Y%m%d%H%M%S" --date "@$TS")/"
# Replace cdrom/dialout/tape groups with optical/uucp/storage. We apply this patch manually because we run
# with --noprepare.
patch -Np1 -i pkg/arch/0001-Use-Arch-Linux-device-access-groups.patch
# We get around makepkg's root check by setting EUID to something else.
# shellcheck disable=SC2046
env --chdir="pkg/$PKG_SUBDIR" \
EUID=123 \
makepkg \
--noextract \
--noprepare \
$( ((WITH_TESTS)) || echo --nocheck) \
--force \
_systemd_UPSTREAM=1 \

View file

@ -53,6 +53,12 @@ if ((WIPE)) && [[ -d "$BUILDDIR/meson-private" ]]; then
MKOSI_MESON_OPTIONS="$MKOSI_MESON_OPTIONS --wipe"
fi
# Hack to work around https://github.com/rpm-software-management/rpm/issues/3216.
# TODO: Remove when rpm 4.20 gets into Rawhide.
mkdir -p "/var/tmp/BUILD/systemd-${VERSION/\~/_}-build"
mkdir -p "/var/tmp/BUILD/systemd-${VERSION/\~/_}-build/SPECPARTS"
ln -s /work/src "/var/tmp/BUILD/systemd-${VERSION/\~/_}-build/systemd-$VERSION"
IFS=
# TODO: Replace meson_build and meson_install overrides with "--undefine __meson_verbose" once
# https://github.com/mesonbuild/meson/pull/12835 is available.
@ -66,6 +72,7 @@ CC_LD="$( ((LLVM)) && echo lld)" \
CXX_LD="$( ((LLVM)) && echo lld)" \
rpmbuild \
-bb \
--noprep \
--build-in-place \
--with upstream \
$( ((WITH_TESTS)) || echo "--nocheck") \

View file

@ -32,6 +32,7 @@ sed '/Source0/d' --in-place "pkg/$PKG_SUBDIR/systemd.spec"
until mkosi-chroot \
rpmbuild \
-br \
--noprep \
--build-in-place \
--with upstream \
--define "_topdir /var/tmp" \

View file

@ -69,6 +69,7 @@ build() {
CXX_LD="$( ((LLVM)) && echo lld)" \
rpmbuild \
-bb \
--noprep \
--build-in-place \
--with upstream \
$( ((WITH_TESTS)) || echo "--nocheck") \

View file

@ -30,6 +30,7 @@ mkosi-chroot \
until mkosi-chroot \
rpmbuild \
-bd \
--noprep \
--build-in-place \
--with upstream \
--define "_topdir /var/tmp" \