]> git.pld-linux.org Git - packages/protobuf.git/commitdiff
- updated to 3.3.0 (note: new sonames)
authorJakub Bogusz <qboosh@pld-linux.org>
Fri, 17 Nov 2017 16:24:02 +0000 (17:24 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Fri, 17 Nov 2017 16:24:22 +0000 (17:24 +0100)
- updated system-gtest patch
- removed obsolete fix-macro-redefinitions patch

fix-macro-redefinitions.patch [deleted file]
protobuf.spec
system-gtest.patch

diff --git a/fix-macro-redefinitions.patch b/fix-macro-redefinitions.patch
deleted file mode 100644 (file)
index 29a1404..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-From 416f90939d4de58fe1a4e2489120010313183291 Mon Sep 17 00:00:00 2001
-From: Feng Xiao <xfxyjwf@gmail.com>
-Date: Tue, 14 Mar 2017 23:12:52 +0000
-Subject: [PATCH] Fix freebsd build.
-
-It turns out system headers included by generated plugin.pb.h file already contains
-major/minor macro definitions when built on FreeBSD and we need to add #undefs to
-the generated header file.
-
-This change also fixes another compile error regarding EXPECT_DEATH on FreeBSD.
----
- src/google/protobuf/compiler/cpp/cpp_file.cc      | 46 +++++++++++++++++++++++
- src/google/protobuf/compiler/cpp/cpp_file.h       |  9 +++++
- src/google/protobuf/compiler/plugin.pb.h          |  6 +++
- src/google/protobuf/stubs/stringpiece_unittest.cc |  2 +
- 4 files changed, 63 insertions(+)
-
-diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc
-index 0e5e2f1..f2e013c 100644
---- a/src/google/protobuf/compiler/cpp/cpp_file.cc
-+++ b/src/google/protobuf/compiler/cpp/cpp_file.cc
-@@ -54,6 +54,39 @@ namespace google {
- namespace protobuf {
- namespace compiler {
- namespace cpp {
-+namespace {
-+// The list of names that are defined as macros on some platforms. We need to
-+// #undef them for the generated code to compile.
-+const char* kMacroNames[] = {"major", "minor"};
-+
-+bool IsMacroName(const string& name) {
-+  // Just do a linear search as the number of elements is very small.
-+  for (int i = 0; i < GOOGLE_ARRAYSIZE(kMacroNames); ++i) {
-+    if (name == kMacroNames[i]) return true;
-+  }
-+  return false;
-+}
-+
-+void CollectMacroNames(const Descriptor* message, vector<string>* names) {
-+  for (int i = 0; i < message->field_count(); ++i) {
-+    const FieldDescriptor* field = message->field(i);
-+    if (IsMacroName(field->name())) {
-+      names->push_back(field->name());
-+    }
-+  }
-+  for (int i = 0; i < message->nested_type_count(); ++i) {
-+    CollectMacroNames(message->nested_type(i), names);
-+  }
-+}
-+
-+void CollectMacroNames(const FileDescriptor* file, vector<string>* names) {
-+  for (int i = 0; i < file->message_type_count(); ++i) {
-+    CollectMacroNames(file->message_type(i), names);
-+  }
-+}
-+
-+
-+}  // namespace
- // ===================================================================
-@@ -103,10 +136,23 @@ FileGenerator::FileGenerator(const FileDescriptor* file, const Options& options)
- FileGenerator::~FileGenerator() {}
-+void FileGenerator::GenerateMacroUndefs(io::Printer* printer) {
-+  vector<string> names_to_undef;
-+  CollectMacroNames(file_, &names_to_undef);
-+  for (int i = 0; i < names_to_undef.size(); ++i) {
-+    printer->Print(
-+        "#ifdef $name$\n"
-+        "#undef $name$\n"
-+        "#endif\n",
-+        "name", names_to_undef[i]);
-+  }
-+}
-+
- void FileGenerator::GenerateHeader(io::Printer* printer) {
-   printer->Print(
-     "// @@protoc_insertion_point(includes)\n");
-+  GenerateMacroUndefs(printer);
-   GenerateForwardDeclarations(printer);
-diff --git a/src/google/protobuf/compiler/cpp/cpp_file.h b/src/google/protobuf/compiler/cpp/cpp_file.h
-index 25d6eab..e3fbb96 100644
---- a/src/google/protobuf/compiler/cpp/cpp_file.h
-+++ b/src/google/protobuf/compiler/cpp/cpp_file.h
-@@ -133,6 +133,15 @@ class FileGenerator {
-   void GenerateProto2NamespaceEnumSpecializations(io::Printer* printer);
-+  // Sometimes the names we use in a .proto file happen to be defined as macros
-+  // on some platforms (e.g., macro/minor used in plugin.proto are defined as
-+  // macros in sys/types.h on FreeBSD and a few other platforms). To make the
-+  // generated code compile on these platforms, we either have to undef the
-+  // macro for these few platforms, or rename the field name for all platforms.
-+  // Since these names are part of protobuf public API, renaming is generally
-+  // a breaking change so we prefer the #undef approach.
-+  void GenerateMacroUndefs(io::Printer* printer);
-+
-   const FileDescriptor* file_;
-   const Options options_;
-diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h
-index 1b91dac..d6afb21 100644
---- a/src/google/protobuf/compiler/plugin.pb.h
-+++ b/src/google/protobuf/compiler/plugin.pb.h
-@@ -30,6 +30,12 @@
- #include <google/protobuf/unknown_field_set.h>
- #include <google/protobuf/descriptor.pb.h>
- // @@protoc_insertion_point(includes)
-+#ifdef major
-+#undef major
-+#endif
-+#ifdef minor
-+#undef minor
-+#endif
- namespace google {
- namespace protobuf {
- class DescriptorProto;
-diff --git a/src/google/protobuf/stubs/stringpiece_unittest.cc b/src/google/protobuf/stubs/stringpiece_unittest.cc
-index a52d81f..a6a8759 100644
---- a/src/google/protobuf/stubs/stringpiece_unittest.cc
-+++ b/src/google/protobuf/stubs/stringpiece_unittest.cc
-@@ -783,11 +783,13 @@ TEST(FindOneCharTest, EdgeCases) {
-   EXPECT_EQ(StringPiece::npos, a.rfind('x'));
- }
-+#ifdef PROTOBUF_HAS_DEATH_TEST
- #ifndef NDEBUG
- TEST(NonNegativeLenTest, NonNegativeLen) {
-   EXPECT_DEATH(StringPiece("xyz", -1), "len >= 0");
- }
- #endif  // ndef DEBUG
-+#endif  // PROTOBUF_HAS_DEATH_TEST
- }  // namespace
- }  // namespace protobuf
index 32338fe66a2d6d9415fb6489f723d62b8fa19970..13034bd4a3883490832bb4fecb0b008e1aabdc9c 100644 (file)
 Summary:       Protocol Buffers - Google's data interchange format
 Summary(pl.UTF-8):     Protocol Buffers - format wymiany danych Google
 Name:          protobuf
-Version:       3.2.1
-Release:       2
+Version:       3.3.0
+Release:       1
 License:       BSD
 Group:         Libraries
 #Source0Download: https://github.com/google/protobuf/releases
 Source0:       https://github.com/google/protobuf/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 94d3a8148c35cedd2db953245e057a67
+# Source0-md5: 10644296984c7cbdd1e8436e88b069d2
 Source1:       ftdetect-proto.vim
 Patch0:                system-gtest.patch
-Patch1:                fix-macro-redefinitions.patch
 URL:           https://github.com/google/protobuf/
 BuildRequires: autoconf >= 2.59
 BuildRequires: automake >= 1:1.9
@@ -209,7 +208,6 @@ opisów buforów protokołowych (Protocol Buffers).
 %prep
 %setup -q
 %patch0 -p1
-%patch1 -p1
 
 ln -s /usr/src/gmock/src/gmock*.cc src
 
@@ -294,17 +292,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.12
+%attr(755,root,root) %ghost %{_libdir}/libprotoc.so.13
 
 %files libs
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libprotobuf.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.12
+%attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.13
 
 %files lite
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libprotobuf-lite.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libprotobuf-lite.so.12
+%attr(755,root,root) %ghost %{_libdir}/libprotobuf-lite.so.13
 
 %files devel
 %defattr(644,root,root,755)
index 98698d50575242b641572afe2aa59b1ba66df9ab..2d5f9ef0a05303a1dd245897d414b6c753b46657 100644 (file)
@@ -54,9 +54,9 @@
          echo "Making clean in conformance"; \
          cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \
        fi; \
---- protobuf-3.1.0/src/Makefile.am.orig        2016-12-29 21:01:17.820292537 +0100
-+++ protobuf-3.1.0/src/Makefile.am     2016-12-29 21:32:14.440271338 +0100
-@@ -693,15 +693,22 @@
+--- protobuf-3.3.0/src/Makefile.am.orig        2017-04-27 01:32:21.000000000 +0200
++++ protobuf-3.3.0/src/Makefile.am     2017-05-27 11:43:16.651910938 +0200
+@@ -744,15 +744,22 @@
    google/protobuf/testing/file.cc                              \
    google/protobuf/testing/file.h
  
@@ -84,7 +84,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.
-@@ -784,11 +790,11 @@
+@@ -837,11 +844,11 @@
  # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
  protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
                        libprotoc.la                                   \
                                           -DPROTOBUF_TEST_NO_DESCRIPTORS
  protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
  protobuf_lazy_descriptor_test_SOURCES =                        \
-@@ -819,11 +825,11 @@
+@@ -862,9 +869,9 @@
+ # full runtime and we want to make sure this test builds without full
+ # runtime.
+ protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
+-                           ../gmock/gtest/lib/libgtest.la      \
+-                           ../gmock/lib/libgmock.la            \
+-                           ../gmock/lib/libgmock_main.la
++                           -lgtest      \
++                           libgmock_main.la            \
++                           libgmock.la
+ protobuf_lite_test_CPPFLAGS= -I$(srcdir)/../gmock/include \
+                              -I$(srcdir)/../gmock/gtest/include
+ protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+@@ -877,11 +884,11 @@
  # 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 \
  protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
  protobuf_lite_arena_test_SOURCES =       \
    google/protobuf/lite_arena_unittest.cc \
-@@ -832,8 +838,8 @@
+@@ -890,8 +897,8 @@
  
  # Test plugin binary.
  test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
  test_plugin_SOURCES =                                          \
    google/protobuf/compiler/mock_code_generator.cc              \
    google/protobuf/testing/file.cc                              \
-@@ -862,9 +868,9 @@
+@@ -920,9 +927,9 @@
        echo "TEST(NoWarningTest, Empty) {}" >> no_warning_test.cc
  
  no_warning_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la      \
This page took 0.087624 seconds and 4 git commands to generate.