guix_mirror_bot pushed a commit to branch world-rebuild in repository guix.
commit f3b97d6439b4e8cef0bf6e01daa4cabe477718fd Author: Yelninei <[email protected]> AuthorDate: Sat May 16 14:31:17 2026 +0000 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 <[email protected]> --- gnu/local.mk | 1 + gnu/packages/patches/protobuf-pathmax.patch | 18 ++++++++++++++++++ gnu/packages/protobuf.scm | 10 ++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/gnu/local.mk b/gnu/local.mk index 9c0e7a7827..00dfad50d3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2262,6 +2262,7 @@ dist_patch_DATA = \ %D%/packages/patches/proot-add-clone3.patch \ %D%/packages/patches/proot-add-missing-include.patch \ %D%/packages/patches/protobuf-fix-build-on-32bit.patch \ + %D%/packages/patches/protobuf-pathmax.patch \ %D%/packages/patches/psm2-compile-ctor-without-avx.patch \ %D%/packages/patches/psm-arch.patch \ %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 0000000000..bad4110539 --- /dev/null +++ b/gnu/packages/patches/protobuf-pathmax.patch @@ -0,0 +1,18 @@ +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835267 +Bug-Upstream: https://github.com/google/protobuf/issues/2000 +Description: Add support for GNU/Hurd which doesn't define PATH_MAX. +Author: Bas Couwenberg <[email protected]> +Last-Update: 2022-03-11 + +--- protobuf-3.9.1.orig/src/google/protobuf/compiler/command_line_interface.cc ++++ protobuf-3.9.1/src/google/protobuf/compiler/command_line_interface.cc +@@ -58,6 +58,9 @@ + #include <iostream> + + #include <limits.h> // For PATH_MAX ++#if defined(__GNU__) ++#define PATH_MAX 4096 ++#endif + + #include <memory> + diff --git a/gnu/packages/protobuf.scm b/gnu/packages/protobuf.scm index 1953fe9ee0..fdd9ad356a 100644 --- a/gnu/packages/protobuf.scm +++ b/gnu/packages/protobuf.scm @@ -202,7 +202,8 @@ internal RPC protocols and file formats.") (sha256 (base32 "01cl4l0rnnzjbhjjs2gyg2pk13505gh86ikh22jqjp54dp8mvp5x")) - (patches (search-patches "protobuf-fix-build-on-32bit.patch")))) + (patches (search-patches "protobuf-fix-build-on-32bit.patch" + "protobuf-pathmax.patch")))) (outputs (list "out" "static")) ; ~12 MiB of .a files (build-system cmake-build-system) @@ -232,7 +233,12 @@ internal RPC protocols and file formats.") "BlockSizeSmallerThanAllocation") ;; See: https://github.com/protocolbuffers/protobuf/issues/8082. (disable-tests "src/google/protobuf/io/zero_copy_stream_unittest.cc" - "LargeOutput")))) + "LargeOutput") + ;; setsockopt SO_RCVTIMEO is unsupported + #$@(if (target-hurd?) + #~((disable-tests "src/google/protobuf/io/zero_copy_stream_unittest.cc" + "BlockingFileIoWithTimeout")) + #~())))) (add-before 'configure 'set-c++-standard (lambda _ (substitute* "CMakeLists.txt"
