]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Don't apply distribution specific patches
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 27 Aug 2024 11:17:38 +0000 (13:17 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 28 Aug 2024 14:14:05 +0000 (16:14 +0200)
rpm upstream is going to imply --noprep when running with --build-in-place so let's do the same on older
versions of rpm (https://github.com/rpm-software-management/rpm/commit/e0925ad6e3185030b004343f73a5917fdc562d6c)

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.

mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot
mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.build.chroot
mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.prepare
mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot
mkosi.images/build/mkosi.conf.d/opensuse/mkosi.prepare

index 176f0b8869b7a9f9182eb3baa13974ce4ae63339..8d501ecb76cb17da6b73113dd2a41b3cdce5c5e1 100755 (executable)
@@ -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 \
index ce69aa33b75012f0a95227c0665bc5475182d972..b372b2264b209146b719c802aab334ce1a09be33 100755 (executable)
@@ -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") \
index 6028dc355b680173a25ebe8d8e814e50484c1188..a7e8353cf6f3e34485b064e388eb88e1bcd9e6f6 100755 (executable)
@@ -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" \
index 173468f6c1427cdd8c19ee6b8b2fa190f13acc20..e44bf0e0794fd5d2755b294f41fd63092066eae4 100755 (executable)
@@ -69,6 +69,7 @@ build() {
     CXX_LD="$( ((LLVM)) && echo lld)" \
     rpmbuild \
         -bb \
+        --noprep \
         --build-in-place \
         --with upstream \
         $( ((WITH_TESTS)) || echo "--nocheck") \
index 24f07fd459bb5aa09910e0f23f580f9881905177..b7dc231dda48d125bdebcc05cbe937edf51e0569 100755 (executable)
@@ -30,6 +30,7 @@ mkosi-chroot \
 until mkosi-chroot \
     rpmbuild \
     -bd \
+    --noprep \
     --build-in-place \
     --with upstream \
     --define "_topdir /var/tmp" \