[packages/protobuf] - updated to 3.20.3 (new sonames, python2 is gone - 3.17.3 saved in python-protobuf.spec)
qboosh
qboosh at pld-linux.org
Mon Sep 9 07:50:51 CEST 2024
commit 1c155cd33dea35ddaae6239825b03aa1a558b118
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Mon Sep 9 06:29:46 2024 +0200
- updated to 3.20.3 (new sonames, python2 is gone - 3.17.3 saved in python-protobuf.spec)
no-wrap-memcpy.patch | 23 ++--
protobuf-32bit.patch | 309 +++++++++++++++++++++++++++++++++++++++++++++++++++
protobuf-x32.patch | 22 ++--
protobuf.spec | 56 +++-------
system-gtest.patch | 20 ++--
5 files changed, 361 insertions(+), 69 deletions(-)
---
diff --git a/protobuf.spec b/protobuf.spec
index ed9e97b..7709a5d 100644
--- a/protobuf.spec
+++ b/protobuf.spec
@@ -4,7 +4,6 @@
# - add bindings for csharp
#
# Conditional build:
-%bcond_without python2 # Python 2.x bindings
%bcond_without python3 # Python 3.x bindings
%bcond_without ruby # Ruby bindings
%bcond_without tests # perform "make check" (requires 4+GB RAM on 64-bit archs)
@@ -12,36 +11,32 @@
Summary: Protocol Buffers - Google's data interchange format
Summary(pl.UTF-8): Protocol Buffers - format wymiany danych Google
Name: protobuf
-Version: 3.17.3
+Version: 3.20.3
Release: 1
License: BSD
Group: Libraries
#Source0Download: https://github.com/google/protobuf/releases
Source0: https://github.com/google/protobuf/releases/download/v%{version}/%{name}-all-%{version}.tar.gz
-# Source0-md5: 689cac84577732d00dfec6e3d5b87cee
+# Source0-md5: a1e8f594f998576180ff1efa49007f54
Source1: ftdetect-proto.vim
+Source2: https://github.com/protocolbuffers/utf8_range/archive/1d1ea7e3fedf482d4a12b473c1ed25fe0f371a45/utf8_range-20231110.tar.gz
+# Source2-md5: 3ee3e8809236fbac057b26e502afe4cb
Patch0: system-gtest.patch
Patch1: no-wrap-memcpy.patch
Patch2: %{name}-x32.patch
-Patch3: %{name}-disable-64bitptr-test.patch
+Patch3: %{name}-32bit.patch
URL: https://github.com/google/protobuf/
BuildRequires: autoconf >= 2.59
-BuildRequires: automake >= 1:1.9
+BuildRequires: automake >= 1:1.11
%{?with_tests:BuildRequires: gmock-devel >= 1.9.0}
%{?with_tests:BuildRequires: gtest-devel >= 1.9.0}
BuildRequires: libstdc++-devel >= 6:4.7
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: sed >= 4.0
-%if %{with python2}
-BuildRequires: python-modules >= 1:2.7
-BuildRequires: python-setuptools
-%endif
%if %{with python3}
BuildRequires: python3-modules >= 1:3.3
BuildRequires: python3-setuptools
-%endif
-%if %{with python2} || %{with python3}
BuildRequires: rpm-pythonprov
%endif
BuildRequires: rpmbuild(macros) >= 1.714
@@ -209,17 +204,19 @@ Ten pakiet zawiera pliki podświetlania składni edytora Vim dla
opisów buforów protokołowych (Protocol Buffers).
%prep
-%setup -q
+%setup -q -a2
%patch0 -p1
%patch1 -p1
%patch2 -p1
-%ifnarch %{x8664} aarch64 alpha ia64 mips64 ppc64 s390x sparc64
+#%ifnarch %{x8664} aarch64 alpha ia64 mips64 ppc64 s390x sparc64
%patch3 -p1
-%endif
+#%endif
-%{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python}\1,' \
- examples/add_person.py \
- examples/list_people.py
+%{__mv} utf8_range-* third_party/utf8_range
+
+%{__sed} -i -e '1s,/usr/bin/env python$,%{__python3},' \
+ examples/add_person.py \
+ examples/list_people.py
# gcc 10.2 false positive warning (with tag values >= 128):
#
@@ -228,7 +225,7 @@ opisów buforów protokołowych (Protocol Buffers).
# ~~~~~^~~~~~ error: comparison is always false due to limited range of data type [-Werror=type-limits]
# } else {
#
-%{__sed} -i -e 's/-Werror //' src/Makefile.am
+#%{__sed} -i -e 's/-Werror //' src/Makefile.am
%ifarch %{ix86} x32
# fail due to memory space limit or some unexpected allocation sizes(?)
@@ -251,9 +248,6 @@ opisów buforów protokołowych (Protocol Buffers).
%{__make}
cd python
-%if %{with python2}
-%py_build
-%endif
%if %{with python3}
%py3_build
%endif
@@ -285,10 +279,6 @@ 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 python2}
-%py_install
-%py_postclean
-%endif
%if %{with python3}
%py3_install
%endif
@@ -319,17 +309,17 @@ rm -rf $RPM_BUILD_ROOT
%doc CHANGES.txt CONTRIBUTORS.txt LICENSE README.md
%attr(755,root,root) %{_bindir}/protoc
%attr(755,root,root) %{_libdir}/libprotoc.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libprotoc.so.28
+%attr(755,root,root) %ghost %{_libdir}/libprotoc.so.31
%files libs
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libprotobuf.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.28
+%attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.31
%files lite
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libprotobuf-lite.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libprotobuf-lite.so.28
+%attr(755,root,root) %ghost %{_libdir}/libprotobuf-lite.so.31
%files devel
%defattr(644,root,root,755)
@@ -352,16 +342,6 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/libprotobuf.a
%{_libdir}/libprotoc.a
-%if %{with python2}
-%files -n python-protobuf
-%defattr(644,root,root,755)
-%doc python/README.md
-%dir %{py_sitescriptdir}/google
-%{py_sitescriptdir}/google/protobuf
-%{py_sitescriptdir}/protobuf-%{version}-py*.egg-info
-%{py_sitescriptdir}/protobuf-%{version}-py*-nspkg.pth
-%endif
-
%if %{with python3}
%files -n python3-protobuf
%defattr(644,root,root,755)
diff --git a/no-wrap-memcpy.patch b/no-wrap-memcpy.patch
index 99321a4..d73a692 100644
--- a/no-wrap-memcpy.patch
+++ b/no-wrap-memcpy.patch
@@ -1,7 +1,7 @@
---- protobuf-3.17.3/ruby/ext/google/protobuf_c/extconf.rb~ 2020-02-14 21:13:37.000000000 +0100
-+++ protobuf-3.17.3/ruby/ext/google/protobuf_c/extconf.rb 2020-04-07 22:56:24.419874091 +0200
-@@ -3,19 +3,19 @@
- require 'mkmf'
+--- protobuf-3.20.3/ruby/ext/google/protobuf_c/extconf.rb.orig 2024-09-02 21:30:25.709818155 +0200
++++ protobuf-3.20.3/ruby/ext/google/protobuf_c/extconf.rb 2024-09-02 21:33:20.092206778 +0200
+@@ -7,22 +7,22 @@ ext_name = "google/protobuf_c"
+ dir_config(ext_name)
if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/
- $CFLAGS += " -std=gnu99 -O3 -DNDEBUG -fvisibility=hidden -Wall -Wsign-compare -Wno-declaration-after-statement"
@@ -15,12 +15,15 @@
if RUBY_PLATFORM =~ /linux/
# Instruct the linker to point memcpy calls at our __wrap_memcpy wrapper.
- $LDFLAGS += " -Wl,-wrap,memcpy"
-+ $LDFLAGS += " -std=c99 -DNDEBUG"
++ $LDFLAGS += " -std=c99"
end
- $objs = ["protobuf.o", "convert.o", "defs.o", "message.o",
-- "repeated_field.o", "map.o", "ruby-upb.o", "wrap_memcpy.o"]
-+ "repeated_field.o", "map.o", "ruby-upb.o"]
+ $VPATH << "$(srcdir)/third_party/utf8_range"
+ $INCFLAGS << "$(srcdir)/third_party/utf8_range"
- find_header('third_party/wyhash/wyhash.h', '../../../..')
- create_makefile("google/protobuf_c")
+ $srcs = ["protobuf.c", "convert.c", "defs.c", "message.c",
+- "repeated_field.c", "map.c", "ruby-upb.c", "wrap_memcpy.c",
++ "repeated_field.c", "map.c", "ruby-upb.c",
+ "naive.c", "range2-neon.c", "range2-sse.c"]
+
+ create_makefile(ext_name)
diff --git a/protobuf-32bit.patch b/protobuf-32bit.patch
new file mode 100644
index 0000000..bf96c51
--- /dev/null
+++ b/protobuf-32bit.patch
@@ -0,0 +1,309 @@
+https://github.com/protocolbuffers/protobuf/pull/10589.patch
+
+From d068cfacde2af77e9d5974db0de469ec29fbefb9 Mon Sep 17 00:00:00 2001
+From: Mike Kruskal <mkruskal at google.com>
+Date: Thu, 15 Sep 2022 09:57:04 -0700
+Subject: [PATCH 1/7] Adding full build to 32 bit tests
+
+---
+ kokoro/linux/32-bit/test_php.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+#diff --git a/kokoro/linux/32-bit/test_php.sh b/kokoro/linux/32-bit/test_php.sh
+#index 3770b84af32d..3cb518a005cc 100644
+#--- a/kokoro/linux/32-bit/test_php.sh
+#+++ b/kokoro/linux/32-bit/test_php.sh
+#@@ -37,7 +37,7 @@ build_php_c() {
+# }
+#
+# cmake .
+#-cmake --build . --target protoc -- -j20
+#+cmake --build . -- -j20
+# export PROTOC=$(pwd)/protoc
+#
+# build_php 7.0
+
+From 6aa43419ee802b57f3e7ece5062e66bcbf1e80e7 Mon Sep 17 00:00:00 2001
+From: Mike Kruskal <mkruskal at google.com>
+Date: Thu, 15 Sep 2022 10:00:45 -0700
+Subject: [PATCH 2/7] Running C++ tests in 32 bit builds
+
+---
+ kokoro/linux/32-bit/test_php.sh | 1 +
+ 1 file changed, 1 insertion(+)
+
+#diff --git a/kokoro/linux/32-bit/test_php.sh b/kokoro/linux/32-bit/test_php.sh
+#index 3cb518a005cc..b9731a2e5444 100644
+#--- a/kokoro/linux/32-bit/test_php.sh
+#+++ b/kokoro/linux/32-bit/test_php.sh
+#@@ -38,6 +38,7 @@ build_php_c() {
+#
+# cmake .
+# cmake --build . -- -j20
+#+ctest --verbose --parallel 20
+# export PROTOC=$(pwd)/protoc
+#
+# build_php 7.0
+
+From 5f4a52d9bff7595ec47fb6727662a1cada3cd404 Mon Sep 17 00:00:00 2001
+From: Mike Kruskal <mkruskal at google.com>
+Date: Thu, 15 Sep 2022 10:23:23 -0700
+Subject: [PATCH 3/7] Patching static assert test failure
+
+---
+ src/google/protobuf/extension_set_unittest.cc | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/google/protobuf/extension_set_unittest.cc b/src/google/protobuf/extension_set_unittest.cc
+index 8b436bc20c93..84da3c5465a2 100644
+--- a/src/google/protobuf/extension_set_unittest.cc
++++ b/src/google/protobuf/extension_set_unittest.cc
+@@ -855,8 +855,10 @@ TEST(ExtensionSetTest, SpaceUsedExcludingSelf) {
+ const size_t old_capacity = \
+ message->GetRepeatedExtension(unittest::repeated_##type##_extension) \
+ .Capacity(); \
+- EXPECT_GE(old_capacity, \
+- (RepeatedFieldLowerClampLimit<cpptype, sizeof(void*)>())); \
++ EXPECT_GE( \
++ old_capacity, \
++ (RepeatedFieldLowerClampLimit<cpptype, std::max(sizeof(cpptype), \
++ sizeof(void*))>())); \
+ for (int i = 0; i < 16; ++i) { \
+ message->AddExtension(unittest::repeated_##type##_extension, value); \
+ } \
+
+From c94b66706bec17d918495f4715183a5eaf0f8044 Mon Sep 17 00:00:00 2001
+From: Mike Kruskal <mkruskal at google.com>
+Date: Thu, 15 Sep 2022 11:31:31 -0700
+Subject: [PATCH 4/7] Test fixes for 32-bit architectures
+
+---
+ .../compiler/cpp/message_size_unittest.cc | 2 +-
+ .../protobuf/io/zero_copy_stream_unittest.cc | 3 ++
+ .../protobuf/repeated_field_unittest.cc | 4 +--
+ src/google/protobuf/util/time_util_test.cc | 28 +++++++++++--------
+ 4 files changed, 23 insertions(+), 14 deletions(-)
+
+#diff --git a/src/google/protobuf/compiler/cpp/message_size_unittest.cc b/src/google/protobuf/compiler/cpp/message_size_unittest.cc
+#index a75d77a70cbd..ed4a90e223fa 100644
+#--- a/src/google/protobuf/compiler/cpp/message_size_unittest.cc
+#+++ b/src/google/protobuf/compiler/cpp/message_size_unittest.cc
+#@@ -139,9 +139,9 @@ TEST(GeneratedMessageTest, OneStringSize) {
+#
+# TEST(GeneratedMessageTest, MoreStringSize) {
+# struct MockGenerated : public MockMessageBase { // 16 bytes
+#- int has_bits[1]; // 4 bytes
+# int cached_size; // 4 bytes
+# MockRepeatedPtrField data; // 24 bytes
+#+ // + 4 bytes padding
+# };
+# GOOGLE_CHECK_MESSAGE_SIZE(MockGenerated, 48);
+# EXPECT_EQ(sizeof(protobuf_unittest::MoreString), sizeof(MockGenerated));
+diff --git a/src/google/protobuf/io/zero_copy_stream_unittest.cc b/src/google/protobuf/io/zero_copy_stream_unittest.cc
+index d82354e571bb..d656da5f13ba 100644
+--- a/src/google/protobuf/io/zero_copy_stream_unittest.cc
++++ b/src/google/protobuf/io/zero_copy_stream_unittest.cc
+@@ -720,6 +720,9 @@ TEST_F(IoTest, StringIo) {
+
+ // Verifies that outputs up to kint32max can be created.
+ TEST_F(IoTest, LargeOutput) {
++ // Filter out this test on 32-bit architectures.
++ if(sizeof(void*) < 8) return;
++
+ std::string str;
+ StringOutputStream output(&str);
+ void* unused_data;
+diff --git a/src/google/protobuf/repeated_field_unittest.cc b/src/google/protobuf/repeated_field_unittest.cc
+index eb0b9091cf8e..3baf6f25bb21 100644
+--- a/src/google/protobuf/repeated_field_unittest.cc
++++ b/src/google/protobuf/repeated_field_unittest.cc
+@@ -429,14 +429,14 @@ TEST(RepeatedField, ReserveNothing) {
+
+ TEST(RepeatedField, ReserveLowerClamp) {
+ int clamped_value = internal::CalculateReserveSize<bool, sizeof(void*)>(0, 1);
+- EXPECT_GE(clamped_value, 8 / sizeof(bool));
++ EXPECT_GE(clamped_value, sizeof(void*) / sizeof(bool));
+ EXPECT_EQ((internal::RepeatedFieldLowerClampLimit<bool, sizeof(void*)>()),
+ clamped_value);
+ // EXPECT_EQ(clamped_value, (internal::CalculateReserveSize<bool,
+ // sizeof(void*)>( clamped_value, 2)));
+
+ clamped_value = internal::CalculateReserveSize<int, sizeof(void*)>(0, 1);
+- EXPECT_GE(clamped_value, 8 / sizeof(int));
++ EXPECT_GE(clamped_value, sizeof(void*) / sizeof(int));
+ EXPECT_EQ((internal::RepeatedFieldLowerClampLimit<int, sizeof(void*)>()),
+ clamped_value);
+ // EXPECT_EQ(clamped_value, (internal::CalculateReserveSize<int,
+diff --git a/src/google/protobuf/util/time_util_test.cc b/src/google/protobuf/util/time_util_test.cc
+index 464e57b4ee50..dceb6dbe2bf8 100644
+--- a/src/google/protobuf/util/time_util_test.cc
++++ b/src/google/protobuf/util/time_util_test.cc
+@@ -48,15 +48,18 @@ using google::protobuf::Timestamp;
+ namespace {
+
+ TEST(TimeUtilTest, TimestampStringFormat) {
+- Timestamp begin, end;
+- EXPECT_TRUE(TimeUtil::FromString("0001-01-01T00:00:00Z", &begin));
+- EXPECT_EQ(TimeUtil::kTimestampMinSeconds, begin.seconds());
+- EXPECT_EQ(0, begin.nanos());
+- EXPECT_TRUE(TimeUtil::FromString("9999-12-31T23:59:59.999999999Z", &end));
+- EXPECT_EQ(TimeUtil::kTimestampMaxSeconds, end.seconds());
+- EXPECT_EQ(999999999, end.nanos());
+- EXPECT_EQ("0001-01-01T00:00:00Z", TimeUtil::ToString(begin));
+- EXPECT_EQ("9999-12-31T23:59:59.999999999Z", TimeUtil::ToString(end));
++ // These these are out of bounds for 32-bit architectures.
++ if(sizeof(time_t) >= sizeof(uint64_t)) {
++ Timestamp begin, end;
++ EXPECT_TRUE(TimeUtil::FromString("0001-01-01T00:00:00Z", &begin));
++ EXPECT_EQ(TimeUtil::kTimestampMinSeconds, begin.seconds());
++ EXPECT_EQ(0, begin.nanos());
++ EXPECT_TRUE(TimeUtil::FromString("9999-12-31T23:59:59.999999999Z", &end));
++ EXPECT_EQ(TimeUtil::kTimestampMaxSeconds, end.seconds());
++ EXPECT_EQ(999999999, end.nanos());
++ EXPECT_EQ("0001-01-01T00:00:00Z", TimeUtil::ToString(begin));
++ EXPECT_EQ("9999-12-31T23:59:59.999999999Z", TimeUtil::ToString(end));
++ }
+
+ // Test negative timestamps.
+ Timestamp time = TimeUtil::NanosecondsToTimestamp(-1);
+@@ -94,9 +97,12 @@ TEST(TimeUtilTest, DurationStringFormat) {
+ EXPECT_TRUE(TimeUtil::FromString("0001-01-01T00:00:00Z", &begin));
+ EXPECT_TRUE(TimeUtil::FromString("9999-12-31T23:59:59.999999999Z", &end));
+
+- EXPECT_EQ("315537897599.999999999s", TimeUtil::ToString(end - begin));
++ // These these are out of bounds for 32-bit architectures.
++ if(sizeof(time_t) >= sizeof(uint64_t)) {
++ EXPECT_EQ("315537897599.999999999s", TimeUtil::ToString(end - begin));
++ EXPECT_EQ("-315537897599.999999999s", TimeUtil::ToString(begin - end));
++ }
+ EXPECT_EQ(999999999, (end - begin).nanos());
+- EXPECT_EQ("-315537897599.999999999s", TimeUtil::ToString(begin - end));
+ EXPECT_EQ(-999999999, (begin - end).nanos());
+
+ // Generated output should contain 3, 6, or 9 fractional digits.
+
+From 4296a527306cdd67b87bbd325c3e9730bcb70bee Mon Sep 17 00:00:00 2001
+From: Mike Kruskal <mkruskal at google.com>
+Date: Fri, 16 Sep 2022 14:49:05 -0700
+Subject: [PATCH 5/7] Cleanup after CMake build
+
+---
+ kokoro/linux/32-bit/test_php.sh | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+#diff --git a/kokoro/linux/32-bit/test_php.sh b/kokoro/linux/32-bit/test_php.sh
+#index b9731a2e5444..49d57551690c 100644
+#--- a/kokoro/linux/32-bit/test_php.sh
+#+++ b/kokoro/linux/32-bit/test_php.sh
+#@@ -36,10 +36,16 @@ build_php_c() {
+# test_php_c
+# }
+#
+#-cmake .
+#+mkdir build
+#+pushd build
+#+cmake ..
+# cmake --build . -- -j20
+# ctest --verbose --parallel 20
+# export PROTOC=$(pwd)/protoc
+#+popd
+#+
+#+# Cleanup after Bazel build
+#+rm -rf build
+#
+# build_php 7.0
+# build_php 7.1
+
+From 696f3cef1b1549e21a3dc9c030b3d90d5b66c468 Mon Sep 17 00:00:00 2001
+From: Mike Kruskal <mkruskal at google.com>
+Date: Fri, 16 Sep 2022 20:20:49 -0700
+Subject: [PATCH 6/7] Save protoc before cleanup
+
+---
+ kokoro/linux/32-bit/test_php.sh | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+#diff --git a/kokoro/linux/32-bit/test_php.sh b/kokoro/linux/32-bit/test_php.sh
+#index 49d57551690c..1f62fcba230b 100644
+#--- a/kokoro/linux/32-bit/test_php.sh
+#+++ b/kokoro/linux/32-bit/test_php.sh
+#@@ -41,10 +41,11 @@ pushd build
+# cmake ..
+# cmake --build . -- -j20
+# ctest --verbose --parallel 20
+#-export PROTOC=$(pwd)/protoc
+# popd
+#
+# # Cleanup after Bazel build
+#+mv build/protoc .
+#+export PROTOC=$(pwd)/protoc
+# rm -rf build
+#
+# build_php 7.0
+
+From 150ca7710696caf6031d258bb900bd08e9c42dae Mon Sep 17 00:00:00 2001
+From: Mike Kruskal <mkruskal at google.com>
+Date: Fri, 16 Sep 2022 20:47:25 -0700
+Subject: [PATCH 7/7] Route protoc better
+
+---
+ kokoro/linux/32-bit/test_php.sh | 9 ++++-----
+ php/generate_descriptor_protos.sh | 4 +++-
+ php/generate_test_protos.sh | 4 +++-
+ 3 files changed, 10 insertions(+), 7 deletions(-)
+
+#diff --git a/kokoro/linux/32-bit/test_php.sh b/kokoro/linux/32-bit/test_php.sh
+#index 1f62fcba230b..739467b20ca7 100644
+#--- a/kokoro/linux/32-bit/test_php.sh
+#+++ b/kokoro/linux/32-bit/test_php.sh
+#@@ -41,12 +41,8 @@ pushd build
+# cmake ..
+# cmake --build . -- -j20
+# ctest --verbose --parallel 20
+#-popd
+#-
+#-# Cleanup after Bazel build
+#-mv build/protoc .
+# export PROTOC=$(pwd)/protoc
+#-rm -rf build
+#+popd
+#
+# build_php 7.0
+# build_php 7.1
+#@@ -57,3 +53,6 @@ build_php_c 7.4
+# build_php_c 7.1-zts
+# build_php_c 7.2-zts
+# build_php_c 7.5-zts
+#+
+#+# Cleanup after CMake build
+#+rm -rf build
+#diff --git a/php/generate_descriptor_protos.sh b/php/generate_descriptor_protos.sh
+#index 1a600abc6392..0e5be35e24f7 100755
+#--- a/php/generate_descriptor_protos.sh
+#+++ b/php/generate_descriptor_protos.sh
+#@@ -5,7 +5,9 @@
+#
+# set -e
+#
+#-PROTOC=$(realpath protoc)
+#+if [[ -z "${PROTOC}" ]]; then
+#+ PROTOC=$(realpath protoc)
+#+fi
+# if [ ! -f $PROTOC ]; then
+# bazel build -c opt //:protoc
+# PROTOC=$(realpath bazel-bin/protoc)
+#diff --git a/php/generate_test_protos.sh b/php/generate_test_protos.sh
+#index 565c7ec1cd08..6d06f959b97d 100755
+#--- a/php/generate_test_protos.sh
+#+++ b/php/generate_test_protos.sh
+#@@ -4,7 +4,9 @@ set -ex
+#
+# cd `dirname $0`/..
+#
+#-PROTOC=$(pwd)/protoc
+#+if [[ -z "${PROTOC}" ]]; then
+#+ PROTOC=$(pwd)/protoc
+#+fi
+# if [ ! -f $PROTOC ]; then
+# bazel build -c opt //:protoc
+# PROTOC=$(pwd)/bazel-bin/protoc
diff --git a/protobuf-x32.patch b/protobuf-x32.patch
index 3ddc357..ffb594d 100644
--- a/protobuf-x32.patch
+++ b/protobuf-x32.patch
@@ -1,13 +1,13 @@
Bucket selection is based on higher 32 bits of seed, which is 64-bit wide only on LP64 platforms.
---- protobuf-3.13.0/src/google/protobuf/map_test.cc.orig 2020-08-15 01:24:06.000000000 +0200
-+++ protobuf-3.13.0/src/google/protobuf/map_test.cc 2020-09-10 06:16:47.150949801 +0200
-@@ -1005,7 +1005,7 @@
- // small maps. Currently we only have sufficient randomness for debug builds and
- // builds where we can use the RDTSC instruction, so we only test for those
- // builds.
--#if defined(__x86_64__) && defined(__GNUC__) && \
-+#if defined(__x86_64__) && defined(__LP64__) && defined(__GNUC__) && \
- !defined(GOOGLE_PROTOBUF_NO_RDTSC)
- TEST_F(MapImplTest, RandomOrdering) {
- for (int i = 0; i < 10; ++i) {
+--- 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 += mach_absolute_time();
+-#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);
diff --git a/system-gtest.patch b/system-gtest.patch
index 63af15e..919de88 100644
--- a/system-gtest.patch
+++ b/system-gtest.patch
@@ -30,11 +30,11 @@
echo "Making clean in conformance"; \
cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \
fi; \
---- protobuf-3.6.1/src/Makefile.am.orig 2018-10-12 17:44:11.446510724 +0200
-+++ protobuf-3.6.1/src/Makefile.am 2018-10-12 18:23:32.609817094 +0200
-@@ -692,19 +692,17 @@
- google/protobuf/testing/file.cc \
- google/protobuf/testing/file.h
+--- protobuf-3.20.3/src/Makefile.am.orig 2022-09-29 23:09:51.000000000 +0200
++++ protobuf-3.20.3/src/Makefile.am 2024-09-02 21:14:47.428234596 +0200
+@@ -717,19 +717,17 @@ COMMON_TEST_SOURCES =
+ google/protobuf/testing/googletest.cc \
+ google/protobuf/testing/googletest.h
-GOOGLETEST_BUILD_DIR=../third_party/googletest/googletest
-GOOGLEMOCK_BUILD_DIR=../third_party/googletest/googlemock
@@ -59,7 +59,7 @@
# Disable optimization for tests unless the user explicitly asked for it,
# since test_util.cc takes forever to compile with optimization (with GCC).
# See configure.ac for more info.
-@@ -792,11 +790,11 @@
+@@ -823,11 +821,11 @@ $(am_protobuf_test_OBJECTS): unittest_pr
# Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
libprotoc.la \
@@ -76,7 +76,7 @@
-DPROTOBUF_TEST_NO_DESCRIPTORS
protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
protobuf_lazy_descriptor_test_SOURCES = \
-@@ -818,11 +816,11 @@
+@@ -850,11 +848,11 @@ COMMON_LITE_TEST_SOURCES =
# full runtime and we want to make sure this test builds without full
# runtime.
protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
@@ -93,7 +93,7 @@
protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
protobuf_lite_test_SOURCES = \
google/protobuf/lite_unittest.cc \
-@@ -834,11 +832,11 @@
+@@ -866,11 +864,11 @@ $(am_protobuf_lite_test_OBJECTS): unitte
# gtest when building the test internally our memory sanitizer doesn't detect
# memory leaks (don't know why).
protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
@@ -110,7 +110,7 @@
protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
protobuf_lite_arena_test_SOURCES = \
google/protobuf/lite_arena_unittest.cc \
-@@ -848,8 +846,8 @@
+@@ -880,8 +878,8 @@ $(am_protobuf_lite_arena_test_OBJECTS):
# Test plugin binary.
test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
@@ -120,4 +120,4 @@
+test_plugin_CPPFLAGS = -I$(GOOGLETEST_INC_DIR)
test_plugin_SOURCES = \
google/protobuf/compiler/mock_code_generator.cc \
- google/protobuf/testing/file.cc \
+ google/protobuf/compiler/test_plugin.cc \
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/protobuf.git/commitdiff/1c155cd33dea35ddaae6239825b03aa1a558b118
More information about the pld-cvs-commit
mailing list