Authentication-Results: name.execsw.org; dkim=pass (1024-bit key) header.d=netbsd.org header.i=@netbsd.org header.b=pkl8tBnb; dkim=pass (1024-bit key) header.d=netbsd.org header.i=@netbsd.org header.b=IM6wg9Kq Received: by mail.netbsd.org (Postfix, from userid 605) id AF40384F57; Sun, 7 Apr 2024 20:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org; s=20240131; t=1712523195; bh=a+s+gQl++U6I852ft08G9INyVkOuUni8Q4zxVqRK/Jg=; h=Date:From:Subject:To:Reply-To:List-Id:List-Unsubscribe; b=pkl8tBnbapI886eGGhkPe0En1UwzKO7J4OSORjYayNNDcB3ntST1NIVJJrYTySK4S arHGHNiekqhQyzpzy32UPeFWbHb7OAVUtr0pRAJ1cW/F63aMgBO0IcgHJQwSg9mU6r ghYFm41B18NdQL++hxuyIfrkfuBH7jug0IiFK+tY= Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 9CC6584F56 for ; Sun, 7 Apr 2024 20:53:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Authentication-Results: mail.netbsd.org (amavisd-new); dkim=pass (1024-bit key) header.d=netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id FJo3o_ke8bTd for ; Sun, 7 Apr 2024 20:53:13 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id ACA8984D50 for ; Sun, 7 Apr 2024 20:53:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org; s=20240131; t=1712523193; bh=a+s+gQl++U6I852ft08G9INyVkOuUni8Q4zxVqRK/Jg=; h=Date:From:Subject:To:Reply-To; b=IM6wg9Kq7KOGf85LZT1TWknDz+iHmV5z0SCh5lWxk7AEsTOuzqQUkGVAJTAb3qesF lNVd1HJN5xi6XlC+OytMT+ZxvKuA97VotGDJP5E73xsbBlR3EVW0EOlbNVDqMjQBfE E25HBOC7IRP9Va+ZpiBc4gzjk86hGxmVWbiBz0qU= Received: by cvs.NetBSD.org (Postfix, from userid 500) id 9D339FA2C; Sun, 7 Apr 2024 20:53:13 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_171252319343530" MIME-Version: 1.0 Date: Sun, 7 Apr 2024 20:53:13 +0000 From: "Adam Ciarcinski" Subject: CVS commit: pkgsrc/devel/protobuf-c To: pkgsrc-changes@NetBSD.org Reply-To: adam@netbsd.org X-Mailer: log_accum Message-Id: <20240407205313.9D339FA2C@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_171252319343530 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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. --_----------=_171252319343530 Content-Disposition: inline Content-Length: 5027 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii 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 + #include + +-#if GOOGLE_PROTOBUF_VERSION >= 4023000 +-# include +-#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 --_----------=_171252319343530--