From f6d1f42f4bbb236c83927e363a1470572308e726 Mon Sep 17 00:00:00 2001 From: Yelninei Date: Sat, 16 May 2026 14:31:17 +0000 Subject: gnu: protobuf: Fix build on the Hurd. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/patches/protobuf-pathmax.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/protobuf.scm (protobuf)[source]: 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 --- gnu/local.mk | 1 + gnu/packages/patches/protobuf-pathmax.patch | 18 ++++++++++++++++++ gnu/packages/protobuf.scm | 10 ++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/protobuf-pathmax.patch 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 = \ %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 00000000000..bad41105391 --- /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 +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 + + #include // For PATH_MAX ++#if defined(__GNU__) ++#define PATH_MAX 4096 ++#endif + + #include + 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.") (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" -- cgit v1.2.3