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: wiz
Date: Thu Apr 9 07:44:37 UTC 2026
Modified Files:
pkgsrc/devel/protobuf-c: Makefile distinfo
Added Files:
pkgsrc/devel/protobuf-c/patches: patch-protoc-gen-c_c__bytes__field.cc
patch-protoc-gen-c_c__enum__field.cc patch-protoc-gen-c_c__field.cc
patch-protoc-gen-c_c__helpers.cc patch-protoc-gen-c_c__helpers.h
patch-protoc-gen-c_c__message__field.cc
patch-protoc-gen-c_c__primitive__field.cc
patch-protoc-gen-c_c__string__field.cc
Log Message:
protobuf-c: fix build with protobuf 34
Using upstream pull request.
Bump PKGREVISION.
To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 pkgsrc/devel/protobuf-c/Makefile
cvs rdiff -u -r1.18 -r1.19 pkgsrc/devel/protobuf-c/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__bytes__field.cc \
pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__enum__field.cc \
pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__field.cc \
pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__helpers.cc \
pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__helpers.h \
pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__message__field.cc \
pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__primitive__field.cc \
pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__string__field.cc
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/Makefile
diff -u pkgsrc/devel/protobuf-c/Makefile:1.33 pkgsrc/devel/protobuf-c/Makefile:1.34
--- pkgsrc/devel/protobuf-c/Makefile:1.33 Wed Jan 14 12:57:33 2026
+++ pkgsrc/devel/protobuf-c/Makefile Thu Apr 9 07:44:36 2026
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.33 2026/01/14 12:57:33 wiz Exp $
+# $NetBSD: Makefile,v 1.34 2026/04/09 07:44:36 wiz Exp $
DISTNAME= protobuf-c-1.5.2
-PKGREVISION= 2
+PKGREVISION= 3
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GITHUB:=protobuf-c/}
GITHUB_RELEASE= v${PKGVERSION_NOREV}
Index: pkgsrc/devel/protobuf-c/distinfo
diff -u pkgsrc/devel/protobuf-c/distinfo:1.18 pkgsrc/devel/protobuf-c/distinfo:1.19
--- pkgsrc/devel/protobuf-c/distinfo:1.18 Sat Jul 5 19:37:19 2025
+++ pkgsrc/devel/protobuf-c/distinfo Thu Apr 9 07:44:36 2026
@@ -1,5 +1,13 @@
-$NetBSD: distinfo,v 1.18 2025/07/05 19:37:19 wiz Exp $
+$NetBSD: distinfo,v 1.19 2026/04/09 07:44:36 wiz Exp $
BLAKE2s (protobuf-c-1.5.2.tar.gz) = f453f232acaa3955f1ae45c81baee9b35eb81cdd83130a7e6b47a7f02f79d8d6
SHA512 (protobuf-c-1.5.2.tar.gz) = 78dc72988d7e8232c1b967849aa00939bc05ab7d39b86a8e2af005e38aa4ef4c9b03920d51fb5337399d980e65f35d11bd4742bea745a893ecc909f56a51c9ac
Size (protobuf-c-1.5.2.tar.gz) = 532447 bytes
+SHA1 (patch-protoc-gen-c_c__bytes__field.cc) = 061d11e1c14e6f417c9775bf16328a83e7ec2881
+SHA1 (patch-protoc-gen-c_c__enum__field.cc) = 8716ecffd84863ce95c0ce958e1684cf8520ac53
+SHA1 (patch-protoc-gen-c_c__field.cc) = 8b91b5a13e91b24c9c333e9c2a80fa0bbe198065
+SHA1 (patch-protoc-gen-c_c__helpers.cc) = c8cdec1d348a7577867875ae3838847138329573
+SHA1 (patch-protoc-gen-c_c__helpers.h) = 4c9aeade35d82b8b4123aa5eac182ddab2fb5097
+SHA1 (patch-protoc-gen-c_c__message__field.cc) = d3da3223c194afaab0d01be6ed3c06787c04f719
+SHA1 (patch-protoc-gen-c_c__primitive__field.cc) = 20993f30637a9558fd4d1daba3ab1658d7077672
+SHA1 (patch-protoc-gen-c_c__string__field.cc) = cd53868b41061719cb4481eec095bb5e905e97bf
Added files:
Index: pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__bytes__field.cc
diff -u /dev/null pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__bytes__field.cc:1.1
--- /dev/null Thu Apr 9 07:44:37 2026
+++ pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__bytes__field.cc Thu Apr 9 07:44:36 2026
@@ -0,0 +1,25 @@
+$NetBSD: patch-protoc-gen-c_c__bytes__field.cc,v 1.1 2026/04/09 07:44:36 wiz Exp $
+
+Fix build with protobuf 34.
+https://github.com/protobuf-c/protobuf-c/pull/797
+
+--- protoc-gen-c/c_bytes_field.cc.orig 2025-02-02 04:19:55.000000000 +0000
++++ protoc-gen-c/c_bytes_field.cc
+@@ -94,7 +94,7 @@ void BytesFieldGenerator::GenerateStructMembers(google
+
+ void BytesFieldGenerator::GenerateStructMembers(google::protobuf::io::Printer* printer) const
+ {
+- switch (descriptor_->label()) {
++ switch (FieldLabel(descriptor_)) {
+ case google::protobuf::FieldDescriptor::LABEL_REQUIRED:
+ printer->Print(variables_, "ProtobufCBinaryData $name$$deprecated$;\n");
+ break;
+@@ -135,7 +135,7 @@ void BytesFieldGenerator::GenerateStaticInit(google::p
+ }
+ void BytesFieldGenerator::GenerateStaticInit(google::protobuf::io::Printer* printer) const
+ {
+- switch (descriptor_->label()) {
++ switch (FieldLabel(descriptor_)) {
+ case google::protobuf::FieldDescriptor::LABEL_REQUIRED:
+ printer->Print(variables_, "$default_value$");
+ break;
Index: pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__enum__field.cc
diff -u /dev/null pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__enum__field.cc:1.1
--- /dev/null Thu Apr 9 07:44:37 2026
+++ pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__enum__field.cc Thu Apr 9 07:44:36 2026
@@ -0,0 +1,25 @@
+$NetBSD: patch-protoc-gen-c_c__enum__field.cc,v 1.1 2026/04/09 07:44:36 wiz Exp $
+
+Fix build with protobuf 34.
+https://github.com/protobuf-c/protobuf-c/pull/797
+
+--- protoc-gen-c/c_enum_field.cc.orig 2025-04-07 01:17:27.000000000 +0000
++++ protoc-gen-c/c_enum_field.cc
+@@ -95,7 +95,7 @@ void EnumFieldGenerator::GenerateStructMembers(google:
+
+ void EnumFieldGenerator::GenerateStructMembers(google::protobuf::io::Printer* printer) const
+ {
+- switch (descriptor_->label()) {
++ switch (FieldLabel(descriptor_)) {
+ case google::protobuf::FieldDescriptor::LABEL_REQUIRED:
+ printer->Print(variables_, "$type$ $name$$deprecated$;\n");
+ break;
+@@ -117,7 +117,7 @@ void EnumFieldGenerator::GenerateStaticInit(google::pr
+ }
+ void EnumFieldGenerator::GenerateStaticInit(google::protobuf::io::Printer* printer) const
+ {
+- switch (descriptor_->label()) {
++ switch (FieldLabel(descriptor_)) {
+ case google::protobuf::FieldDescriptor::LABEL_REQUIRED:
+ printer->Print(variables_, "$default$");
+ break;
Index: pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__field.cc
diff -u /dev/null pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__field.cc:1.1
--- /dev/null Thu Apr 9 07:44:37 2026
+++ pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__field.cc Thu Apr 9 07:44:36 2026
@@ -0,0 +1,44 @@
+$NetBSD: patch-protoc-gen-c_c__field.cc,v 1.1 2026/04/09 07:44:36 wiz Exp $
+
+Fix build with protobuf 34.
+https://github.com/protobuf-c/protobuf-c/pull/797
+
+--- protoc-gen-c/c_field.cc.orig 2025-04-07 01:17:27.000000000 +0000
++++ protoc-gen-c/c_field.cc
+@@ -125,11 +125,11 @@ void FieldGenerator::GenerateDescriptorInitializerGene
+ variables["oneofname"] = CamelToLower(oneof->name());
+
+ if (FieldSyntax(descriptor_) == 3 &&
+- descriptor_->label() == google::protobuf::FieldDescriptor::LABEL_OPTIONAL) {
++ FieldLabel(descriptor_) == google::protobuf::FieldDescriptor::LABEL_OPTIONAL) {
+ variables["LABEL"] = "NONE";
+ optional_uses_has = false;
+ } else {
+- variables["LABEL"] = CamelToUpper(GetLabelName(descriptor_->label()));
++ variables["LABEL"] = CamelToUpper(GetLabelName(FieldLabel(descriptor_)));
+ }
+
+ if (descriptor_->has_default_value()) {
+@@ -145,11 +145,11 @@ void FieldGenerator::GenerateDescriptorInitializerGene
+
+ variables["flags"] = "0";
+
+- if (descriptor_->label() == google::protobuf::FieldDescriptor::LABEL_REPEATED
++ if (FieldLabel(descriptor_) == google::protobuf::FieldDescriptor::LABEL_REPEATED
+ && is_packable_type (descriptor_->type())
+ && descriptor_->options().packed()) {
+ variables["flags"] += " | PROTOBUF_C_FIELD_FLAG_PACKED";
+- } else if (descriptor_->label() == google::protobuf::FieldDescriptor::LABEL_REPEATED
++ } else if (FieldLabel(descriptor_) == google::protobuf::FieldDescriptor::LABEL_REPEATED
+ && is_packable_type (descriptor_->type())
+ && FieldSyntax(descriptor_) == 3
+ && !descriptor_->options().has_packed()) {
+@@ -179,7 +179,7 @@ void FieldGenerator::GenerateDescriptorInitializerGene
+ " $value$,\n"
+ " PROTOBUF_C_LABEL_$LABEL$,\n"
+ " PROTOBUF_C_TYPE_$TYPE$,\n");
+- switch (descriptor_->label()) {
++ switch (FieldLabel(descriptor_)) {
+ case google::protobuf::FieldDescriptor::LABEL_REQUIRED:
+ printer->Print(variables, " 0, /* quantifier_offset */\n");
+ break;
Index: pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__helpers.cc
diff -u /dev/null pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__helpers.cc:1.1
--- /dev/null Thu Apr 9 07:44:37 2026
+++ pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__helpers.cc Thu Apr 9 07:44:36 2026
@@ -0,0 +1,25 @@
+$NetBSD: patch-protoc-gen-c_c__helpers.cc,v 1.1 2026/04/09 07:44:36 wiz Exp $
+
+Fix build with protobuf 34.
+https://github.com/protobuf-c/protobuf-c/pull/797
+
+--- protoc-gen-c/c_helpers.cc.orig 2025-04-07 01:17:27.000000000 +0000
++++ protoc-gen-c/c_helpers.cc
+@@ -338,6 +338,17 @@ std::string GetLabelName(google::protobuf::FieldDescri
+ return "bad-label";
+ }
+
++google::protobuf::FieldDescriptor::Label FieldLabel(
++ const google::protobuf::FieldDescriptor* field) {
++ if (field->is_repeated()) {
++ return google::protobuf::FieldDescriptor::LABEL_REPEATED;
++ }
++ if (field->is_required()) {
++ return google::protobuf::FieldDescriptor::LABEL_REQUIRED;
++ }
++ return google::protobuf::FieldDescriptor::LABEL_OPTIONAL;
++}
++
+ unsigned
+ WriteIntRanges(google::protobuf::io::Printer* printer, int n_values, const int *values, compat::StringView name)
+ {
Index: pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__helpers.h
diff -u /dev/null pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__helpers.h:1.1
--- /dev/null Thu Apr 9 07:44:37 2026
+++ pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__helpers.h Thu Apr 9 07:44:36 2026
@@ -0,0 +1,19 @@
+$NetBSD: patch-protoc-gen-c_c__helpers.h,v 1.1 2026/04/09 07:44:36 wiz Exp $
+
+Fix build with protobuf 34.
+https://github.com/protobuf-c/protobuf-c/pull/797
+
+--- protoc-gen-c/c_helpers.h.orig 2025-04-07 01:17:27.000000000 +0000
++++ protoc-gen-c/c_helpers.h
+@@ -153,6 +153,11 @@ std::string GetLabelName(google::protobuf::FieldDescri
+ // return 'required', 'optional', or 'repeated'
+ std::string GetLabelName(google::protobuf::FieldDescriptor::Label label);
+
++// Returns the field label in a way that is compatible with protobuf versions
++// where FieldDescriptor::label() is unavailable.
++google::protobuf::FieldDescriptor::Label FieldLabel(
++ const google::protobuf::FieldDescriptor* field);
++
+ // write IntRanges entries for a bunch of sorted values.
+ // returns the number of ranges there are to bsearch.
+ unsigned WriteIntRanges(google::protobuf::io::Printer* printer, int n_values, const int *values, compat::StringView name);
Index: pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__message__field.cc
diff -u /dev/null pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__message__field.cc:1.1
--- /dev/null Thu Apr 9 07:44:37 2026
+++ pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__message__field.cc Thu Apr 9 07:44:36 2026
@@ -0,0 +1,25 @@
+$NetBSD: patch-protoc-gen-c_c__message__field.cc,v 1.1 2026/04/09 07:44:36 wiz Exp $
+
+Fix build with protobuf 34.
+https://github.com/protobuf-c/protobuf-c/pull/797
+
+--- protoc-gen-c/c_message_field.cc.orig 2025-02-02 04:19:55.000000000 +0000
++++ protoc-gen-c/c_message_field.cc
+@@ -83,7 +83,7 @@ void MessageFieldGenerator::GenerateStructMembers(goog
+ vars["name"] = FieldName(descriptor_);
+ vars["type"] = FullNameToC(descriptor_->message_type()->full_name(), descriptor_->message_type()->file());
+ vars["deprecated"] = FieldDeprecated(descriptor_);
+- switch (descriptor_->label()) {
++ switch (FieldLabel(descriptor_)) {
+ case google::protobuf::FieldDescriptor::LABEL_REQUIRED:
+ case google::protobuf::FieldDescriptor::LABEL_OPTIONAL:
+ printer->Print(vars, "$type$ *$name$$deprecated$;\n");
+@@ -103,7 +103,7 @@ void MessageFieldGenerator::GenerateStaticInit(google:
+ }
+ void MessageFieldGenerator::GenerateStaticInit(google::protobuf::io::Printer* printer) const
+ {
+- switch (descriptor_->label()) {
++ switch (FieldLabel(descriptor_)) {
+ case google::protobuf::FieldDescriptor::LABEL_REQUIRED:
+ case google::protobuf::FieldDescriptor::LABEL_OPTIONAL:
+ printer->Print("NULL");
Index: pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__primitive__field.cc
diff -u /dev/null pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__primitive__field.cc:1.1
--- /dev/null Thu Apr 9 07:44:37 2026
+++ pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__primitive__field.cc Thu Apr 9 07:44:36 2026
@@ -0,0 +1,25 @@
+$NetBSD: patch-protoc-gen-c_c__primitive__field.cc,v 1.1 2026/04/09 07:44:36 wiz Exp $
+
+Fix build with protobuf 34.
+https://github.com/protobuf-c/protobuf-c/pull/797
+
+--- protoc-gen-c/c_primitive_field.cc.orig 2025-04-07 01:17:27.000000000 +0000
++++ protoc-gen-c/c_primitive_field.cc
+@@ -109,7 +109,7 @@ void PrimitiveFieldGenerator::GenerateStructMembers(go
+ vars["name"] = FieldName(descriptor_);
+ vars["deprecated"] = FieldDeprecated(descriptor_);
+
+- switch (descriptor_->label()) {
++ switch (FieldLabel(descriptor_)) {
+ case google::protobuf::FieldDescriptor::LABEL_REQUIRED:
+ printer->Print(vars, "$c_type$ $name$$deprecated$;\n");
+ break;
+@@ -156,7 +156,7 @@ void PrimitiveFieldGenerator::GenerateStaticInit(googl
+ } else {
+ vars["default_value"] = "0";
+ }
+- switch (descriptor_->label()) {
++ switch (FieldLabel(descriptor_)) {
+ case google::protobuf::FieldDescriptor::LABEL_REQUIRED:
+ printer->Print(vars, "$default_value$");
+ break;
Index: pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__string__field.cc
diff -u /dev/null pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__string__field.cc:1.1
--- /dev/null Thu Apr 9 07:44:37 2026
+++ pkgsrc/devel/protobuf-c/patches/patch-protoc-gen-c_c__string__field.cc Thu Apr 9 07:44:36 2026
@@ -0,0 +1,25 @@
+$NetBSD: patch-protoc-gen-c_c__string__field.cc,v 1.1 2026/04/09 07:44:36 wiz Exp $
+
+Fix build with protobuf 34.
+https://github.com/protobuf-c/protobuf-c/pull/797
+
+--- protoc-gen-c/c_string_field.cc.orig 2025-02-02 04:19:55.000000000 +0000
++++ protoc-gen-c/c_string_field.cc
+@@ -94,7 +94,7 @@ void StringFieldGenerator::GenerateStructMembers(googl
+ {
+ const ProtobufCFileOptions opt = descriptor_->file()->options().GetExtension(pb_c_file);
+
+- switch (descriptor_->label()) {
++ switch (FieldLabel(descriptor_)) {
+ case google::protobuf::FieldDescriptor::LABEL_REQUIRED:
+ case google::protobuf::FieldDescriptor::LABEL_OPTIONAL:
+ if (opt.const_strings())
+@@ -138,7 +138,7 @@ void StringFieldGenerator::GenerateStaticInit(google::
+ } else {
+ vars["default"] = "(char *)protobuf_c_empty_string";
+ }
+- switch (descriptor_->label()) {
++ switch (FieldLabel(descriptor_)) {
+ case google::protobuf::FieldDescriptor::LABEL_REQUIRED:
+ case google::protobuf::FieldDescriptor::LABEL_OPTIONAL:
+ printer->Print(vars, "$default$");
Home |
Main Index |
Thread Index |
Old Index