[packages/protobuf] - updated to 29.6 release (cpp/python 5.29.6, ruby 4.29.6; new sonames); added utf8_range packages
qboosh
qboosh at pld-linux.org
Sat Feb 28 17:08:32 CET 2026
commit e1dc11537c1d8289c40153ec88fae34de2a86101
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sat Feb 28 17:07:12 2026 +0100
- updated to 29.6 release (cpp/python 5.29.6, ruby 4.29.6; new sonames); added utf8_range packages
no-utf8_range-pkgconfig.patch | 11 ---
protobuf-32bit.patch | 11 ---
protobuf-abseil-if_constexpr.patch | 115 ++++++++++++++++++++++++
protobuf-x32.patch | 13 ---
protobuf.spec | 176 ++++++++++++++++++++++++++-----------
5 files changed, 239 insertions(+), 87 deletions(-)
---
diff --git a/protobuf.spec b/protobuf.spec
index c663816..0df8da3 100644
--- a/protobuf.spec
+++ b/protobuf.spec
@@ -6,28 +6,35 @@
# Conditional build:
%bcond_without python3 # Python 3.x bindings
%bcond_with ruby # Ruby bindings
-%bcond_without tests # perform "make check" (requires 4+GB RAM on 64-bit archs)
-%bcond_with static_libs # Ruby bindings
-
+%bcond_without tests # test suite (requires 4+GB RAM on 64-bit archs)
+
+# versions have diverged: for protoc 29.x binding version is 3.29.x, 4.29.x and 5.29.x depending on language
+# see version.json for individual languages
+%define protoc_version 29.6
+%define cpp_version 5.%{protoc_version}
+%define python_version 5.%{protoc_version}
+%define ruby_version 4.%{protoc_version}
+# libraries soname
+%define abi_ver %{protoc_version}.0
+
+# dependencies
%define abseil_ver 20250814.0
Summary: Protocol Buffers - Google's data interchange format
Summary(pl.UTF-8): Protocol Buffers - format wymiany danych Google
Name: protobuf
-Version: 4.25.8
-Release: 3
+Version: %{cpp_version}
+Release: 1
License: BSD
Group: Libraries
#Source0Download: https://github.com/protocolbuffers/protobuf/releases
-Source0: https://github.com/protocolbuffers/protobuf/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 6da0bf008ca0354c4a4c626795b81abd
+Source0: https://github.com/protocolbuffers/protobuf/archive/v%{protoc_version}/%{name}-%{protoc_version}.tar.gz
+# Source0-md5: 097e057e4e6e006e5127b43abf0a85bd
Source1: ftdetect-proto.vim
-Patch1: no-utf8_range-pkgconfig.patch
-Patch2: %{name}-x32.patch
+Patch0: %{name}-abseil-if_constexpr.patch
Patch3: no-death-test.patch
-Patch4: %{name}-32bit.patch
URL: https://github.com/protocolbuffers/protobuf/
BuildRequires: abseil-cpp-devel >= %{abseil_ver}
-%{?with_tests:BuildRequires: abseil-cpp-devel >= %{abseil_ver}}
+%{?with_tests:BuildRequires: abseil-cpp-test-devel >= %{abseil_ver}}
BuildRequires: cmake >= 3.10
%{?with_tests:BuildRequires: gmock-devel >= 1.9.0}
%{?with_tests:BuildRequires: gtest-devel >= 1.9.0}
@@ -35,7 +42,7 @@ BuildRequires: libstdc++-devel >= 6:4.7
BuildRequires: pkgconfig
BuildRequires: sed >= 4.0
%if %{with python3}
-BuildRequires: python3-modules >= 1:3.3
+BuildRequires: python3-modules >= 1:3.8
BuildRequires: python3-setuptools
BuildRequires: rpm-pythonprov
%endif
@@ -92,6 +99,7 @@ języków programowania.
Summary: Protocol Buffers library
Summary(pl.UTF-8): Biblioteka buforów protokołowych (Protocol Buffers)
Group: Libraries
+Requires: utf8_range = %{version}-%{release}
Requires: zlib >= 1.2.0.4
%description libs
@@ -104,6 +112,7 @@ Biblioteka buforów protokołowych (Protocol Buffers).
Summary: Protocol Buffers LITE_RUNTIME library
Summary(pl.UTF-8): Biblioteka LITE_RUNTIME buforów protokołowych (Protocol Buffers)
Group: Libraries
+Requires: utf8_range = %{version}-%{release}
%description lite
Protocol Buffers library for programs built with optimize_for =
@@ -130,9 +139,7 @@ Requires: %{name} = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
Requires: %{name}-lite = %{version}-%{release}
Requires: libstdc++-devel >= 6:4.7
-%if %{without static_libs}
Obsoletes: protobuf-static < %{version}-%{release}
-%endif
%description devel
Header files for Protocol Buffers libraries.
@@ -152,13 +159,58 @@ Static Protocol Buffers libraries.
%description static -l pl.UTF-8
Statyczne biblioteki buforów protokołowych (Protocol Buffers).
+%package upb-devel
+Summary: upb - small protobuf implementation written in C
+Summary(en.UTF-8): μpb - small protobuf implementation written in C
+Group: Development/Libraries
+Requires: abseil-cpp-devel >= %{abseil_ver}
+Requires: utf8_range-devel = %{version}-%{release}
+
+%description upb-devel
+upb is a small protobuf implementation written in C.
+
+%description upb-devel -l en.UTF-8
+μpb (often written 'upb') is a small protobuf implementation written
+in C.
+
+%description upb-devel -l pl.UTF-8
+μpb (często pisane "upb") to mała implementacja protobuf napisana w C.
+
+%package -n utf8_range
+Summary: Fast UTF-8 validation Range algorithm libraries
+Summary(pl.UTF-8): Biblioteki szybkiego algorytmu Range do sprawdzania poprawności UTF-8
+License: MIT
+Group: Libraries
+Requires: abseil-cpp >= %{abseil_ver}
+
+%description -n utf8_range
+Fast UTF-8 validation Range algorithm libraries.
+
+%description -n utf8_range -l pl.UTF-8
+Biblioteki szybkiego algorytmu Range do sprawdzania poprawności
+kodowania UTF-8.
+
+%package -n utf8_range-devel
+Summary: Header files for utf8_range UTF-8 validation libraries
+Summary(pl.UTF-8): Pliki nagłówkowe bibliotek utf8_range do sprawdzania poprawiości UTF-8
+License: MIT
+Group: Development/Libraries
+Requires: abseil-cpp-devel >= %{abseil_ver}
+Requires: utf8_range = %{version}-%{release}
+
+%description -n utf8_range-devel
+Header files for utf8_range UTF-8 validation libraries.
+
+%description -n utf8_range-devel -l pl.UTF-8
+Pliki nagłówkowe bibliotek utf8_range do sprawdzania poprawiości
+kodowania UTF-8.
+
%package -n python3-protobuf
Summary: Python 3 bindings for Protocol Buffers
Summary(pl.UTF-8): Wiązania Pythona 3 do buforów protokołowych (Protocol Buffers)
+Version: %{python_version}
Group: Development/Languages/Python
-Requires: python3-modules >= 1:3.3
-# does not use C++ library at this time
-BuildArch: noarch
+Requires: python3-modules >= 1:3.8
%description -n python3-protobuf
Python 3 bindings for Protocol Buffers.
@@ -169,6 +221,7 @@ Wiązania Pythona 3 do buforów protokołowych (Protocol Buffers).
%package -n ruby-google-protobuf
Summary: Ruby bindings for Google Protocol Buffers
Summary(pl.UTF-8): Wiązania języka Ruby do biblioteki Google Protocol Buffers
+Version: %{ruby_version}
Group: Development/Languages
Requires: ruby
@@ -181,6 +234,7 @@ Wiązania języka Ruby do biblioteki Google Protocol Buffers.
%package -n vim-syntax-protobuf
Summary: Vim syntax highlighting for Protocol Buffers descriptions
Summary(pl.UTF-8): Podświetlanie składni Vima dla opisów buforów protokołowych (Protocol Buffers)
+Version: %{protoc_version}
Group: Development/Libraries
Requires: vim-rt >= 4:7.2.170
@@ -193,24 +247,24 @@ Ten pakiet zawiera pliki podświetlania składni edytora Vim dla opisów
buforów protokołowych (Protocol Buffers).
%prep
-%setup -q
-%patch -P1 -p1
-%patch -P2 -p1
+%setup -q -n %{name}-%{protoc_version}
+%patch -P0 -p1
%patch -P3 -p1
-%patch -P4 -p1
-%{__sed} -i -e '1s,/usr/bin/env python$,%{__python3},' \
+%{__sed} -i -e '1s, */usr/bin/env python$,%{__python3},' \
examples/add_person.py \
examples/list_people.py
-%{__sed} -i -e '1s,/usr/bin/env ruby$,%{__ruby},' \
+%{__sed} -i -e '1s, */usr/bin/env ruby$,%{__ruby},' \
examples/add_person.rb \
examples/list_people.rb
+ln -sf dist/setup.py python/setup.py
+
%build
mkdir -p build
cd build
-%cmake ../ \
+%cmake .. \
-Dprotobuf_BUILD_TESTS=%{__ON_OFF tests} \
-Dprotobuf_USE_EXTERNAL_GTEST=ON \
-Dprotobuf_ABSL_PROVIDER=package
@@ -218,11 +272,13 @@ cd build
%{__make}
export PROTOC="$(pwd)/protoc"
-cd ../python
+cd ..
+
%if %{with python3}
+cd python
%py3_build
-%endif
cd ..
+%endif
%if %{with ruby}
cd ruby
@@ -242,21 +298,15 @@ install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
%{__make} -C build install \
DESTDIR=$RPM_BUILD_ROOT
-# Remove utf8_range that's statically linked and not needed.
-%{__rm} $RPM_BUILD_ROOT%{_includedir}/{utf8_range,utf8_validity}.h
-%{__rm} -r $RPM_BUILD_ROOT%{_libdir}/cmake/utf8_range
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/libutf8_{range,validity}.a
-%{__rm} $RPM_BUILD_ROOT%{_pkgconfigdir}/utf8_range.pc
-
install -d $RPM_BUILD_ROOT%{_vimdatadir}/{syntax,ftdetect}
cp -p editors/proto.vim $RPM_BUILD_ROOT%{_vimdatadir}/syntax/proto.vim
cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_vimdatadir}/ftdetect/proto.vim
-cd python
%if %{with python3}
+cd python
%py3_install
-%endif
cd ..
+%endif
%if %{with ruby}
install -d $RPM_BUILD_ROOT{%{ruby_vendorarchdir}/google,%{ruby_vendorlibdir}/google,%{ruby_specdir}}
@@ -281,22 +331,23 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc CONTRIBUTORS.txt LICENSE README.md
-%attr(755,root,root) %{_bindir}/protoc*
-%attr(755,root,root) %{_libdir}/libprotoc.so.*.*.*
+%attr(755,root,root) %{_bindir}/protoc
+%attr(755,root,root) %{_bindir}/protoc-%{abi_ver}
+%{_libdir}/libprotoc.so.%{abi_ver}
%files libs
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libprotobuf.so.*.*.*
+%{_libdir}/libprotobuf.so.%{abi_ver}
%files lite
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libprotobuf-lite.so.*.*.*
+%{_libdir}/libprotobuf-lite.so.%{abi_ver}
%files devel
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libprotobuf-lite.so
-%attr(755,root,root) %{_libdir}/libprotobuf.so
-%attr(755,root,root) %{_libdir}/libprotoc.so
+%{_libdir}/libprotobuf-lite.so
+%{_libdir}/libprotobuf.so
+%{_libdir}/libprotoc.so
# XXX: dir shared with libtcmalloc
%dir %{_includedir}/google
%{_includedir}/google/protobuf
@@ -305,22 +356,43 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/cmake/protobuf
%{_examplesdir}/%{name}-%{version}
-%if %{with static_libs}
-%files static
+%files upb-devel
%defattr(644,root,root,755)
-%{_libdir}/libprotobuf-lite.a
-%{_libdir}/libprotobuf.a
-%{_libdir}/libprotoc.a
-%endif
+%doc upb/README.md
+%attr(755,root,root) %{_bindir}/protoc-gen-upb
+%attr(755,root,root) %{_bindir}/protoc-gen-upb-%{abi_ver}
+%attr(755,root,root) %{_bindir}/protoc-gen-upb_minitable
+%attr(755,root,root) %{_bindir}/protoc-gen-upb_minitable-%{abi_ver}
+%attr(755,root,root) %{_bindir}/protoc-gen-upbdefs
+%attr(755,root,root) %{_bindir}/protoc-gen-upbdefs-%{abi_ver}
+%{_libdir}/libupb.a
+%{_includedir}/upb
+%{_includedir}/upb_generator
+%{_pkgconfigdir}/upb.pc
+
+%files -n utf8_range
+%defattr(644,root,root,755)
+%doc third_party/utf8_range/{LICENSE,README.md}
+%{_libdir}/libutf8_range.so
+%{_libdir}/libutf8_validity.so
+
+%files -n utf8_range-devel
+%defattr(644,root,root,755)
+%{_includedir}/utf8_range.h
+%{_includedir}/utf8_validity.h
+%{_libdir}/cmake/utf8_range
+%{_pkgconfigdir}/utf8_range.pc
%if %{with python3}
%files -n python3-protobuf
%defattr(644,root,root,755)
%doc python/README.md
-%dir %{py3_sitescriptdir}/google
-%{py3_sitescriptdir}/google/protobuf
-%{py3_sitescriptdir}/protobuf-%{version}-py*.egg-info
-%{py3_sitescriptdir}/protobuf-%{version}-py*-nspkg.pth
+%dir %{py3_sitedir}/google
+%dir %{py3_sitedir}/google/_upb
+%{py3_sitedir}/google/_upb/_message.cpython-*.so
+%{py3_sitedir}/google/protobuf
+%{py3_sitedir}/protobuf-%{python_version}-py*.egg-info
+%{py3_sitedir}/protobuf-%{python_version}-py*-nspkg.pth
%endif
%if %{with ruby}
@@ -328,7 +400,7 @@ rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%doc ruby/README.md
%dir %{ruby_vendorarchdir}/google
-%attr(755,root,root) %{ruby_vendorarchdir}/google/protobuf_c.so
+%{ruby_vendorarchdir}/google/protobuf_c.so
%dir %{ruby_vendorlibdir}/google
%{ruby_vendorlibdir}/google/protobuf.rb
%{ruby_vendorlibdir}/google/protobuf
diff --git a/no-utf8_range-pkgconfig.patch b/no-utf8_range-pkgconfig.patch
deleted file mode 100644
index 4429310..0000000
--- a/no-utf8_range-pkgconfig.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- protobuf-4.25.8/cmake/install.cmake~ 2025-05-27 20:57:25.000000000 +0200
-+++ protobuf-4.25.8/cmake/install.cmake 2025-09-21 03:06:59.743327120 +0200
-@@ -4,7 +4,7 @@
- string(REPLACE :: _ _modified_target ${_target})
- list(APPEND _pc_targets ${_modified_target})
- endforeach()
--list(APPEND _pc_targets "utf8_range")
-+#list(APPEND _pc_targets "utf8_range")
-
- set(_protobuf_PC_REQUIRES "")
- set(_sep "")
diff --git a/protobuf-32bit.patch b/protobuf-32bit.patch
deleted file mode 100644
index ea2e9de..0000000
--- a/protobuf-32bit.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- protobuf-4.25.8/src/google/protobuf/any_test.cc~ 2025-05-27 20:57:25.000000000 +0200
-+++ protobuf-4.25.8/src/google/protobuf/any_test.cc 2025-09-21 12:53:26.366660322 +0200
-@@ -40,7 +40,7 @@
- }
-
- TEST(AnyTest, TestPackFromSerializationExceedsSizeLimit) {
--#if defined(_MSC_VER) && defined(_M_IX86)
-+#if defined(_MSC_VER) && defined(_M_IX86) || defined(__ILP32__)
- GTEST_SKIP() << "This toolchain can't allocate that much memory.";
- #endif
- protobuf_unittest::TestAny submessage;
diff --git a/protobuf-abseil-if_constexpr.patch b/protobuf-abseil-if_constexpr.patch
new file mode 100644
index 0000000..4e40870
--- /dev/null
+++ b/protobuf-abseil-if_constexpr.patch
@@ -0,0 +1,115 @@
+From 0ea5ccd61c69ff5000631781c6c9a3a50241392c Mon Sep 17 00:00:00 2001
+From: Derek Mauro <dmauro at google.com>
+Date: Wed, 19 Feb 2025 11:03:21 -0800
+Subject: [PATCH] Use `if constexpr` instead of
+ `absl::utility_internal::IfConstexprElseIfConstexprElse`
+
+PiperOrigin-RevId: 728737911
+---
+ src/google/protobuf/arena.h | 61 +++++++++++++++----------------------
+ 1 file changed, 25 insertions(+), 36 deletions(-)
+
+diff --git a/src/google/protobuf/arena.h b/src/google/protobuf/arena.h
+index 97cb45379af24..0409e585a3d8a 100644
+--- protobuf-29.6/src/google/protobuf/arena.h.orig 2026-02-04 21:07:58.000000000 +0100
++++ protobuf-29.6/src/google/protobuf/arena.h 2026-02-28 10:33:15.379938726 +0100
+@@ -32,7 +32,6 @@ using type_info = ::type_info;
+ #include "absl/base/optimization.h"
+ #include "absl/base/prefetch.h"
+ #include "absl/log/absl_check.h"
+-#include "absl/utility/internal/if_constexpr.h"
+ #include "google/protobuf/arena_align.h"
+ #include "google/protobuf/arena_allocation_policy.h"
+ #include "google/protobuf/port.h"
+@@ -214,41 +213,31 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8
+ // otherwise, returns a heap-allocated object.
+ template <typename T, typename... Args>
+ PROTOBUF_NDEBUG_INLINE static T* Create(Arena* arena, Args&&... args) {
+- return absl::utility_internal::IfConstexprElse<
+- is_arena_constructable<T>::value>(
+- // Arena-constructable
+- [arena](auto&&... args) {
+- using Type = std::remove_const_t<T>;
+-#ifdef __cpp_if_constexpr
+- // DefaultConstruct/CopyConstruct are optimized for messages, which
+- // are both arena constructible and destructor skippable and they
+- // assume much. Don't use these functions unless the invariants
+- // hold.
+- if constexpr (is_destructor_skippable<T>::value) {
+- constexpr auto construct_type = GetConstructType<T, Args&&...>();
+- // We delegate to DefaultConstruct/CopyConstruct where appropriate
+- // because protobuf generated classes have external templates for
+- // these functions for code size reasons. When `if constexpr` is not
+- // available always use the fallback.
+- if constexpr (construct_type == ConstructType::kDefault) {
+- return static_cast<Type*>(DefaultConstruct<Type>(arena));
+- } else if constexpr (construct_type == ConstructType::kCopy) {
+- return static_cast<Type*>(CopyConstruct<Type>(arena, &args...));
+- }
+- }
+-#endif
+- return CreateArenaCompatible<Type>(arena,
+- std::forward<Args>(args)...);
+- },
+- // Non arena-constructable
+- [arena](auto&&... args) {
+- if (PROTOBUF_PREDICT_FALSE(arena == nullptr)) {
+- return new T(std::forward<Args>(args)...);
+- }
+- return new (arena->AllocateInternal<T>())
+- T(std::forward<Args>(args)...);
+- },
+- std::forward<Args>(args)...);
++ if constexpr (is_arena_constructable<T>::value) {
++ using Type = std::remove_const_t<T>;
++ // DefaultConstruct/CopyConstruct are optimized for messages, which
++ // are both arena constructible and destructor skippable and they
++ // assume much. Don't use these functions unless the invariants
++ // hold.
++ if constexpr (is_destructor_skippable<T>::value) {
++ constexpr auto construct_type = GetConstructType<T, Args&&...>();
++ // We delegate to DefaultConstruct/CopyConstruct where appropriate
++ // because protobuf generated classes have external templates for
++ // these functions for code size reasons. When `if constexpr` is not
++ // available always use the fallback.
++ if constexpr (construct_type == ConstructType::kDefault) {
++ return static_cast<Type*>(DefaultConstruct<Type>(arena));
++ } else if constexpr (construct_type == ConstructType::kCopy) {
++ return static_cast<Type*>(CopyConstruct<Type>(arena, &args...));
++ }
++ }
++ return CreateArenaCompatible<Type>(arena, std::forward<Args>(args)...);
++ } else {
++ if (PROTOBUF_PREDICT_FALSE(arena == nullptr)) {
++ return new T(std::forward<Args>(args)...);
++ }
++ return new (arena->AllocateInternal<T>()) T(std::forward<Args>(args)...);
++ }
+ }
+
+ // API to delete any objects not on an arena. This can be used to safely
+From d801cbd86818b587e0ebba2de13614a3ee83d369 Mon Sep 17 00:00:00 2001
+From: Christian Blichmann <cblichmann at google.com>
+Date: Thu, 20 Feb 2025 09:11:09 -0800
+Subject: [PATCH] Remove `absl::if_constexpr` from list of used Abseil targets
+
+This is a follow-up on 0ea5ccd61c69ff5000631781c6c9a3a50241392c, moving to C++'s
+`if constexpr`.
+
+PiperOrigin-RevId: 729136260
+---
+ cmake/abseil-cpp.cmake | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake
+index 2baebed55bb69..29d5044a77b6e 100644
+--- a/cmake/abseil-cpp.cmake
++++ b/cmake/abseil-cpp.cmake
+@@ -72,7 +72,6 @@ else()
+ absl::flat_hash_set
+ absl::function_ref
+ absl::hash
+- absl::if_constexpr
+ absl::layout
+ absl::log_initialize
+ absl::log_globals
diff --git a/protobuf-x32.patch b/protobuf-x32.patch
deleted file mode 100644
index 5217d47..0000000
--- a/protobuf-x32.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Bucket selection is based on higher 32 bits of seed, which is 64-bit wide only on LP64 platforms.
-
---- protobuf-3.20.3/src/google/protobuf/map.h.orig 2022-09-29 23:09:51.000000000 +0200
-+++ protobuf-3.20.3/src/google/protobuf/map.h 2024-09-02 21:38:14.893943033 +0200
-@@ -1092,7 +1092,7 @@ class Map {
- // Use a commpage-based fast time function on Apple environments (MacOS,
- // iOS, tvOS, watchOS, etc).
- s = clock_gettime_nsec_np(CLOCK_UPTIME_RAW);
--#elif defined(__x86_64__) && defined(__GNUC__)
-+#elif defined(__x86_64__) && defined(__LP64__) && defined(__GNUC__)
- uint32_t hi, lo;
- asm volatile("rdtsc" : "=a"(lo), "=d"(hi));
- s += ((static_cast<uint64_t>(hi) << 32) | lo);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/protobuf.git/commitdiff/e1dc11537c1d8289c40153ec88fae34de2a86101
More information about the pld-cvs-commit
mailing list