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/files/, dev-libs/protobuf/
Date: Thu, 21 Sep 2017 21:06:11
Message-Id: 1506027836.dd8afe0da7b8f9ab41cd4709b32c5deea4c6d8d6.floppym@gentoo
1 commit: dd8afe0da7b8f9ab41cd4709b32c5deea4c6d8d6
2 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
3 AuthorDate: Thu Sep 21 18:40:06 2017 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 21 21:03:56 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd8afe0d
7
8 dev-libs/protobuf: Version bump (3.4.1) (bug #619828).
9
10 dev-libs/protobuf/Manifest | 1 +
11 .../protobuf-3.4.0-disable_no-warning-test.patch | 19 ++
12 .../protobuf-3.4.0-protoc_input_output_files.patch | 233 +++++++++++++++++++++
13 .../files/protobuf-3.4.0-system_libraries.patch | 117 +++++++++++
14 dev-libs/protobuf/protobuf-3.4.1.ebuild | 97 +++++++++
15 5 files changed, 467 insertions(+)
16
17 diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
18 index 32cafc294f0..cb806863cdf 100644
19 --- a/dev-libs/protobuf/Manifest
20 +++ b/dev-libs/protobuf/Manifest
21 @@ -4,3 +4,4 @@ DIST protobuf-3.0.0_beta3_p1.tar.gz 3673779 SHA256 494726c9a6a45a20cd085795a26e4
22 DIST protobuf-3.0.2.tar.gz 3917853 SHA256 b700647e11556b643ccddffd1f41d8cb7704ed02090af54cc517d44d912d11c1 SHA512 28eb8814555b0fe2cd57da6caf46802697a9612fccb3bba3ae7a379352437f81a18c1f6ab7242a22abea59c1ff9b06dcb6e2b52a97aa1a15cea6485ffc3c10c2 WHIRLPOOL 5c70def13be5e61d9405a24fdfc1efe9caee0b63c87f74e12f3d121801ecdc410e142eab80d8d4b49ebfe0c4f3cd13b2d77a17ec303978fec317265991a1f5a8
23 DIST protobuf-3.1.0.tar.gz 4051503 SHA256 0a0ae63cbffc274efb573bdde9a253e3f32e458c41261df51c5dbc5ad541e8f7 SHA512 8d3289a16944c255bd1cceab696e515e52467f2bfe1cc10f6b32fabdf082d5acdc248ec9cadc572223a24d04d431f75921076153109cea2f90ee533f502ab47a WHIRLPOOL b8a0bee9ff549c8da45c2b56b12aafbed5807959cdb11b3888a0f30fd0d6df83a72f3c6ef9e266522754b8901792f65235a6e81a8b0f74cee15d59ecbe6dee68
24 DIST protobuf-3.3.0.tar.gz 4336596 SHA256 94c414775f275d876e5e0e4a276527d155ab2d0da45eed6b7734301c330be36e SHA512 0734a55ae92f0539dfb507e174539d290fd8e93633c1edd8810e0d51c37e67254337b75fc5ba9450316f6416e1f8f8cfb59415864657b55f2a1696fbcdfe7636 WHIRLPOOL 4c18120ad784234ebb5308c0f3a2f3814d77f2fc906407f48285f3ba8f84af8e15defa4e7edf2d2e77cf22316df338b3f5bc0c6ca11c7a4fb951105c3aa7d7d4
25 +DIST protobuf-3.4.1.tar.gz 4490100 SHA256 8e0236242106e680b4f9f576cc44b8cd711e948b20a9fc07769b0a20ceab9cc4 SHA512 471e52198fa878a79183dc8fbc39d9c65239be4d9dff799e12281ee9b1af61a427584534b1baae1773bc6e4c86467f89ca2e7911a21effd86bc5f40cc7d94c34 WHIRLPOOL c53dc76155bcfeee11720b08c7d508a35274f2387d6f8a61149565bc72d5539ad598600ad692f01ac7a0ea102d66659f4d516f994c419c56c4420ce69659646b
26
27 diff --git a/dev-libs/protobuf/files/protobuf-3.4.0-disable_no-warning-test.patch b/dev-libs/protobuf/files/protobuf-3.4.0-disable_no-warning-test.patch
28 new file mode 100644
29 index 00000000000..373dc7935a8
30 --- /dev/null
31 +++ b/dev-libs/protobuf/files/protobuf-3.4.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 +@@ -750,7 +750,7 @@
38 +
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 + ../gmock/gtest/lib/libgtest.la \
45 + ../gmock/lib/libgmock.la \
46 +@@ -931,4 +931,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.4.0-protoc_input_output_files.patch b/dev-libs/protobuf/files/protobuf-3.4.0-protoc_input_output_files.patch
54 new file mode 100644
55 index 00000000000..a7d338e9928
56 --- /dev/null
57 +++ b/dev-libs/protobuf/files/protobuf-3.4.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 +@@ -942,6 +942,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 +@@ -950,13 +972,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 +@@ -994,6 +1023,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 +@@ -1561,6 +1595,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 +@@ -1684,18 +1724,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 +@@ -1957,7 +2008,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 +@@ -1969,15 +2022,15 @@
196 + google::protobuf::scoped_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 +@@ -269,7 +269,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 +@@ -402,6 +404,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 +@@ -95,7 +95,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 +@@ -2308,6 +2308,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 +@@ -2398,6 +2409,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.4.0-system_libraries.patch b/dev-libs/protobuf/files/protobuf-3.4.0-system_libraries.patch
294 new file mode 100644
295 index 00000000000..424ad5ff58c
296 --- /dev/null
297 +++ b/dev-libs/protobuf/files/protobuf-3.4.0-system_libraries.patch
298 @@ -0,0 +1,117 @@
299 +--- /Makefile.am
300 ++++ /Makefile.am
301 +@@ -8,31 +8,12 @@
302 + # the right time.
303 + SUBDIRS = . src
304 +
305 +-# Always include gmock in distributions.
306 +-DIST_SUBDIRS = $(subdirs) src conformance benchmarks
307 ++DIST_SUBDIRS = src conformance benchmarks
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 gmock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
317 +- @cd gmock/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_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 gmock/Makefile; then \
327 +- echo "Making clean in gmock"; \
328 +- cd gmock && $(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 +@@ -200,12 +200,5 @@
338 +
339 + AX_CXX_COMPILE_STDCXX([11], [noext], [optional])
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([gmock])
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 +@@ -752,11 +752,7 @@
353 + protobuf-lite-test test_plugin protobuf-lite-arena-test \
354 + no-warning-test $(GZCHECKPROGRAMS)
355 + protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
356 +- ../gmock/gtest/lib/libgtest.la \
357 +- ../gmock/lib/libgmock.la \
358 +- ../gmock/lib/libgmock_main.la
359 +-protobuf_test_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include \
360 +- -I$(srcdir)/../gmock/include
361 ++ -lgtest -lgmock -lgmock_main
362 + # Disable optimization for tests unless the user explicitly asked for it,
363 + # since test_util.cc takes forever to compile with optimization (with GCC).
364 + # See configure.ac for more info.
365 +@@ -843,12 +839,8 @@
366 + # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
367 + protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
368 + libprotoc.la \
369 +- ../gmock/gtest/lib/libgtest.la \
370 +- ../gmock/lib/libgmock.la \
371 +- ../gmock/lib/libgmock_main.la
372 +-protobuf_lazy_descriptor_test_CPPFLAGS = -I$(srcdir)/../gmock/include \
373 +- -I$(srcdir)/../gmock/gtest/include \
374 +- -DPROTOBUF_TEST_NO_DESCRIPTORS
375 ++ -lgtest -lgmock -lgmock_main
376 ++protobuf_lazy_descriptor_test_CPPFLAGS = -DPROTOBUF_TEST_NO_DESCRIPTORS
377 + protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
378 + protobuf_lazy_descriptor_test_SOURCES = \
379 + google/protobuf/compiler/cpp/cpp_unittest.cc \
380 +@@ -868,11 +860,7 @@
381 + # full runtime and we want to make sure this test builds without full
382 + # runtime.
383 + protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
384 +- ../gmock/gtest/lib/libgtest.la \
385 +- ../gmock/lib/libgmock.la \
386 +- ../gmock/lib/libgmock_main.la
387 +-protobuf_lite_test_CPPFLAGS= -I$(srcdir)/../gmock/include \
388 +- -I$(srcdir)/../gmock/gtest/include
389 ++ -lgtest -lgmock -lgmock_main
390 + protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
391 + protobuf_lite_test_SOURCES = \
392 + google/protobuf/lite_unittest.cc \
393 +@@ -883,11 +871,7 @@
394 + # gtest when building the test internally our memory sanitizer doesn't detect
395 + # memory leaks (don't know why).
396 + protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
397 +- ../gmock/gtest/lib/libgtest.la \
398 +- ../gmock/lib/libgmock.la \
399 +- ../gmock/lib/libgmock_main.la
400 +-protobuf_lite_arena_test_CPPFLAGS = -I$(srcdir)/../gmock/include \
401 +- -I$(srcdir)/../gmock/gtest/include
402 ++ -lgtest -lgmock -lgmock_main
403 + protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
404 + protobuf_lite_arena_test_SOURCES = \
405 + google/protobuf/lite_arena_unittest.cc \
406 +@@ -896,8 +880,7 @@
407 +
408 + # Test plugin binary.
409 + test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
410 +- ../gmock/gtest/lib/libgtest.la
411 +-test_plugin_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include
412 ++ -lgtest
413 + test_plugin_SOURCES = \
414 + google/protobuf/compiler/mock_code_generator.cc \
415 + google/protobuf/testing/file.cc \
416
417 diff --git a/dev-libs/protobuf/protobuf-3.4.1.ebuild b/dev-libs/protobuf/protobuf-3.4.1.ebuild
418 new file mode 100644
419 index 00000000000..d4a2ba85c2d
420 --- /dev/null
421 +++ b/dev-libs/protobuf/protobuf-3.4.1.ebuild
422 @@ -0,0 +1,97 @@
423 +# Copyright 1999-2017 Gentoo Foundation
424 +# Distributed under the terms of the GNU General Public License v2
425 +
426 +EAPI="6"
427 +
428 +inherit autotools elisp-common flag-o-matic multilib-minimal toolchain-funcs
429 +
430 +DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing structured data"
431 +HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/google/protobuf"
432 +SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
433 +
434 +LICENSE="BSD"
435 +SLOT="0/14"
436 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
437 +IUSE="emacs examples static-libs test zlib"
438 +
439 +RDEPEND="emacs? ( virtual/emacs )
440 + zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
441 +DEPEND="${RDEPEND}
442 + test? ( >=dev-cpp/gtest-1.8.0[${MULTILIB_USEDEP}] )"
443 +
444 +PATCHES=(
445 + "${FILESDIR}/${PN}-3.4.0-disable_no-warning-test.patch"
446 + "${FILESDIR}/${PN}-3.4.0-system_libraries.patch"
447 + "${FILESDIR}/${PN}-3.4.0-protoc_input_output_files.patch"
448 +)
449 +
450 +DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
451 +
452 +src_prepare() {
453 + append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
454 + default
455 + eautoreconf
456 +}
457 +
458 +multilib_src_configure() {
459 + local myeconfargs=(
460 + $(use_enable static-libs static)
461 + $(use_with zlib)
462 + )
463 +
464 + if tc-is-cross-compiler; then
465 + # The build system wants `protoc` when building, so we need a copy that
466 + # runs on the host. This is more hermetic than relying on the version
467 + # installed in the host being the exact same version.
468 + mkdir -p "${WORKDIR}/build" || die
469 + pushd "${WORKDIR}/build" > /dev/null || die
470 + ECONF_SOURCE="${S}" econf_build "${myeconfargs[@]}"
471 + myeconfargs+=(--with-protoc="${PWD}"/src/protoc)
472 + popd > /dev/null || die
473 + fi
474 +
475 + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
476 +}
477 +
478 +multilib_src_compile() {
479 + if tc-is-cross-compiler; then
480 + emake -C "${WORKDIR}/build/src" protoc
481 + fi
482 +
483 + default
484 +
485 + if use emacs; then
486 + elisp-compile editors/protobuf-mode.el
487 + fi
488 +}
489 +
490 +multilib_src_test() {
491 + emake check
492 +}
493 +
494 +multilib_src_install_all() {
495 + insinto /usr/share/vim/vimfiles/syntax
496 + doins editors/proto.vim
497 + insinto /usr/share/vim/vimfiles/ftdetect
498 + doins "${FILESDIR}/proto.vim"
499 +
500 + if use emacs; then
501 + elisp-install ${PN} editors/protobuf-mode.el*
502 + elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
503 + fi
504 +
505 + if use examples; then
506 + DOCS+=(examples)
507 + docompress -x /usr/share/doc/${PF}/examples
508 + fi
509 +
510 + einstalldocs
511 +}
512 +
513 +pkg_postinst() {
514 + use emacs && elisp-site-regen
515 +}
516 +
517 +pkg_postrm() {
518 + use emacs && elisp-site-regen
519 +}