summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYelninei <yelninei@tutamail.com>2026-05-16 14:31:17 +0000
committerNguyễn Gia Phong <cnx@loang.net>2026-08-31 11:00:18 +0900
commitf6d1f42f4bbb236c83927e363a1470572308e726 (patch)
treee1cc7efdcc7ce0c946cadcddea2c8b354c44c649
parent451c53fbdc08587ed0ad2f67f6fa8dea1230737e (diff)
gnu: protobuf: Fix build on the Hurd.
* gnu/packages/patches/protobuf-pathmax.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/protobuf.scm (protobuf)[source]<patches>: Use it. [arguments]<#:phases>: Skip a test needing unimplemented libc options. Merges: https://codeberg.org/guix/guix/pulls/8675 Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/protobuf-pathmax.patch18
-rw-r--r--gnu/packages/protobuf.scm10
3 files changed, 27 insertions, 2 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 68c6a111691..d61fb397d25 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2258,6 +2258,7 @@ dist_patch_DATA = \
2258 %D%/packages/patches/proot-add-clone3.patch \ 2258 %D%/packages/patches/proot-add-clone3.patch \
2259 %D%/packages/patches/proot-add-missing-include.patch \ 2259 %D%/packages/patches/proot-add-missing-include.patch \
2260 %D%/packages/patches/protobuf-fix-build-on-32bit.patch \ 2260 %D%/packages/patches/protobuf-fix-build-on-32bit.patch \
2261 %D%/packages/patches/protobuf-pathmax.patch \
2261 %D%/packages/patches/psm2-compile-ctor-without-avx.patch \ 2262 %D%/packages/patches/psm2-compile-ctor-without-avx.patch \
2262 %D%/packages/patches/psm-arch.patch \ 2263 %D%/packages/patches/psm-arch.patch \
2263 %D%/packages/patches/psm-disable-memory-stats.patch \ 2264 %D%/packages/patches/psm-disable-memory-stats.patch \
diff --git a/gnu/packages/patches/protobuf-pathmax.patch b/gnu/packages/patches/protobuf-pathmax.patch
new file mode 100644
index 00000000000..bad41105391
--- /dev/null
+++ b/gnu/packages/patches/protobuf-pathmax.patch
@@ -0,0 +1,18 @@
1Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835267
2Bug-Upstream: https://github.com/google/protobuf/issues/2000
3Description: Add support for GNU/Hurd which doesn't define PATH_MAX.
4Author: Bas Couwenberg <sebastic@debian.org>
5Last-Update: 2022-03-11
6
7--- protobuf-3.9.1.orig/src/google/protobuf/compiler/command_line_interface.cc
8+++ protobuf-3.9.1/src/google/protobuf/compiler/command_line_interface.cc
9@@ -58,6 +58,9 @@
10 #include <iostream>
11
12 #include <limits.h> // For PATH_MAX
13+#if defined(__GNU__)
14+#define PATH_MAX 4096
15+#endif
16
17 #include <memory>
18
diff --git a/gnu/packages/protobuf.scm b/gnu/packages/protobuf.scm
index 1953fe9ee0d..fdd9ad356a4 100644
--- a/gnu/packages/protobuf.scm
+++ b/gnu/packages/protobuf.scm
@@ -202,7 +202,8 @@ internal RPC protocols and file formats.")
202 (sha256 202 (sha256
203 (base32 203 (base32
204 "01cl4l0rnnzjbhjjs2gyg2pk13505gh86ikh22jqjp54dp8mvp5x")) 204 "01cl4l0rnnzjbhjjs2gyg2pk13505gh86ikh22jqjp54dp8mvp5x"))
205 (patches (search-patches "protobuf-fix-build-on-32bit.patch")))) 205 (patches (search-patches "protobuf-fix-build-on-32bit.patch"
206 "protobuf-pathmax.patch"))))
206 (outputs (list "out" 207 (outputs (list "out"
207 "static")) ; ~12 MiB of .a files 208 "static")) ; ~12 MiB of .a files
208 (build-system cmake-build-system) 209 (build-system cmake-build-system)
@@ -232,7 +233,12 @@ internal RPC protocols and file formats.")
232 "BlockSizeSmallerThanAllocation") 233 "BlockSizeSmallerThanAllocation")
233 ;; See: https://github.com/protocolbuffers/protobuf/issues/8082. 234 ;; See: https://github.com/protocolbuffers/protobuf/issues/8082.
234 (disable-tests "src/google/protobuf/io/zero_copy_stream_unittest.cc" 235 (disable-tests "src/google/protobuf/io/zero_copy_stream_unittest.cc"
235 "LargeOutput")))) 236 "LargeOutput")
237 ;; setsockopt SO_RCVTIMEO is unsupported
238 #$@(if (target-hurd?)
239 #~((disable-tests "src/google/protobuf/io/zero_copy_stream_unittest.cc"
240 "BlockingFileIoWithTimeout"))
241 #~()))))
236 (add-before 'configure 'set-c++-standard 242 (add-before 'configure 'set-c++-standard
237 (lambda _ 243 (lambda _
238 (substitute* "CMakeLists.txt" 244 (substitute* "CMakeLists.txt"