Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
Date: Sat, 20 Apr 2019 23:29:04
Message-Id: 1555691947.c9478e3527ea47a3f080c7fabb90ab5a0b0102ea.floppym@gentoo
1 commit: c9478e3527ea47a3f080c7fabb90ab5a0b0102ea
2 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
3 AuthorDate: Thu Apr 18 19:12:09 2019 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 19 16:39:07 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9478e35
7
8 dev-libs/protobuf: Version bump (3.7.1).
9
10 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
11 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
12
13 dev-libs/protobuf/Manifest | 1 +
14 .../protobuf-3.7.0-disable_no-warning-test.patch | 19 ++
15 .../protobuf-3.7.0-protoc_input_output_files.patch | 236 +++++++++++++++++++++
16 .../files/protobuf-3.7.1-system_libraries.patch | 121 +++++++++++
17 dev-libs/protobuf/protobuf-3.7.1.ebuild | 118 +++++++++++
18 5 files changed, 495 insertions(+)
19
20 diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
21 index ac2f8a09268..766a6d89f8d 100644
22 --- a/dev-libs/protobuf/Manifest
23 +++ b/dev-libs/protobuf/Manifest
24 @@ -1 +1,2 @@
25 DIST protobuf-3.6.1.3.tar.gz 4490599 BLAKE2B 5a058f937330bd562e364a8d86e0b1376fdac9fded0fd23d6914cb59c5c15e8bfc1e203ea36b5a4eece8919708c1a9a6616b0ec2028d6ec339704da53ed81963 SHA512 9eadb46c7daa19e612516958169bc90943b38b429a4b2cf2171b66b57f50a2f8a9b66cbf58bdd44517af414b78e0f3ab2e1361891dc60ecd098185da2638d37e
26 +DIST protobuf-3.7.1.tar.gz 4795774 BLAKE2B a91155169623ee24ba49e397b151829321c01ff06bb27541e6c02701c37ac96ea9606961291ef0d4616dd6dba045bf7e893ec6288f5809d30cc026b60ae76590 SHA512 7d4cfabd4bd55926336a3baafa0bc1f1f15380b1b2af945f70a2bb3ba24c6ac6567f49c492326d6d1c43a488166bff178f9266377758a05d8541d8b242f4f80f
27
28 diff --git a/dev-libs/protobuf/files/protobuf-3.7.0-disable_no-warning-test.patch b/dev-libs/protobuf/files/protobuf-3.7.0-disable_no-warning-test.patch
29 new file mode 100644
30 index 00000000000..eadde9c04dc
31 --- /dev/null
32 +++ b/dev-libs/protobuf/files/protobuf-3.7.0-disable_no-warning-test.patch
33 @@ -0,0 +1,19 @@
34 +Disable no-warning-test which is compiled with -Werror option and whose only purpose is checking if compilation results in any warnings.
35 +
36 +--- /src/Makefile.am
37 ++++ /src/Makefile.am
38 +@@ -709,7 +709,7 @@
39 + GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
40 + check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
41 + protobuf-lite-test test_plugin protobuf-lite-arena-test \
42 +- no-warning-test $(GZCHECKPROGRAMS)
43 ++ $(GZCHECKPROGRAMS)
44 + protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
45 + $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
46 + $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
47 +@@ -893,4 +893,4 @@
48 +
49 + TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
50 + google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS) \
51 +- protobuf-lite-arena-test no-warning-test
52 ++ protobuf-lite-arena-test
53
54 diff --git a/dev-libs/protobuf/files/protobuf-3.7.0-protoc_input_output_files.patch b/dev-libs/protobuf/files/protobuf-3.7.0-protoc_input_output_files.patch
55 new file mode 100644
56 index 00000000000..54daa6de4ed
57 --- /dev/null
58 +++ b/dev-libs/protobuf/files/protobuf-3.7.0-protoc_input_output_files.patch
59 @@ -0,0 +1,236 @@
60 +https://github.com/protocolbuffers/protobuf/pull/235
61 +
62 +--- /src/google/protobuf/compiler/command_line_interface.cc
63 ++++ /src/google/protobuf/compiler/command_line_interface.cc
64 +@@ -951,6 +951,28 @@
65 + }
66 +
67 + if (mode_ == MODE_ENCODE || mode_ == MODE_DECODE) {
68 ++ bool success = false;
69 ++ int in_fd = STDIN_FILENO;
70 ++ int out_fd = STDOUT_FILENO;
71 ++
72 ++ if (!protobuf_in_path_.empty()) {
73 ++ in_fd = open(protobuf_in_path_.c_str(), O_RDONLY);
74 ++ if (in_fd == -1) {
75 ++ std::cerr << protobuf_in_path_ << ": error: failed to open file." << std::endl;
76 ++ return 1;
77 ++ }
78 ++ }
79 ++ if (!protobuf_out_path_.empty()) {
80 ++ out_fd = open(protobuf_out_path_.c_str(),
81 ++ O_WRONLY | O_CREAT | O_TRUNC,
82 ++ 0644);
83 ++ if (out_fd == -1) {
84 ++ std::cerr << protobuf_out_path_ << ": error: failed to open file." << std::endl;
85 ++ close(in_fd);
86 ++ return 1;
87 ++ }
88 ++ }
89 ++
90 + if (codec_type_.empty()) {
91 + // HACK: Define an EmptyMessage type to use for decoding.
92 + DescriptorPool pool;
93 +@@ -959,13 +981,20 @@
94 + file.add_message_type()->set_name("EmptyMessage");
95 + GOOGLE_CHECK(pool.BuildFile(file) != NULL);
96 + codec_type_ = "EmptyMessage";
97 +- if (!EncodeOrDecode(&pool)) {
98 +- return 1;
99 +- }
100 ++ success = EncodeOrDecode(&pool, in_fd, out_fd);
101 + } else {
102 +- if (!EncodeOrDecode(descriptor_pool.get())) {
103 +- return 1;
104 +- }
105 ++ success = EncodeOrDecode(descriptor_pool.get(), in_fd, out_fd);
106 ++ }
107 ++
108 ++ if (in_fd != STDIN_FILENO) {
109 ++ close(in_fd);
110 ++ }
111 ++ if (out_fd != STDOUT_FILENO) {
112 ++ close(out_fd);
113 ++ }
114 ++
115 ++ if (!success) {
116 ++ return 1;
117 + }
118 + }
119 +
120 +@@ -1003,6 +1032,11 @@
121 + for (int i = 0; i < proto_path_.size(); i++) {
122 + source_tree->MapPath(proto_path_[i].first, proto_path_[i].second);
123 + }
124 ++ if (mode_ == MODE_COMPILE &&
125 ++ (!protobuf_in_path_.empty() || !protobuf_out_path_.empty())) {
126 ++ std::cerr << "--protobuf_in and --protobuf_out are only valid with "
127 ++ << "decode operations. Ignoring.";
128 ++ }
129 +
130 + // Map input files to virtual paths if possible.
131 + if (!MakeInputsBeProtoPathRelative(source_tree, fallback_database)) {
132 +@@ -1622,6 +1656,12 @@
133 +
134 + codec_type_ = value;
135 +
136 ++ } else if (name == "--protobuf_in") {
137 ++ protobuf_in_path_ = value;
138 ++
139 ++ } else if (name == "--protobuf_out") {
140 ++ protobuf_out_path_ = value;
141 ++
142 + } else if (name == "--error_format") {
143 + if (value == "gcc") {
144 + error_format_ = ERROR_FORMAT_GCC;
145 +@@ -1749,18 +1789,31 @@
146 + " --version Show version info and exit.\n"
147 + " -h, --help Show this text and exit.\n"
148 + " --encode=MESSAGE_TYPE Read a text-format message of the given type\n"
149 +-" from standard input and write it in binary\n"
150 +-" to standard output. The message type must\n"
151 +-" be defined in PROTO_FILES or their imports.\n"
152 +-" --decode=MESSAGE_TYPE Read a binary message of the given type from\n"
153 +-" standard input and write it in text format\n"
154 +-" to standard output. The message type must\n"
155 ++" and write it in binary. The message type must\n"
156 + " be defined in PROTO_FILES or their imports.\n"
157 +-" --decode_raw Read an arbitrary protocol message from\n"
158 +-" standard input and write the raw tag/value\n"
159 +-" pairs in text format to standard output. No\n"
160 ++" The input/output protobuf files are specified\n"
161 ++" using the --protobuf_in and --protobuf_out\n"
162 ++" command line flags.\n"
163 ++" --decode=MESSAGE_TYPE Read a binary message of the given type and\n"
164 ++" write it in text format. The message type\n"
165 ++" must be defined in PROTO_FILES or their imports.\n"
166 ++" The input/output protobuf files are specified\n"
167 ++" using the --protobuf_in and --protobuf_out\n"
168 ++" command line flags.\n"
169 ++" --decode_raw Read an arbitrary protocol message and write\n"
170 ++" the raw tag/value pairs in text format. No\n"
171 + " PROTO_FILES should be given when using this\n"
172 +-" flag.\n"
173 ++" flag. The input/output protobuf files are\n"
174 ++" specified using the --protobuf_in and\n"
175 ++" --protobuf_out command line flags.\n"
176 ++" --protobuf_in=FILE Absolute path to the protobuf file from which\n"
177 ++" input of encoding/decoding operation will be\n"
178 ++" read. If omitted, input will be read from\n"
179 ++" standard input.\n"
180 ++" --protobuf_out=FILE Absolute path to the protobuf file to which\n"
181 ++" output of encoding/decoding operation will be\n"
182 ++" written. If omitted, output will be written to\n"
183 ++" standard output.\n"
184 + " --descriptor_set_in=FILES Specifies a delimited list of FILES\n"
185 + " each containing a FileDescriptorSet (a\n"
186 + " protocol buffer defined in descriptor.proto).\n"
187 +@@ -2039,7 +2092,9 @@
188 + return true;
189 + }
190 +
191 +-bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool) {
192 ++bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool,
193 ++ int in_fd,
194 ++ int out_fd) {
195 + // Look up the type.
196 + const Descriptor* type = pool->FindMessageTypeByName(codec_type_);
197 + if (type == NULL) {
198 +@@ -2051,15 +2106,15 @@
199 + std::unique_ptr<Message> message(dynamic_factory.GetPrototype(type)->New());
200 +
201 + if (mode_ == MODE_ENCODE) {
202 +- SetFdToTextMode(STDIN_FILENO);
203 +- SetFdToBinaryMode(STDOUT_FILENO);
204 ++ SetFdToTextMode(in_fd);
205 ++ SetFdToBinaryMode(out_fd);
206 + } else {
207 +- SetFdToBinaryMode(STDIN_FILENO);
208 +- SetFdToTextMode(STDOUT_FILENO);
209 ++ SetFdToBinaryMode(in_fd);
210 ++ SetFdToTextMode(out_fd);
211 + }
212 +
213 +- io::FileInputStream in(STDIN_FILENO);
214 +- io::FileOutputStream out(STDOUT_FILENO);
215 ++ io::FileInputStream in(in_fd);
216 ++ io::FileOutputStream out(out_fd);
217 +
218 + if (mode_ == MODE_ENCODE) {
219 + // Input is text.
220 +--- /src/google/protobuf/compiler/command_line_interface.h
221 ++++ /src/google/protobuf/compiler/command_line_interface.h
222 +@@ -285,7 +285,9 @@
223 + GeneratorContext* generator_context, std::string* error);
224 +
225 + // Implements --encode and --decode.
226 +- bool EncodeOrDecode(const DescriptorPool* pool);
227 ++ bool EncodeOrDecode(const DescriptorPool* pool,
228 ++ int in_fd,
229 ++ int out_fd);
230 +
231 + // Implements the --descriptor_set_out option.
232 + bool WriteDescriptorSet(
233 +@@ -418,6 +420,13 @@
234 + // parsed FileDescriptorSets to be used for loading protos. Otherwise, empty.
235 + std::vector<std::string> descriptor_set_in_names_;
236 +
237 ++ // When using --encode / --decode / --decode_raw absolute path to the output
238 ++ // file. (Empty string indicates write to STDOUT).
239 ++ std::string protobuf_out_path_;
240 ++ // When using --encode / --decode / --decode_raw, absolute path to the input
241 ++ // file. (Empty string indicates read from STDIN).
242 ++ std::string protobuf_in_path_;
243 ++
244 + // If --descriptor_set_out was given, this is the filename to which the
245 + // FileDescriptorSet should be written. Otherwise, empty.
246 + std::string descriptor_set_out_name_;
247 +--- /src/google/protobuf/compiler/command_line_interface_unittest.cc
248 ++++ /src/google/protobuf/compiler/command_line_interface_unittest.cc
249 +@@ -95,7 +95,7 @@
250 + virtual void SetUp();
251 + virtual void TearDown();
252 +
253 +- // Runs the CommandLineInterface with the given command line. The
254 ++ // Run the CommandLineInterface with the given command line. The
255 + // command is automatically split on spaces, and the string "$tmpdir"
256 + // is replaced with TestTempDir().
257 + void Run(const string& command);
258 +@@ -2367,6 +2367,17 @@
259 + EXPECT_EQ(StripCR(expected_text), StripCR(captured_stderr_));
260 + }
261 +
262 ++ void ExpectBinaryFilesMatch(const string &expected_file,
263 ++ const string &actual_file) {
264 ++ string expected_output, actual_output;
265 ++ ASSERT_TRUE(File::ReadFileToString(expected_file, &expected_output));
266 ++ ASSERT_TRUE(File::ReadFileToString(actual_file, &actual_output));
267 ++
268 ++ // Don't use EXPECT_EQ because we don't want to print raw binary data to
269 ++ // stdout on failure.
270 ++ EXPECT_TRUE(expected_output == actual_output);
271 ++ }
272 ++
273 + private:
274 + void WriteUnittestProtoDescriptorSet() {
275 + unittest_proto_descriptor_set_filename_ =
276 +@@ -2463,6 +2474,19 @@
277 + "net/proto2/internal/no_such_file.proto: No such file or directory\n");
278 + }
279 +
280 ++TEST_P(EncodeDecodeTest, RedirectInputOutput) {
281 ++ string out_file = TestTempDir() + "/golden_message_out.pbf";
282 ++ EXPECT_TRUE(
283 ++ Run(TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto") +
284 ++ " --encode=protobuf_unittest.TestAllTypes" +
285 ++ " --protobuf_in=" + TestUtil::GetTestDataPath(
286 ++ "net/proto2/internal/"
287 ++ "testdata/text_format_unittest_data_oneof_implemented.txt") +
288 ++ " --protobuf_out=" + out_file));
289 ++ ExpectBinaryFilesMatch(out_file, TestUtil::GetTestDataPath(
290 ++ "net/proto2/internal/testdata/golden_message_oneof_implemented"));
291 ++}
292 ++
293 + INSTANTIATE_TEST_CASE_P(FileDescriptorSetSource,
294 + EncodeDecodeTest,
295 + testing::Values(PROTO_PATH, DESCRIPTOR_SET_IN));
296
297 diff --git a/dev-libs/protobuf/files/protobuf-3.7.1-system_libraries.patch b/dev-libs/protobuf/files/protobuf-3.7.1-system_libraries.patch
298 new file mode 100644
299 index 00000000000..3ae92e2b87a
300 --- /dev/null
301 +++ b/dev-libs/protobuf/files/protobuf-3.7.1-system_libraries.patch
302 @@ -0,0 +1,121 @@
303 +--- /Makefile.am
304 ++++ /Makefile.am
305 +@@ -11,28 +11,10 @@
306 + # Always include third_party directories in distributions.
307 + DIST_SUBDIRS = src conformance benchmarks third_party/googletest
308 +
309 +-# Build gmock before we build protobuf tests. We don't add gmock to SUBDIRS
310 +-# because then "make check" would also build and run all of gmock's own tests,
311 +-# which takes a lot of time and is generally not useful to us. Also, we don't
312 +-# want "make install" to recurse into gmock since we don't want to overwrite
313 +-# the installed version of gmock if there is one.
314 + check-local:
315 +- @echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
316 +- @cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
317 +- @cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
318 +
319 +-# We would like to clean gmock when "make clean" is invoked. But we have to
320 +-# be careful because clean-local is also invoked during "make distclean", but
321 +-# "make distclean" already recurses into gmock because it's listed among the
322 +-# DIST_SUBDIRS. distclean will delete gmock/Makefile, so if we then try to
323 +-# cd to the directory again and "make clean" it will fail. So, check that the
324 +-# Makefile exists before recursing.
325 + clean-local:
326 +- @if test -e third_party/googletest/Makefile; then \
327 +- echo "Making clean in googletest"; \
328 +- cd third_party/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; \
329 +- fi; \
330 +- if test -e conformance/Makefile; then \
331 ++ @if test -e conformance/Makefile; then \
332 + echo "Making clean in conformance"; \
333 + cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \
334 + fi; \
335 +--- /configure.ac
336 ++++ /configure.ac
337 +@@ -218,12 +218,5 @@
338 + esac
339 + AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1])
340 +
341 +-# HACK: Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
342 +-# since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
343 +-# too.
344 +-export CFLAGS
345 +-export CXXFLAGS
346 +-AC_CONFIG_SUBDIRS([third_party/googletest])
347 +-
348 + AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
349 + AC_OUTPUT
350 +--- /src/Makefile.am
351 ++++ /src/Makefile.am
352 +@@ -703,19 +703,11 @@
353 + google/protobuf/testing/file.cc \
354 + google/protobuf/testing/file.h
355 +
356 +-GOOGLETEST_BUILD_DIR=../third_party/googletest/googletest
357 +-GOOGLEMOCK_BUILD_DIR=../third_party/googletest/googlemock
358 +-GOOGLETEST_SRC_DIR=$(srcdir)/../third_party/googletest/googletest
359 +-GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
360 + check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
361 + protobuf-lite-test test_plugin protobuf-lite-arena-test \
362 + $(GZCHECKPROGRAMS)
363 + protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
364 +- $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
365 +- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
366 +- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
367 +-protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \
368 +- -I$(GOOGLEMOCK_SRC_DIR)/include
369 ++ -lgtest -lgmock -lgmock_main
370 + # Disable optimization for tests unless the user explicitly asked for it,
371 + # since test_util.cc takes forever to compile with optimization (with GCC).
372 + # See configure.ac for more info.
373 +@@ -804,12 +796,8 @@
374 + # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
375 + protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
376 + libprotoc.la \
377 +- $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
378 +- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
379 +- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
380 +-protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
381 +- -I$(GOOGLETEST_SRC_DIR)/include \
382 +- -DPROTOBUF_TEST_NO_DESCRIPTORS
383 ++ -lgtest -lgmock -lgmock_main
384 ++protobuf_lazy_descriptor_test_CPPFLAGS = -DPROTOBUF_TEST_NO_DESCRIPTORS
385 + protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
386 + protobuf_lazy_descriptor_test_SOURCES = \
387 + google/protobuf/compiler/cpp/cpp_unittest.cc \
388 +@@ -830,11 +818,7 @@
389 + # full runtime and we want to make sure this test builds without full
390 + # runtime.
391 + protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
392 +- $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
393 +- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
394 +- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
395 +-protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \
396 +- -I$(GOOGLETEST_SRC_DIR)/include
397 ++ -lgtest -lgmock -lgmock_main
398 + protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
399 + protobuf_lite_test_SOURCES = \
400 + google/protobuf/lite_unittest.cc \
401 +@@ -846,11 +830,7 @@
402 + # gtest when building the test internally our memory sanitizer doesn't detect
403 + # memory leaks (don't know why).
404 + protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
405 +- $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
406 +- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
407 +- $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
408 +-protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
409 +- -I$(GOOGLETEST_SRC_DIR)/include
410 ++ -lgtest -lgmock -lgmock_main
411 + protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
412 + protobuf_lite_arena_test_SOURCES = \
413 + google/protobuf/lite_arena_unittest.cc \
414 +@@ -860,8 +840,7 @@
415 +
416 + # Test plugin binary.
417 + test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
418 +- $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la
419 +-test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include
420 ++ -lgtest
421 + test_plugin_SOURCES = \
422 + google/protobuf/compiler/mock_code_generator.cc \
423 + google/protobuf/testing/file.cc \
424
425 diff --git a/dev-libs/protobuf/protobuf-3.7.1.ebuild b/dev-libs/protobuf/protobuf-3.7.1.ebuild
426 new file mode 100644
427 index 00000000000..f28a36c024b
428 --- /dev/null
429 +++ b/dev-libs/protobuf/protobuf-3.7.1.ebuild
430 @@ -0,0 +1,118 @@
431 +# Copyright 2008-2019 Arfrever Frehtes Taifersar Arahesis and others
432 +# Distributed under the terms of the GNU General Public License v2
433 +
434 +EAPI="7"
435 +
436 +inherit autotools elisp-common flag-o-matic multilib-minimal toolchain-funcs
437 +
438 +if [[ "${PV}" == "9999" ]]; then
439 + inherit git-r3
440 +
441 + EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf"
442 + EGIT_SUBMODULES=()
443 +fi
444 +
445 +DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing structured data"
446 +HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
447 +if [[ "${PV}" == "9999" ]]; then
448 + SRC_URI=""
449 +else
450 + SRC_URI="https://github.com/protocolbuffers/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
451 +fi
452 +
453 +LICENSE="BSD"
454 +SLOT="0/18"
455 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
456 +IUSE="emacs examples static-libs test zlib"
457 +RESTRICT="!test? ( test )"
458 +
459 +BDEPEND="emacs? ( virtual/emacs )"
460 +DEPEND="test? ( >=dev-cpp/gtest-1.8.0[${MULTILIB_USEDEP}] )
461 + zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
462 +RDEPEND="emacs? ( virtual/emacs )
463 + zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
464 +
465 +PATCHES=(
466 + "${FILESDIR}/${PN}-3.7.0-disable_no-warning-test.patch"
467 + "${FILESDIR}/${PN}-3.7.1-system_libraries.patch"
468 + "${FILESDIR}/${PN}-3.7.0-protoc_input_output_files.patch"
469 +)
470 +
471 +DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
472 +
473 +src_prepare() {
474 + default
475 + eautoreconf
476 +}
477 +
478 +src_configure() {
479 + append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
480 + multilib-minimal_src_configure
481 +}
482 +
483 +multilib_src_configure() {
484 + local options=(
485 + $(use_enable static-libs static)
486 + $(use_with zlib)
487 + )
488 +
489 + if tc-is-cross-compiler; then
490 + # Build system uses protoc when building, so protoc copy runnable on host is needed.
491 + mkdir -p "${WORKDIR}/build" || die
492 + pushd "${WORKDIR}/build" > /dev/null || die
493 + ECONF_SOURCE="${S}" econf_build "${options[@]}"
494 + options+=(--with-protoc="$(pwd)/src/protoc")
495 + popd > /dev/null || die
496 + fi
497 +
498 + ECONF_SOURCE="${S}" econf "${options[@]}"
499 +}
500 +
501 +src_compile() {
502 + multilib-minimal_src_compile
503 +
504 + if use emacs; then
505 + elisp-compile editors/protobuf-mode.el
506 + fi
507 +}
508 +
509 +multilib_src_compile() {
510 + if tc-is-cross-compiler; then
511 + emake -C "${WORKDIR}/build/src" protoc
512 + fi
513 +
514 + default
515 +}
516 +
517 +multilib_src_test() {
518 + emake check
519 +}
520 +
521 +multilib_src_install_all() {
522 + find "${D}" -name "*.la" -delete || die
523 +
524 + insinto /usr/share/vim/vimfiles/syntax
525 + doins editors/proto.vim
526 + insinto /usr/share/vim/vimfiles/ftdetect
527 + doins "${FILESDIR}/proto.vim"
528 +
529 + if use emacs; then
530 + elisp-install ${PN} editors/protobuf-mode.el*
531 + elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
532 + fi
533 +
534 + if use examples; then
535 + DOCS+=(examples)
536 + docompress -x /usr/share/doc/${PF}/examples
537 + fi
538 +
539 + einstalldocs
540 +}
541 +
542 +pkg_postinst() {
543 + use emacs && elisp-site-regen
544 +}
545 +
546 +pkg_postrm() {
547 + use emacs && elisp-site-regen
548 +}