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