summaryrefslogtreecommitdiff
path: root/dev-libs/protobuf-c/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-libs/protobuf-c/files
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-libs/protobuf-c/files')
-rw-r--r--dev-libs/protobuf-c/files/protobuf-c-1.3.0-no-build-tests.patch30
-rw-r--r--dev-libs/protobuf-c/files/protobuf-c-1.3.0-protobuf-3.6.patch202
-rw-r--r--dev-libs/protobuf-c/files/protobuf-c-1.3.0-restore-protobuf-2-compatibility.patch33
3 files changed, 265 insertions, 0 deletions
diff --git a/dev-libs/protobuf-c/files/protobuf-c-1.3.0-no-build-tests.patch b/dev-libs/protobuf-c/files/protobuf-c-1.3.0-no-build-tests.patch
new file mode 100644
index 000000000000..55116c67e416
--- /dev/null
+++ b/dev-libs/protobuf-c/files/protobuf-c-1.3.0-no-build-tests.patch
@@ -0,0 +1,30 @@
+https://bugs.gentoo.org/518440
+
+avoid compiling tests when we aren't actually testing, especially since it
+requires a compiler to execute which fails when cross-compiling
+
+--- protobuf-c-1.3.0/Makefile.am
++++ protobuf-c-1.3.0/Makefile.am
+@@ -150,7 +150,7 @@
+ t_generated_code2_test_generated_code2_LDADD = \
+ protobuf-c/libprotobuf-c.la
+
+-noinst_PROGRAMS += \
++check_PROGRAMS += \
+ t/generated-code2/cxx-generate-packed-data
+
+ t_generated_code2_cxx_generate_packed_data_SOURCES = \
+@@ -178,13 +178,6 @@
+ t/generated-code2/test-full-cxx-output.inc: t/generated-code2/cxx-generate-packed-data$(EXEEXT)
+ $(AM_V_GEN)$(top_builddir)/t/generated-code2/cxx-generate-packed-data$(EXEEXT) > $(top_builddir)/t/generated-code2/test-full-cxx-output.inc
+
+-BUILT_SOURCES += \
+- t/test.pb-c.c t/test.pb-c.h \
+- t/test-full.pb-c.c t/test-full.pb-c.h \
+- t/test-optimized.pb-c.c t/test-optimized.pb-c.h \
+- t/test-full.pb.cc t/test-full.pb.h \
+- t/generated-code2/test-full-cxx-output.inc
+-
+ if BUILD_PROTO3
+
+ check_PROGRAMS += \
diff --git a/dev-libs/protobuf-c/files/protobuf-c-1.3.0-protobuf-3.6.patch b/dev-libs/protobuf-c/files/protobuf-c-1.3.0-protobuf-3.6.patch
new file mode 100644
index 000000000000..d6d8ffe93255
--- /dev/null
+++ b/dev-libs/protobuf-c/files/protobuf-c-1.3.0-protobuf-3.6.patch
@@ -0,0 +1,202 @@
+https://github.com/protobuf-c/protobuf-c/pull/309
+https://github.com/protobuf-c/protobuf-c/pull/328
+
+--- /protoc-c/c_field.cc
++++ /protoc-c/c_field.cc
+@@ -189,7 +189,7 @@
+ FieldGeneratorMap::FieldGeneratorMap(const Descriptor* descriptor)
+ : descriptor_(descriptor),
+ field_generators_(
+- new scoped_ptr<FieldGenerator>[descriptor->field_count()]) {
++ new std::unique_ptr<FieldGenerator>[descriptor->field_count()]) {
+ // Construct all the FieldGenerators.
+ for (int i = 0; i < descriptor->field_count(); i++) {
+ field_generators_[i].reset(MakeGenerator(descriptor->field(i)));
+--- /protoc-c/c_field.h
++++ /protoc-c/c_field.h
+@@ -117,7 +117,7 @@
+
+ private:
+ const Descriptor* descriptor_;
+- scoped_array<scoped_ptr<FieldGenerator> > field_generators_;
++ std::unique_ptr<std::unique_ptr<FieldGenerator>[] > field_generators_;
+
+ static FieldGenerator* MakeGenerator(const FieldDescriptor* field);
+
+--- /protoc-c/c_file.cc
++++ /protoc-c/c_file.cc
+@@ -83,13 +83,13 @@
+ const string& dllexport_decl)
+ : file_(file),
+ message_generators_(
+- new scoped_ptr<MessageGenerator>[file->message_type_count()]),
++ new std::unique_ptr<MessageGenerator>[file->message_type_count()]),
+ enum_generators_(
+- new scoped_ptr<EnumGenerator>[file->enum_type_count()]),
++ new std::unique_ptr<EnumGenerator>[file->enum_type_count()]),
+ service_generators_(
+- new scoped_ptr<ServiceGenerator>[file->service_count()]),
++ new std::unique_ptr<ServiceGenerator>[file->service_count()]),
+ extension_generators_(
+- new scoped_ptr<ExtensionGenerator>[file->extension_count()]) {
++ new std::unique_ptr<ExtensionGenerator>[file->extension_count()]) {
+
+ for (int i = 0; i < file->message_type_count(); i++) {
+ message_generators_[i].reset(
+--- /protoc-c/c_file.h
++++ /protoc-c/c_file.h
+@@ -98,13 +98,13 @@
+ private:
+ const FileDescriptor* file_;
+
+- scoped_array<scoped_ptr<MessageGenerator> > message_generators_;
+- scoped_array<scoped_ptr<EnumGenerator> > enum_generators_;
+- scoped_array<scoped_ptr<ServiceGenerator> > service_generators_;
+- scoped_array<scoped_ptr<ExtensionGenerator> > extension_generators_;
++ std::unique_ptr<std::unique_ptr<MessageGenerator>[] > message_generators_;
++ std::unique_ptr<std::unique_ptr<EnumGenerator>[] > enum_generators_;
++ std::unique_ptr<std::unique_ptr<ServiceGenerator>[] > service_generators_;
++ std::unique_ptr<std::unique_ptr<ExtensionGenerator>[] > extension_generators_;
+
+ // E.g. if the package is foo.bar, package_parts_ is {"foo", "bar"}.
+- vector<string> package_parts_;
++ std::vector<string> package_parts_;
+
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator);
+ };
+--- /protoc-c/c_generator.cc
++++ /protoc-c/c_generator.cc
+@@ -80,13 +80,13 @@
+ // "foo=bar,baz,qux=corge"
+ // parses to the pairs:
+ // ("foo", "bar"), ("baz", ""), ("qux", "corge")
+-void ParseOptions(const string& text, vector<pair<string, string> >* output) {
+- vector<string> parts;
++void ParseOptions(const string& text, std::vector<std::pair<string, string> >* output) {
++ std::vector<string> parts;
+ SplitStringUsing(text, ",", &parts);
+
+ for (unsigned i = 0; i < parts.size(); i++) {
+ string::size_type equals_pos = parts[i].find_first_of('=');
+- pair<string, string> value;
++ std::pair<string, string> value;
+ if (equals_pos == string::npos) {
+ value.first = parts[i];
+ value.second = "";
+@@ -105,7 +105,7 @@
+ const string& parameter,
+ OutputDirectory* output_directory,
+ string* error) const {
+- vector<pair<string, string> > options;
++ std::vector<std::pair<string, string> > options;
+ ParseOptions(parameter, &options);
+
+ // -----------------------------------------------------------------
+@@ -149,7 +149,7 @@
+
+ // Generate header.
+ {
+- scoped_ptr<io::ZeroCopyOutputStream> output(
++ std::unique_ptr<io::ZeroCopyOutputStream> output(
+ output_directory->Open(basename + ".h"));
+ io::Printer printer(output.get(), '$');
+ file_generator.GenerateHeader(&printer);
+@@ -157,7 +157,7 @@
+
+ // Generate cc file.
+ {
+- scoped_ptr<io::ZeroCopyOutputStream> output(
++ std::unique_ptr<io::ZeroCopyOutputStream> output(
+ output_directory->Open(basename + ".c"));
+ io::Printer printer(output.get(), '$');
+ file_generator.GenerateSource(&printer);
+--- /protoc-c/c_helpers.cc
++++ /protoc-c/c_helpers.cc
+@@ -177,7 +177,7 @@
+ }
+
+ string FullNameToLower(const string &full_name) {
+- vector<string> pieces;
++ std::vector<string> pieces;
+ SplitStringUsing(full_name, ".", &pieces);
+ string rv = "";
+ for (unsigned i = 0; i < pieces.size(); i++) {
+@@ -188,7 +188,7 @@
+ return rv;
+ }
+ string FullNameToUpper(const string &full_name) {
+- vector<string> pieces;
++ std::vector<string> pieces;
+ SplitStringUsing(full_name, ".", &pieces);
+ string rv = "";
+ for (unsigned i = 0; i < pieces.size(); i++) {
+@@ -199,7 +199,7 @@
+ return rv;
+ }
+ string FullNameToC(const string &full_name) {
+- vector<string> pieces;
++ std::vector<string> pieces;
+ SplitStringUsing(full_name, ".", &pieces);
+ string rv = "";
+ for (unsigned i = 0; i < pieces.size(); i++) {
+@@ -214,7 +214,7 @@
+ {
+ if (!comment.empty())
+ {
+- vector<string> comment_lines;
++ std::vector<string> comment_lines;
+ SplitStringUsing (comment, "\r\n", &comment_lines);
+ printer->Print ("/*\n");
+ for (int i = 0; i < comment_lines.size(); i++)
+@@ -503,8 +503,8 @@
+
+ void SplitStringUsing(const string& full,
+ const char* delim,
+- vector<string>* result) {
+- std::back_insert_iterator< vector<string> > it(*result);
++ std::vector<string>* result) {
++ std::back_insert_iterator< std::vector<string> > it(*result);
+ SplitStringToIteratorUsing(full, delim, it);
+ }
+
+@@ -559,7 +559,7 @@
+ }
+ string CEscape(const string& src) {
+ const int dest_length = src.size() * 4 + 1; // Maximum possible expansion
+- scoped_array<char> dest(new char[dest_length]);
++ std::unique_ptr<char[]> dest(new char[dest_length]);
+ const int len = CEscapeInternal(src.data(), src.size(),
+ dest.get(), dest_length, false);
+ GOOGLE_DCHECK_GE(len, 0);
+--- /protoc-c/c_message.cc
++++ /protoc-c/c_message.cc
+@@ -83,11 +83,11 @@
+ : descriptor_(descriptor),
+ dllexport_decl_(dllexport_decl),
+ field_generators_(descriptor),
+- nested_generators_(new scoped_ptr<MessageGenerator>[
++ nested_generators_(new std::unique_ptr<MessageGenerator>[
+ descriptor->nested_type_count()]),
+- enum_generators_(new scoped_ptr<EnumGenerator>[
++ enum_generators_(new std::unique_ptr<EnumGenerator>[
+ descriptor->enum_type_count()]),
+- extension_generators_(new scoped_ptr<ExtensionGenerator>[
++ extension_generators_(new std::unique_ptr<ExtensionGenerator>[
+ descriptor->extension_count()]) {
+
+ for (int i = 0; i < descriptor->nested_type_count(); i++) {
+--- /protoc-c/c_message.h
++++ /protoc-c/c_message.h
+@@ -126,9 +126,9 @@
+ const Descriptor* descriptor_;
+ string dllexport_decl_;
+ FieldGeneratorMap field_generators_;
+- scoped_array<scoped_ptr<MessageGenerator> > nested_generators_;
+- scoped_array<scoped_ptr<EnumGenerator> > enum_generators_;
+- scoped_array<scoped_ptr<ExtensionGenerator> > extension_generators_;
++ std::unique_ptr<std::unique_ptr<MessageGenerator>[] > nested_generators_;
++ std::unique_ptr<std::unique_ptr<EnumGenerator>[] > enum_generators_;
++ std::unique_ptr<std::unique_ptr<ExtensionGenerator>[] > extension_generators_;
+
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageGenerator);
+ };
diff --git a/dev-libs/protobuf-c/files/protobuf-c-1.3.0-restore-protobuf-2-compatibility.patch b/dev-libs/protobuf-c/files/protobuf-c-1.3.0-restore-protobuf-2-compatibility.patch
new file mode 100644
index 000000000000..962341b6540d
--- /dev/null
+++ b/dev-libs/protobuf-c/files/protobuf-c-1.3.0-restore-protobuf-2-compatibility.patch
@@ -0,0 +1,33 @@
+From 4302266b45303094616685c7997a6e6015ddadba Mon Sep 17 00:00:00 2001
+From: Robert Edmonds <edmonds@users.noreply.github.com>
+Date: Mon, 7 Aug 2017 12:31:55 -0400
+Subject: [PATCH] Restore protobuf-2.x compatibility
+
+The change in commit 712154b912de824741381c0bb26c2fbed54515a3 ("Bump
+minimum required header version for proto3 syntax") uses functionality
+only exposed by protobuf-3.x, breaking the build when compiling against
+protobuf-2.x.
+
+Since we still want to support building against protobuf-2.x, this
+commit makes the proto3 syntax check in the file generator dependent on
+building against protobuf-3.x.
+---
+ protoc-c/c_file.cc | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/protoc-c/c_file.cc b/protoc-c/c_file.cc
+index 9851768..0f1d770 100644
+--- a/protoc-c/c_file.cc
++++ b/protoc-c/c_file.cc
+@@ -120,9 +120,11 @@ void FileGenerator::GenerateHeader(io::Printer* printer) {
+ string filename_identifier = FilenameIdentifier(file_->name());
+
+ int min_header_version = 1000000;
++#if defined(HAVE_PROTO3)
+ if (file_->syntax() == FileDescriptor::SYNTAX_PROTO3) {
+ min_header_version = 1003000;
+ }
++#endif
+
+ // Generate top of header.
+ printer->Print(