pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/protobuf-c



Module Name:    pkgsrc
Committed By:   adam
Date:           Sun Apr  7 20:53:13 UTC 2024

Modified Files:
        pkgsrc/devel/protobuf-c: distinfo
Added Files:
        pkgsrc/devel/protobuf-c/patches: patch-protoc-c_c__file.cc
            patch-protoc-c_c__generator.h patch-protoc-c_c__helpers.h

Log Message:
protobuf-c: make it build with protobuf 26


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 pkgsrc/devel/protobuf-c/distinfo
cvs rdiff -u -r0 -r1.5 \
    pkgsrc/devel/protobuf-c/patches/patch-protoc-c_c__file.cc
cvs rdiff -u -r0 -r1.3 \
    pkgsrc/devel/protobuf-c/patches/patch-protoc-c_c__generator.h \
    pkgsrc/devel/protobuf-c/patches/patch-protoc-c_c__helpers.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/protobuf-c/distinfo
diff -u pkgsrc/devel/protobuf-c/distinfo:1.14 pkgsrc/devel/protobuf-c/distinfo:1.15
--- pkgsrc/devel/protobuf-c/distinfo:1.14       Sun Nov 26 06:06:28 2023
+++ pkgsrc/devel/protobuf-c/distinfo    Sun Apr  7 20:53:13 2024
@@ -1,5 +1,8 @@
-$NetBSD: distinfo,v 1.14 2023/11/26 06:06:28 wiz Exp $
+$NetBSD: distinfo,v 1.15 2024/04/07 20:53:13 adam Exp $
 
 BLAKE2s (protobuf-c-1.5.0.tar.gz) = 7f89b0a27fe78e2bd91b67013315845a236dd9787121a7c5f1989850639e9573
 SHA512 (protobuf-c-1.5.0.tar.gz) = 175c9fc901cab88308730eea982dd62b1e0decdceb80aa53be163f17a440b4acecb834a784beab5cd71186413a322a323f4539758a8727ca51801cf92f9bd3da
 Size (protobuf-c-1.5.0.tar.gz) = 507251 bytes
+SHA1 (patch-protoc-c_c__file.cc) = fc3343b738a546f0c9bb6bb15c97b1dc45e19d49
+SHA1 (patch-protoc-c_c__generator.h) = cbee34577efdc2e366c3db0113d66ae2281efc66
+SHA1 (patch-protoc-c_c__helpers.h) = 69ecf6cdf3f76bab88b6509ba82ac1733131b679

Added files:

Index: pkgsrc/devel/protobuf-c/patches/patch-protoc-c_c__file.cc
diff -u /dev/null pkgsrc/devel/protobuf-c/patches/patch-protoc-c_c__file.cc:1.5
--- /dev/null   Sun Apr  7 20:53:13 2024
+++ pkgsrc/devel/protobuf-c/patches/patch-protoc-c_c__file.cc   Sun Apr  7 20:53:13 2024
@@ -0,0 +1,23 @@
+$NetBSD: patch-protoc-c_c__file.cc,v 1.5 2024/04/07 20:53:13 adam Exp $
+
+Chase compatibility issues with Google protobuf 26.0
+https://github.com/protobuf-c/protobuf-c/pull/711
+
+--- protoc-c/c_file.cc.orig    2024-04-07 20:32:42.583909649 +0000
++++ protoc-c/c_file.cc
+@@ -117,14 +117,7 @@ FileGenerator::~FileGenerator() {}
+ void FileGenerator::GenerateHeader(io::Printer* printer) {
+   std::string filename_identifier = FilenameIdentifier(file_->name());
+ 
+-  int min_header_version = 1000000;
+-#if GOOGLE_PROTOBUF_VERSION >= 4023000
+-  if (FileDescriptorLegacy(file_).syntax() == FileDescriptorLegacy::SYNTAX_PROTO3) {
+-#else
+-  if (file_->syntax() == FileDescriptor::SYNTAX_PROTO3) {
+-#endif
+-    min_header_version = 1003000;
+-  }
++  const int min_header_version = 1003000;
+ 
+   // Generate top of header.
+   printer->Print(

Index: pkgsrc/devel/protobuf-c/patches/patch-protoc-c_c__generator.h
diff -u /dev/null pkgsrc/devel/protobuf-c/patches/patch-protoc-c_c__generator.h:1.3
--- /dev/null   Sun Apr  7 20:53:13 2024
+++ pkgsrc/devel/protobuf-c/patches/patch-protoc-c_c__generator.h       Sun Apr  7 20:53:13 2024
@@ -0,0 +1,20 @@
+$NetBSD: patch-protoc-c_c__generator.h,v 1.3 2024/04/07 20:53:13 adam Exp $
+
+Chase compatibility issues with Google protobuf 26.0
+https://github.com/protobuf-c/protobuf-c/pull/711
+
+--- protoc-c/c_generator.h.orig        2024-04-07 20:33:52.951908700 +0000
++++ protoc-c/c_generator.h
+@@ -93,6 +93,12 @@ class PROTOC_C_EXPORT CGenerator : publi
+                 const std::string& parameter,
+                 OutputDirectory* output_directory,
+                 std::string* error) const;
++
++#if GOOGLE_PROTOBUF_VERSION >= 5026000
++  uint64_t GetSupportedFeatures() const { return CodeGenerator::FEATURE_SUPPORTS_EDITIONS; }
++  Edition GetMinimumEdition() const { return Edition::EDITION_PROTO2; }
++  Edition GetMaximumEdition() const { return Edition::EDITION_PROTO3; }
++#endif
+ };
+ 
+ }  // namespace c
Index: pkgsrc/devel/protobuf-c/patches/patch-protoc-c_c__helpers.h
diff -u /dev/null pkgsrc/devel/protobuf-c/patches/patch-protoc-c_c__helpers.h:1.3
--- /dev/null   Sun Apr  7 20:53:13 2024
+++ pkgsrc/devel/protobuf-c/patches/patch-protoc-c_c__helpers.h Sun Apr  7 20:53:13 2024
@@ -0,0 +1,46 @@
+$NetBSD: patch-protoc-c_c__helpers.h,v 1.3 2024/04/07 20:53:13 adam Exp $
+
+Chase compatibility issues with Google protobuf 26.0
+https://github.com/protobuf-c/protobuf-c/pull/711
+
+--- protoc-c/c_helpers.h.orig  2024-04-07 20:35:11.315221523 +0000
++++ protoc-c/c_helpers.h
+@@ -70,10 +70,6 @@
+ #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 {
+@@ -173,13 +169,21 @@ struct NameIndex
+ int compare_name_indices_by_name(const void*, const void*);
+ 
+ // Return the syntax version of the file containing the field.
+-// This wrapper is needed to be able to compile against protobuf2.
+ inline int FieldSyntax(const FieldDescriptor* field) {
+-#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
++  auto proto = FileDescriptorProto();
++  field->file()->CopyTo(&proto);
++
++  if (proto.has_syntax()) {
++    auto syntax = proto.syntax();
++    assert(syntax == "proto2" || syntax == "proto3");
++    if (syntax == "proto2") {
++      return 2;
++    } else if (syntax == "proto3") {
++      return 3;
++    }
++  }
++
++  return 2;
+ }
+ 
+ // Work around changes in protobuf >= 22.x without breaking compilation against



Home | Main Index | Thread Index | Old Index