From d49de1af6ae14fedd285a43658664d01c71cdbe5 Mon Sep 17 00:00:00 2001
From: Sertonix <sertonix@posteo.net>
Date: Fri, 25 Oct 2024 09:12:33 +0200
Subject: [PATCH] community/xdg-utils: fix xdg-screensaver with busybox sed

Fixes #16411
---
 community/xdg-utils/APKBUILD          |  7 +++++--
 community/xdg-utils/busybox-sed.patch | 15 +++++++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)
 create mode 100644 community/xdg-utils/busybox-sed.patch

diff --git a/community/xdg-utils/APKBUILD b/community/xdg-utils/APKBUILD
index 97833c0d2345..ee262f3a4d0b 100644
--- a/community/xdg-utils/APKBUILD
+++ b/community/xdg-utils/APKBUILD
@@ -2,7 +2,7 @@
 # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
 pkgname=xdg-utils
 pkgver=1.2.1
-pkgrel=0
+pkgrel=1
 pkgdesc="Basic desktop integration functions"
 url="https://www.freedesktop.org/wiki/Software/xdg-utils/"
 arch="noarch"
@@ -20,7 +20,9 @@ makedepends="
 	xmlto
 	"
 subpackages="$pkgname-doc"
-source="https://gitlab.freedesktop.org/xdg/xdg-utils/-/archive/v${pkgver/_/-}/xdg-utils-v${pkgver/_/-}.tar.gz"
+source="https://gitlab.freedesktop.org/xdg/xdg-utils/-/archive/v${pkgver/_/-}/xdg-utils-v${pkgver/_/-}.tar.gz
+	busybox-sed.patch
+	"
 builddir="$srcdir/$pkgname-v${pkgver/_/-}"
 
 build() {
@@ -40,4 +42,5 @@ package() {
 
 sha512sums="
 9b031d9c65247d0bbe0ce11fba10f88e68fa11e8d0fe5d1b09876edd21f59896a4d3be9a23f10afb7436446580b4d38fba99c622767eecec3951be4f5e4aad3e  xdg-utils-v1.2.1.tar.gz
+62063dc8667b945d6bd38c3e54d1df38dfd4356ad6968509f3acbb7c4b6130e38b98fd9bb1ac9f2ad13cae7ee5d51131ee9d7a50b5867149e0eb9578208b79b0  busybox-sed.patch
 "
diff --git a/community/xdg-utils/busybox-sed.patch b/community/xdg-utils/busybox-sed.patch
new file mode 100644
index 000000000000..3ef945e0528c
--- /dev/null
+++ b/community/xdg-utils/busybox-sed.patch
@@ -0,0 +1,15 @@
+Busybox sed allows } to be a label so we need to add a ;.
+
+Ref https://gitlab.freedesktop.org/xdg/xdg-utils/-/merge_requests/126
+
+--- a/scripts/xdg-screensaver.in
++++ b/scripts/xdg-screensaver.in
+@@ -363,7 +363,7 @@ screensaver_kde3()
+ 
+ xset_screensaver_timeout()
+ {
+-  xset q | sed '/^Screen Saver:/,/^[^ ]/ { s/.*timeout: *\([0-9]*\).*/\1/; t }; d'
++  xset q | sed '/^Screen Saver:/,/^[^ ]/ { s/.*timeout: *\([0-9]*\).*/\1/; t; }; d'
+ }
+ 
+ screensaver_xserver()
-- 
GitLab