sync ports with The Matrix
This commit is contained in:
parent
02776f1507
commit
a0fe1892c0
885 changed files with 6817 additions and 4874 deletions
|
@ -2,6 +2,7 @@ COMMENT = c protocol buffers
|
|||
|
||||
V = 1.4.1
|
||||
DISTNAME = protobuf-c-$V
|
||||
REVISION = 0
|
||||
|
||||
SHARED_LIBS = protobuf-c 2.0 # 1.0
|
||||
|
||||
|
@ -17,11 +18,12 @@ PERMIT_PACKAGE = Yes
|
|||
WANTLIB = c m protobuf protoc pthread ${COMPILER_LIBCXX} z
|
||||
|
||||
COMPILER = base-clang ports-gcc
|
||||
CXXFLAGS += -std=gnu++11
|
||||
CXXFLAGS += -std=gnu++17
|
||||
|
||||
LIB_DEPENDS = devel/protobuf
|
||||
|
||||
CONFIGURE_STYLE = gnu
|
||||
CONFIGURE_STYLE = autoconf
|
||||
AUTOCONF_VERSION = 2.71
|
||||
|
||||
CONFIGURE_ENV = CPPFLAGS="-I${LOCALBASE}/include" \
|
||||
LDFLAGS="-L${LOCALBASE}/lib"
|
||||
|
|
14
devel/protobuf-c/patches/patch-build-cmake_CMakeLists_txt
Normal file
14
devel/protobuf-c/patches/patch-build-cmake_CMakeLists_txt
Normal file
|
@ -0,0 +1,14 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: build-cmake/CMakeLists.txt
|
||||
--- build-cmake/CMakeLists.txt.orig
|
||||
+++ build-cmake/CMakeLists.txt
|
||||
@@ -88,7 +88,7 @@ if (MSVC AND NOT BUILD_SHARED_LIBS)
|
||||
endif (MSVC AND NOT BUILD_SHARED_LIBS)
|
||||
|
||||
IF(BUILD_PROTOC)
|
||||
-SET(CMAKE_CXX_STANDARD 11)
|
||||
+SET(CMAKE_CXX_STANDARD 17)
|
||||
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
SET(CMAKE_CXX_EXTENSIONS OFF)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h
|
20
devel/protobuf-c/patches/patch-configure_ac
Normal file
20
devel/protobuf-c/patches/patch-configure_ac
Normal file
|
@ -0,0 +1,20 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: configure.ac
|
||||
--- configure.ac.orig
|
||||
+++ configure.ac
|
||||
@@ -76,12 +76,8 @@ AC_ARG_ENABLE([protoc],
|
||||
if test "x$enable_protoc" != "xno"; then
|
||||
AC_LANG_PUSH([C++])
|
||||
|
||||
- AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
|
||||
-
|
||||
- PKG_CHECK_MODULES([protobuf], [protobuf >= 3.0.0],
|
||||
- [proto3_supported=yes],
|
||||
- [PKG_CHECK_MODULES([protobuf], [protobuf >= 2.6.0])]
|
||||
- )
|
||||
+ AX_CXX_COMPILE_STDCXX(17, noext, mandatory)
|
||||
+ PKG_CHECK_MODULES([protobuf], [protobuf >= 3.0.0], [proto3_supported=yes])
|
||||
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$save_CPPFLAGS $protobuf_CFLAGS"
|
14
devel/protobuf-c/patches/patch-protoc-c_c_bytes_field_h
Normal file
14
devel/protobuf-c/patches/patch-protoc-c_c_bytes_field_h
Normal file
|
@ -0,0 +1,14 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_bytes_field.h
|
||||
--- protoc-c/c_bytes_field.h.orig
|
||||
+++ protoc-c/c_bytes_field.h
|
||||
@@ -87,8 +87,6 @@ class BytesFieldGenerator : public FieldGenerator {
|
||||
|
||||
private:
|
||||
std::map<std::string, std::string> variables_;
|
||||
-
|
||||
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(BytesFieldGenerator);
|
||||
};
|
||||
|
||||
|
14
devel/protobuf-c/patches/patch-protoc-c_c_enum_field_h
Normal file
14
devel/protobuf-c/patches/patch-protoc-c_c_enum_field_h
Normal file
|
@ -0,0 +1,14 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_enum_field.h
|
||||
--- protoc-c/c_enum_field.h.orig
|
||||
+++ protoc-c/c_enum_field.h
|
||||
@@ -85,8 +85,6 @@ class EnumFieldGenerator : public FieldGenerator {
|
||||
|
||||
private:
|
||||
std::map<std::string, std::string> variables_;
|
||||
-
|
||||
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumFieldGenerator);
|
||||
};
|
||||
|
||||
|
14
devel/protobuf-c/patches/patch-protoc-c_c_enum_h
Normal file
14
devel/protobuf-c/patches/patch-protoc-c_c_enum_h
Normal file
|
@ -0,0 +1,14 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_enum.h
|
||||
--- protoc-c/c_enum.h.orig
|
||||
+++ protoc-c/c_enum.h
|
||||
@@ -106,8 +106,6 @@ class EnumGenerator {
|
||||
private:
|
||||
const EnumDescriptor* descriptor_;
|
||||
std::string dllexport_decl_;
|
||||
-
|
||||
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator);
|
||||
};
|
||||
|
||||
} // namespace c
|
14
devel/protobuf-c/patches/patch-protoc-c_c_extension_h
Normal file
14
devel/protobuf-c/patches/patch-protoc-c_c_extension_h
Normal file
|
@ -0,0 +1,14 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_extension.h
|
||||
--- protoc-c/c_extension.h.orig
|
||||
+++ protoc-c/c_extension.h
|
||||
@@ -98,8 +98,6 @@ class ExtensionGenerator {
|
||||
const FieldDescriptor* descriptor_;
|
||||
std::string type_traits_;
|
||||
std::string dllexport_decl_;
|
||||
-
|
||||
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator);
|
||||
};
|
||||
|
||||
} // namespace c
|
24
devel/protobuf-c/patches/patch-protoc-c_c_field_h
Normal file
24
devel/protobuf-c/patches/patch-protoc-c_c_field_h
Normal file
|
@ -0,0 +1,24 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_field.h
|
||||
--- protoc-c/c_field.h.orig
|
||||
+++ protoc-c/c_field.h
|
||||
@@ -103,9 +103,6 @@ class FieldGenerator {
|
||||
const std::string &type_macro,
|
||||
const std::string &descriptor_addr) const;
|
||||
const FieldDescriptor *descriptor_;
|
||||
-
|
||||
- private:
|
||||
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGenerator);
|
||||
};
|
||||
|
||||
// Convenience class which constructs FieldGenerators for a Descriptor.
|
||||
@@ -121,8 +118,6 @@ class FieldGeneratorMap {
|
||||
std::unique_ptr<std::unique_ptr<FieldGenerator>[]> field_generators_;
|
||||
|
||||
static FieldGenerator* MakeGenerator(const FieldDescriptor* field);
|
||||
-
|
||||
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGeneratorMap);
|
||||
};
|
||||
|
||||
} // namespace c
|
17
devel/protobuf-c/patches/patch-protoc-c_c_file_cc
Normal file
17
devel/protobuf-c/patches/patch-protoc-c_c_file_cc
Normal file
|
@ -0,0 +1,17 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_file.cc
|
||||
--- protoc-c/c_file.cc.orig
|
||||
+++ protoc-c/c_file.cc
|
||||
@@ -119,7 +119,11 @@ void FileGenerator::GenerateHeader(io::Printer* printe
|
||||
|
||||
int min_header_version = 1000000;
|
||||
#if defined(HAVE_PROTO3)
|
||||
+# if GOOGLE_PROTOBUF_VERSION >= 4023000
|
||||
+ if (FileDescriptorLegacy(file_).syntax() == FileDescriptorLegacy::SYNTAX_PROTO3) {
|
||||
+# else
|
||||
if (file_->syntax() == FileDescriptor::SYNTAX_PROTO3) {
|
||||
+#endif
|
||||
min_header_version = 1003000;
|
||||
}
|
||||
#endif
|
14
devel/protobuf-c/patches/patch-protoc-c_c_file_h
Normal file
14
devel/protobuf-c/patches/patch-protoc-c_c_file_h
Normal file
|
@ -0,0 +1,14 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_file.h
|
||||
--- protoc-c/c_file.h.orig
|
||||
+++ protoc-c/c_file.h
|
||||
@@ -103,8 +103,6 @@ class FileGenerator {
|
||||
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_;
|
||||
-
|
||||
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator);
|
||||
};
|
||||
|
||||
} // namespace c
|
15
devel/protobuf-c/patches/patch-protoc-c_c_generator_h
Normal file
15
devel/protobuf-c/patches/patch-protoc-c_c_generator_h
Normal file
|
@ -0,0 +1,15 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_generator.h
|
||||
--- protoc-c/c_generator.h.orig
|
||||
+++ protoc-c/c_generator.h
|
||||
@@ -93,9 +93,6 @@ class PROTOC_C_EXPORT CGenerator : public CodeGenerato
|
||||
const std::string& parameter,
|
||||
OutputDirectory* output_directory,
|
||||
std::string* error) const;
|
||||
-
|
||||
- private:
|
||||
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CGenerator);
|
||||
};
|
||||
|
||||
} // namespace c
|
42
devel/protobuf-c/patches/patch-protoc-c_c_helpers_h
Normal file
42
devel/protobuf-c/patches/patch-protoc-c_c_helpers_h
Normal file
|
@ -0,0 +1,42 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_helpers.h
|
||||
--- protoc-c/c_helpers.h.orig
|
||||
+++ protoc-c/c_helpers.h
|
||||
@@ -70,6 +70,10 @@
|
||||
#include <protobuf-c/protobuf-c.pb.h>
|
||||
#include <google/protobuf/io/printer.h>
|
||||
|
||||
+#if GOOGLE_PROTOBUF_VERSION >= 4023000
|
||||
+# include <google/protobuf/descriptor_legacy.h>
|
||||
+#endif
|
||||
+
|
||||
namespace google {
|
||||
namespace protobuf {
|
||||
namespace compiler {
|
||||
@@ -172,11 +176,25 @@ int compare_name_indices_by_name(const void*, const vo
|
||||
// This wrapper is needed to be able to compile against protobuf2.
|
||||
inline int FieldSyntax(const FieldDescriptor* field) {
|
||||
#ifdef HAVE_PROTO3
|
||||
+# if GOOGLE_PROTOBUF_VERSION >= 4023000
|
||||
+ return FileDescriptorLegacy(field->file()).syntax() == FileDescriptorLegacy::SYNTAX_PROTO3 ? 3 : 2;
|
||||
+# else
|
||||
return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ? 3 : 2;
|
||||
+# endif
|
||||
#else
|
||||
return 2;
|
||||
#endif
|
||||
}
|
||||
+
|
||||
+// Work around changes in protobuf >= 22.x without breaking compilation against
|
||||
+// older protobuf versions.
|
||||
+#if GOOGLE_PROTOBUF_VERSION >= 4022000
|
||||
+# define GOOGLE_ARRAYSIZE ABSL_ARRAYSIZE
|
||||
+# define GOOGLE_CHECK_EQ ABSL_CHECK_EQ
|
||||
+# define GOOGLE_CHECK_EQ ABSL_CHECK_EQ
|
||||
+# define GOOGLE_DCHECK_GE ABSL_DCHECK_GE
|
||||
+# define GOOGLE_LOG ABSL_LOG
|
||||
+#endif
|
||||
|
||||
} // namespace c
|
||||
} // namespace compiler
|
23
devel/protobuf-c/patches/patch-protoc-c_c_message_cc
Normal file
23
devel/protobuf-c/patches/patch-protoc-c_c_message_cc
Normal file
|
@ -0,0 +1,23 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_message.cc
|
||||
--- protoc-c/c_message.cc.orig
|
||||
+++ protoc-c/c_message.cc
|
||||
@@ -499,7 +499,7 @@ GenerateMessageDescriptor(io::Printer* printer, bool g
|
||||
// NOTE: not supported by protobuf
|
||||
vars["maybe_static"] = "";
|
||||
vars["field_dv_ctype"] = "{ ... }";
|
||||
- GOOGLE_LOG(DFATAL) << "Messages can't have default values!";
|
||||
+ GOOGLE_LOG(FATAL) << "Messages can't have default values!";
|
||||
break;
|
||||
case FieldDescriptor::CPPTYPE_STRING:
|
||||
if (fd->type() == FieldDescriptor::TYPE_BYTES || opt.string_as_bytes())
|
||||
@@ -521,7 +521,7 @@ GenerateMessageDescriptor(io::Printer* printer, bool g
|
||||
break;
|
||||
}
|
||||
default:
|
||||
- GOOGLE_LOG(DFATAL) << "Unknown CPPTYPE";
|
||||
+ GOOGLE_LOG(FATAL) << "Unknown CPPTYPE";
|
||||
break;
|
||||
}
|
||||
if (!already_defined)
|
16
devel/protobuf-c/patches/patch-protoc-c_c_message_field_h
Normal file
16
devel/protobuf-c/patches/patch-protoc-c_c_message_field_h
Normal file
|
@ -0,0 +1,16 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_message_field.h
|
||||
--- protoc-c/c_message_field.h.orig
|
||||
+++ protoc-c/c_message_field.h
|
||||
@@ -82,10 +82,6 @@ class MessageFieldGenerator : public FieldGenerator {
|
||||
void GenerateDescriptorInitializer(io::Printer* printer) const;
|
||||
std::string GetDefaultValue(void) const;
|
||||
void GenerateStaticInit(io::Printer* printer) const;
|
||||
-
|
||||
- private:
|
||||
-
|
||||
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFieldGenerator);
|
||||
};
|
||||
|
||||
|
14
devel/protobuf-c/patches/patch-protoc-c_c_message_h
Normal file
14
devel/protobuf-c/patches/patch-protoc-c_c_message_h
Normal file
|
@ -0,0 +1,14 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_message.h
|
||||
--- protoc-c/c_message.h.orig
|
||||
+++ protoc-c/c_message.h
|
||||
@@ -136,8 +136,6 @@ class MessageGenerator {
|
||||
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);
|
||||
};
|
||||
|
||||
} // namespace c
|
14
devel/protobuf-c/patches/patch-protoc-c_c_primitive_field_cc
Normal file
14
devel/protobuf-c/patches/patch-protoc-c_c_primitive_field_cc
Normal file
|
@ -0,0 +1,14 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_primitive_field.cc
|
||||
--- protoc-c/c_primitive_field.cc.orig
|
||||
+++ protoc-c/c_primitive_field.cc
|
||||
@@ -143,7 +143,7 @@ std::string PrimitiveFieldGenerator::GetDefaultValue()
|
||||
case FieldDescriptor::CPPTYPE_BOOL:
|
||||
return descriptor_->default_value_bool() ? "1" : "0";
|
||||
default:
|
||||
- GOOGLE_LOG(DFATAL) << "unexpected CPPTYPE in c_primitive_field";
|
||||
+ GOOGLE_LOG(FATAL) << "unexpected CPPTYPE in c_primitive_field";
|
||||
return "UNEXPECTED_CPPTYPE";
|
||||
}
|
||||
}
|
16
devel/protobuf-c/patches/patch-protoc-c_c_primitive_field_h
Normal file
16
devel/protobuf-c/patches/patch-protoc-c_c_primitive_field_h
Normal file
|
@ -0,0 +1,16 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_primitive_field.h
|
||||
--- protoc-c/c_primitive_field.h.orig
|
||||
+++ protoc-c/c_primitive_field.h
|
||||
@@ -82,10 +82,6 @@ class PrimitiveFieldGenerator : public FieldGenerator
|
||||
void GenerateDescriptorInitializer(io::Printer* printer) const;
|
||||
std::string GetDefaultValue(void) const;
|
||||
void GenerateStaticInit(io::Printer* printer) const;
|
||||
-
|
||||
- private:
|
||||
-
|
||||
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PrimitiveFieldGenerator);
|
||||
};
|
||||
|
||||
} // namespace c
|
14
devel/protobuf-c/patches/patch-protoc-c_c_service_h
Normal file
14
devel/protobuf-c/patches/patch-protoc-c_c_service_h
Normal file
|
@ -0,0 +1,14 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_service.h
|
||||
--- protoc-c/c_service.h.orig
|
||||
+++ protoc-c/c_service.h
|
||||
@@ -100,8 +100,6 @@ class ServiceGenerator {
|
||||
|
||||
const ServiceDescriptor* descriptor_;
|
||||
std::map<std::string, std::string> vars_;
|
||||
-
|
||||
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceGenerator);
|
||||
};
|
||||
|
||||
} // namespace c
|
14
devel/protobuf-c/patches/patch-protoc-c_c_string_field_h
Normal file
14
devel/protobuf-c/patches/patch-protoc-c_c_string_field_h
Normal file
|
@ -0,0 +1,14 @@
|
|||
https://github.com/protobuf-c/protobuf-c/pull/673
|
||||
|
||||
Index: protoc-c/c_string_field.h
|
||||
--- protoc-c/c_string_field.h.orig
|
||||
+++ protoc-c/c_string_field.h
|
||||
@@ -87,8 +87,6 @@ class StringFieldGenerator : public FieldGenerator {
|
||||
|
||||
private:
|
||||
std::map<std::string, std::string> variables_;
|
||||
-
|
||||
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StringFieldGenerator);
|
||||
};
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue