commit:     574ad7792bfe83b27e4c45b484a5bedda07bfab1
Author:     xz-dev <xiangzhedev <AT> gmail <DOT> com>
AuthorDate: Fri Sep 19 03:09:09 2025 +0000
Commit:     David Roman <davidroman96 <AT> gmail <DOT> com>
CommitDate: Mon Sep 22 15:32:35 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=574ad779

gui-wm/river: fix man build in 0.3.12

Fix: https://bugs.gentoo.org/962978

Signed-off-by: xz-dev <xiangzhedev <AT> gmail.com>
Part-of: https://github.com/gentoo/guru/pull/373
Closes: https://github.com/gentoo/guru/pull/373
Signed-off-by: David Roman <davidroman96 <AT> gmail.com>

 gui-wm/river/files/river-0.3.12-fix-scdoc-path.patch | 14 ++++++++++++++
 gui-wm/river/river-0.3.12.ebuild                     |  4 ++++
 2 files changed, 18 insertions(+)

diff --git a/gui-wm/river/files/river-0.3.12-fix-scdoc-path.patch 
b/gui-wm/river/files/river-0.3.12-fix-scdoc-path.patch
new file mode 100644
index 0000000000..96edbcf93a
--- /dev/null
+++ b/gui-wm/river/files/river-0.3.12-fix-scdoc-path.patch
@@ -0,0 +1,14 @@
+--- a/build.zig
++++ b/build.zig
+@@ -252,8 +252,9 @@
+         inline for (.{ "river", "riverctl", "rivertile" }) |page| {
+             // Workaround for https://github.com/ziglang/zig/issues/16369
+             // Even passing a buffer to std.Build.Step.Run appears to be racy 
and occasionally deadlocks.
+-            const scdoc = b.addSystemCommand(&.{ "/bin/sh", "-c", "scdoc < 
doc/" ++ page ++ ".1.scd" });
++            // Fix: Ensure scdoc runs in the correct source directory to find 
.scd files
++            const scdoc = b.addSystemCommand(&.{ "/bin/sh", "-c", b.fmt("cd 
{s} && scdoc < doc/{s}.1.scd", .{ b.build_root.path orelse ".", page }) });
+             // This makes the caching work for the Workaround, and the extra 
argument is ignored by /bin/sh.
+             scdoc.addFileArg(b.path("doc/" ++ page ++ ".1.scd"));
+
+             const stdout = scdoc.captureStdOut();
+             b.getInstallStep().dependOn(&b.addInstallFile(stdout, 
"share/man/man1/" ++ page ++ ".1").step);

diff --git a/gui-wm/river/river-0.3.12.ebuild b/gui-wm/river/river-0.3.12.ebuild
index 709b9ef5d2..cd67e30b6d 100644
--- a/gui-wm/river/river-0.3.12.ebuild
+++ b/gui-wm/river/river-0.3.12.ebuild
@@ -49,6 +49,10 @@ RDEPEND="${DEPEND}"
 
 DOCS=( "README.md" )
 
+PATCHES=(
+       "${FILESDIR}/${P}-fix-scdoc-path.patch"
+)
+
 src_configure() {
        local my_zbs_args=(
                -Dstrip=false # Let Portage control this

Reply via email to