From 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 14 Jul 2018 21:03:06 +0100 Subject: gentoo resync : 14.07.2018 --- dev-libs/protobuf-c/Manifest | 6 + .../files/protobuf-c-1.3.0-no-build-tests.patch | 30 +++ .../files/protobuf-c-1.3.0-protobuf-3.6.patch | 202 +++++++++++++++++++++ ...-c-1.3.0-restore-protobuf-2-compatibility.patch | 33 ++++ dev-libs/protobuf-c/metadata.xml | 8 + dev-libs/protobuf-c/protobuf-c-1.3.0-r1.ebuild | 45 +++++ 6 files changed, 324 insertions(+) create mode 100644 dev-libs/protobuf-c/Manifest create mode 100644 dev-libs/protobuf-c/files/protobuf-c-1.3.0-no-build-tests.patch create mode 100644 dev-libs/protobuf-c/files/protobuf-c-1.3.0-protobuf-3.6.patch create mode 100644 dev-libs/protobuf-c/files/protobuf-c-1.3.0-restore-protobuf-2-compatibility.patch create mode 100644 dev-libs/protobuf-c/metadata.xml create mode 100644 dev-libs/protobuf-c/protobuf-c-1.3.0-r1.ebuild (limited to 'dev-libs/protobuf-c') diff --git a/dev-libs/protobuf-c/Manifest b/dev-libs/protobuf-c/Manifest new file mode 100644 index 000000000000..f0b3aa285885 --- /dev/null +++ b/dev-libs/protobuf-c/Manifest @@ -0,0 +1,6 @@ +AUX protobuf-c-1.3.0-no-build-tests.patch 1020 BLAKE2B adda0e4764283d00093709bc97500187521c1d099c6a057513cd4c4ab3b595479f62e7f90bc28ee062f7cae8a760445c78334468f25291320b74d46a5bb454cc SHA512 c6b6f37d8d0fb1ac14e650cc521034267b0af06525249078cc81fc8a3d551dc446bb5285228ca349ce18581979ea88eb9765233154cfbbedd8c4a937987d2684 +AUX protobuf-c-1.3.0-protobuf-3.6.patch 7730 BLAKE2B e1647b88490f55aae206218ef5f6b7f466162a27bcbb9b6ad752e8819bc8c99e56849931b2899d807ed0da31efdf66b2f24a5a1f810b3ddc365ddc4fcc507760 SHA512 f7b0d5b3d2ca52b38c2283eb27cafb6030bce8d86c3b4d61ef07763cfc9df87f58b5f308bbf481e3fc03ad5e5528d96f542e9d689706d0bac111e7573d6d5170 +AUX protobuf-c-1.3.0-restore-protobuf-2-compatibility.patch 1182 BLAKE2B b05104b82aed8dbe5620cea73d366788355dd7041489ef3994dcdcb9fdc8b1d1265f6a8f8a10b310675fece850f11570210d63b6ce047acbd6968f5a68b6a247 SHA512 82761f41d60ad7ab69f3ca9479593bd25d4d2225b9e6f8b2b4d9f577f0ca36572432b0dc6f94ba8729da87d4b5474b977037fbf5b4dd27c3fda186e7307d8eba +DIST protobuf-c-1.3.0.tar.gz 488443 BLAKE2B 8eca559ad06aaa5cb09984b3d2e7c5767cd341c2e439b94c2d219226c612992808da091d01f5e0ad5f14e47292d4a621037953b58a5bea827e7c22837234ffe6 SHA512 ba49bf45a9ae93d41f200f4f18c4f9469c63fcc2a2392b3b45f083c378a6876891890448ceba216083ad351aa35f4669cd920973f53e5780de9ec4c8f61279bb +EBUILD protobuf-c-1.3.0-r1.ebuild 1012 BLAKE2B 77fb5f79db19f8d814ae0a309e5c0725e4ab25fce3d7ef1ba5db5feed093d0261adb84b3095f563e2e55bf5c07fae08ebae67c1eddf6be52b74a11299fe460ac SHA512 c3d469dd035e0760cb1902bd37ca61de23dcf76fe2107d000755cd52ae8b0576cf7d6d6fc736a128340dcd977267cc3771226eb6c54d1997cb8199d5c874ecb8 +MISC metadata.xml 258 BLAKE2B 4600b6e0e51f9c280726dd71ec122d3c51e0c2b1f8b4ef208a1c9838a01d405bedce2cfd6949bb2dbcc448f76f45c717a630eed98fb9d0ad06c91dafdc2ad288 SHA512 92e3b05f2cf1d2ff09b852d2ad8707f55b4cd3fc78df317fa5234a9c0018405cfad67d90211435963983440228dfb75de28ab7ee62f1a80bb97192768d93ce92 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[descriptor->field_count()]) { ++ new std::unique_ptr[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 > field_generators_; ++ std::unique_ptr[] > 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[file->message_type_count()]), ++ new std::unique_ptr[file->message_type_count()]), + enum_generators_( +- new scoped_ptr[file->enum_type_count()]), ++ new std::unique_ptr[file->enum_type_count()]), + service_generators_( +- new scoped_ptr[file->service_count()]), ++ new std::unique_ptr[file->service_count()]), + extension_generators_( +- new scoped_ptr[file->extension_count()]) { ++ new std::unique_ptr[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 > message_generators_; +- scoped_array > enum_generators_; +- scoped_array > service_generators_; +- scoped_array > extension_generators_; ++ std::unique_ptr[] > message_generators_; ++ std::unique_ptr[] > enum_generators_; ++ std::unique_ptr[] > service_generators_; ++ std::unique_ptr[] > extension_generators_; + + // E.g. if the package is foo.bar, package_parts_ is {"foo", "bar"}. +- vector package_parts_; ++ std::vector 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 >* output) { +- vector parts; ++void ParseOptions(const string& text, std::vector >* output) { ++ std::vector parts; + SplitStringUsing(text, ",", &parts); + + for (unsigned i = 0; i < parts.size(); i++) { + string::size_type equals_pos = parts[i].find_first_of('='); +- pair value; ++ std::pair 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 > options; ++ std::vector > options; + ParseOptions(parameter, &options); + + // ----------------------------------------------------------------- +@@ -149,7 +149,7 @@ + + // Generate header. + { +- scoped_ptr output( ++ std::unique_ptr output( + output_directory->Open(basename + ".h")); + io::Printer printer(output.get(), '$'); + file_generator.GenerateHeader(&printer); +@@ -157,7 +157,7 @@ + + // Generate cc file. + { +- scoped_ptr output( ++ std::unique_ptr 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 pieces; ++ std::vector 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 pieces; ++ std::vector 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 pieces; ++ std::vector pieces; + SplitStringUsing(full_name, ".", &pieces); + string rv = ""; + for (unsigned i = 0; i < pieces.size(); i++) { +@@ -214,7 +214,7 @@ + { + if (!comment.empty()) + { +- vector comment_lines; ++ std::vector 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* result) { +- std::back_insert_iterator< vector > it(*result); ++ std::vector* result) { ++ std::back_insert_iterator< std::vector > 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 dest(new char[dest_length]); ++ std::unique_ptr 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[ ++ nested_generators_(new std::unique_ptr[ + descriptor->nested_type_count()]), +- enum_generators_(new scoped_ptr[ ++ enum_generators_(new std::unique_ptr[ + descriptor->enum_type_count()]), +- extension_generators_(new scoped_ptr[ ++ extension_generators_(new std::unique_ptr[ + 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 > nested_generators_; +- scoped_array > enum_generators_; +- scoped_array > extension_generators_; ++ std::unique_ptr[] > nested_generators_; ++ std::unique_ptr[] > enum_generators_; ++ std::unique_ptr[] > 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 +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( diff --git a/dev-libs/protobuf-c/metadata.xml b/dev-libs/protobuf-c/metadata.xml new file mode 100644 index 000000000000..b15849585db8 --- /dev/null +++ b/dev-libs/protobuf-c/metadata.xml @@ -0,0 +1,8 @@ + + + + + + protobuf-c/protobuf-c + + diff --git a/dev-libs/protobuf-c/protobuf-c-1.3.0-r1.ebuild b/dev-libs/protobuf-c/protobuf-c-1.3.0-r1.ebuild new file mode 100644 index 000000000000..bed34d3628b8 --- /dev/null +++ b/dev-libs/protobuf-c/protobuf-c-1.3.0-r1.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools multilib-minimal + +MY_PV="${PV/_/-}" +MY_P="${PN}-${MY_PV}" + +DESCRIPTION="Protocol Buffers implementation in C" +HOMEPAGE="https://github.com/protobuf-c/protobuf-c" +SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${MY_PV}/${MY_P}.tar.gz" + +LICENSE="BSD-2" +# Subslot == SONAME version +SLOT="0/1.0.0" +KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sparc x86" +IUSE="static-libs test" + +RDEPEND=">=dev-libs/protobuf-2.6.0:0=[${MULTILIB_USEDEP}]" +DEPEND="${RDEPEND} + virtual/pkgconfig[${MULTILIB_USEDEP}]" + +PATCHES=( + "${FILESDIR}/${P}-restore-protobuf-2-compatibility.patch" + "${FILESDIR}/${P}-protobuf-3.6.patch" +) + +S="${WORKDIR}/${MY_P}" + +src_prepare() { + default + if ! use test; then + eapply "${FILESDIR}"/${PN}-1.3.0-no-build-tests.patch + fi + + eautoreconf +} + +multilib_src_configure() { + ECONF_SOURCE="${S}" \ + econf \ + $(use_enable static-libs static) +} -- cgit v1.2.3