public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2018-02-21 20:34 Mike Gilbert
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Gilbert @ 2018-02-21 20:34 UTC (permalink / raw
  To: gentoo-commits

commit:     34f2b3a8006ca31bcc03364066ec7dcd68d2950e
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Feb 21 17:57:00 2018 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Feb 21 20:32:17 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34f2b3a8

dev-libs/protobuf: Fix building on IA64.

Closes: https://bugs.gentoo.org/648248

 .../files/protobuf-3.5.0-atomic_operations.patch    | 21 +++++++++++++++++++++
 dev-libs/protobuf/protobuf-3.5.1.1.ebuild           |  7 ++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/dev-libs/protobuf/files/protobuf-3.5.0-atomic_operations.patch b/dev-libs/protobuf/files/protobuf-3.5.0-atomic_operations.patch
new file mode 100644
index 00000000000..7a88e837950
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.5.0-atomic_operations.patch
@@ -0,0 +1,21 @@
+https://github.com/google/protobuf/issues/3937
+https://github.com/google/protobuf/pull/3955
+https://github.com/google/protobuf/commit/642e1ac635f2563b4a14c255374f02645ae85dac
+
+--- /src/google/protobuf/stubs/atomicops_internals_generic_gcc.h
++++ /src/google/protobuf/stubs/atomicops_internals_generic_gcc.h
+@@ -146,6 +146,14 @@
+   return __atomic_load_n(ptr, __ATOMIC_RELAXED);
+ }
+ 
++inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
++                                       Atomic64 old_value,
++                                       Atomic64 new_value) {
++  __atomic_compare_exchange_n(ptr, &old_value, new_value, false,
++                              __ATOMIC_RELEASE, __ATOMIC_ACQUIRE);
++  return old_value;
++}
++
+ #endif // defined(__LP64__)
+ 
+ }  // namespace internal

diff --git a/dev-libs/protobuf/protobuf-3.5.1.1.ebuild b/dev-libs/protobuf/protobuf-3.5.1.1.ebuild
index 4f44ebc4d8c..97cbe92c922 100644
--- a/dev-libs/protobuf/protobuf-3.5.1.1.ebuild
+++ b/dev-libs/protobuf/protobuf-3.5.1.1.ebuild
@@ -23,16 +23,21 @@ PATCHES=(
 	"${FILESDIR}/${PN}-3.4.0-disable_no-warning-test.patch"
 	"${FILESDIR}/${PN}-3.4.0-system_libraries.patch"
 	"${FILESDIR}/${PN}-3.4.0-protoc_input_output_files.patch"
+	"${FILESDIR}/${PN}-3.5.0-atomic_operations.patch"
 )
 
 DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
 
 src_prepare() {
-	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
 	default
 	eautoreconf
 }
 
+src_configure() {
+	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
+	multilib-minimal_src_configure
+}
+
 multilib_src_configure() {
 	local myeconfargs=(
 		$(use_enable static-libs static)


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2018-04-26 15:14 Mike Gilbert
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Gilbert @ 2018-04-26 15:14 UTC (permalink / raw
  To: gentoo-commits

commit:     b2c7ba6148506cd4af825034f56162527a1e12ed
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Apr 25 18:15:29 2018 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Apr 26 15:12:16 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2c7ba61

dev-libs/protobuf: Delete old versions (<3.4.0).

 dev-libs/protobuf/Manifest                         |   6 -
 .../protobuf/files/protobuf-2.3.0-asneeded-2.patch |  28 ---
 .../protobuf/files/protobuf-2.5.0-emacs-24.4.patch |  14 --
 dev-libs/protobuf/files/protobuf-2.5.0-x32.patch   |  15 --
 .../files/protobuf-2.6.1-protoc-cmdline.patch      | 256 ---------------------
 .../protobuf-3.0.0_beta2-disable-local-gmock.patch |  89 -------
 .../files/protobuf-3.0.2-disable-local-gmock.patch | 101 --------
 .../files/protobuf-3.3.0-disable-local-gmock.patch | 115 ---------
 dev-libs/protobuf/metadata.xml                     |   4 -
 dev-libs/protobuf/protobuf-2.5.0-r2.ebuild         | 132 -----------
 dev-libs/protobuf/protobuf-2.6.1-r3.ebuild         | 158 -------------
 dev-libs/protobuf/protobuf-3.0.0_beta3_p1.ebuild   | 107 ---------
 dev-libs/protobuf/protobuf-3.0.2.ebuild            | 111 ---------
 dev-libs/protobuf/protobuf-3.1.0.ebuild            | 110 ---------
 dev-libs/protobuf/protobuf-3.3.0.ebuild            | 108 ---------
 15 files changed, 1354 deletions(-)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index d919674fdff..aa6d99043ce 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -1,9 +1,3 @@
-DIST protobuf-2.5.0.tar.bz2 1866763 BLAKE2B e4cece402bbeaff4400732ee2401f1a80bb0e70728eb41052da26b969b6fa6672b11ca80e28343d03a9df97c72bb8d8e2f890b9b730bad3c23c829aaf36ff701 SHA512 5994b3669808b82fef5c860ecad36358c0767f84acac877e7bfcf722e59d972835a955714149bdd4158fbd1328a51d01397a563991d26475351ee72be48142ee
-DIST protobuf-2.6.1.tar.bz2 2021416 BLAKE2B f58178a6081d58fff1582a907dfb9087f07b72e0701f19649b3adc9e1827a0f2670e25c6d177e60a59b965b3622b1eb11590b4b17083ee148c0da7eb07f02e55 SHA512 8b092b87fcd79223db199cd3d330f3d43689b47f345aa4e34028dcf1680d609a5d5a89ab08588e817b566d3b265834c38f1db580bc1c144b512ce74d35f2a174
-DIST protobuf-3.0.0_beta3_p1.tar.gz 3673779 BLAKE2B 44c6d0e42e92a822230b41fa732b58816d18e92e8466a59bb21de98cbb6cb3bcf6db29a7c5842ff8c754231c44626a95fd768f514f49bbb2ffc098618c7a50a2 SHA512 bebe655ffa6f8dd9bfbf4d2fcce160de6d45f50fd802b8907833cde3f232b7b44186d06fe9cc01ed5dc7b4a040fd3069e2ec7d2704da596e8d3af80f8dba7e8b
-DIST protobuf-3.0.2.tar.gz 3917853 BLAKE2B 542beb7b16de0da2cdc6f7981381b6de1ff2c01f229005727a74b4e5ff16db3f44e91c026eed323ccb1a2a2b3f834afa3686df80ff5f90d54f5f030cbaf601cf SHA512 28eb8814555b0fe2cd57da6caf46802697a9612fccb3bba3ae7a379352437f81a18c1f6ab7242a22abea59c1ff9b06dcb6e2b52a97aa1a15cea6485ffc3c10c2
-DIST protobuf-3.1.0.tar.gz 4051503 BLAKE2B af93f125a6b7b3e0be6f50ff5eaabe0db21f62b01a694d37c0b069956ef5d658df1beef68514b00a22005a36293b4a8a18654b5656f8c614309f0a744039c2fb SHA512 8d3289a16944c255bd1cceab696e515e52467f2bfe1cc10f6b32fabdf082d5acdc248ec9cadc572223a24d04d431f75921076153109cea2f90ee533f502ab47a
-DIST protobuf-3.3.0.tar.gz 4336596 BLAKE2B 381b2961fe1de8a86225903d0cfe4c98c238336b8782e5191c57c6fcf60cf321f39163d50864bf9c119a90bd7796269dc7e34168a158f7affa7fa295ce5deae0 SHA512 0734a55ae92f0539dfb507e174539d290fd8e93633c1edd8810e0d51c37e67254337b75fc5ba9450316f6416e1f8f8cfb59415864657b55f2a1696fbcdfe7636
 DIST protobuf-3.4.1.tar.gz 4490100 BLAKE2B e2bc1ef2ee1a0af44830b3c65a6c9e73883fe6ec0d07f6a6136f5564f0e85306005440ca6f8c4eb834c7c70f909792c9e2457a761f10f95431981263a9acd7a3 SHA512 471e52198fa878a79183dc8fbc39d9c65239be4d9dff799e12281ee9b1af61a427584534b1baae1773bc6e4c86467f89ca2e7911a21effd86bc5f40cc7d94c34
 DIST protobuf-3.5.1.1.tar.gz 4584489 BLAKE2B 995ee2f06a6358e9935b488269ee50f0dccede417c1757828b0108fbe8c67034301f3a9cb87517430acd9838ae71bb677f4edd8b59b2418f99c15d8ea3d33591 SHA512 f25ecf772facc8efd196b7c06012ce9ec24152b2c0cde38ed2e29ecded8f534221b008e649f4cbd991436ad3436130cd2e31d51e75019d08240d518111fb4496
 DIST protobuf-3.5.2.tar.gz 4584659 BLAKE2B f582212169d802a5844574eb900c9f8cbb343b7e73f2074e5ff0bfc544ebd13f4bc2b78271fb70f4465d78fdc39972ed68339f453c0d3ffe98d8564fbf520544 SHA512 09d10cf0c07a0ba249428bbf20f5dbed840965fa06b3c09682f286a4dee9d84bb96f3b5b50e993d48ef1f20440531255ce7d0e60a648bf3fe536a5f2b0b74181

diff --git a/dev-libs/protobuf/files/protobuf-2.3.0-asneeded-2.patch b/dev-libs/protobuf/files/protobuf-2.3.0-asneeded-2.patch
deleted file mode 100644
index 418622e547f..00000000000
--- a/dev-libs/protobuf/files/protobuf-2.3.0-asneeded-2.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Fixing as-needed issue
-
-http://bugs.gentoo.org/show_bug.cgi?id=271509
-
---- m4/acx_pthread.m4
-+++ m4/acx_pthread.m4
-@@ -278,7 +278,8 @@
- 	   fi
- 	fi
- 	
--	if test x"$done" = xno; then
-+	if test x"$done" = xyes; then
-+	   done="no"
- 	   AC_MSG_CHECKING([whether -pthread is sufficient with -shared])
- 	   AC_TRY_LINK([#include <pthread.h>],
- 	      [pthread_t th; pthread_join(th, 0);
---- gtest/m4/acx_pthread.m4
-+++ gtest/m4/acx_pthread.m4
-@@ -278,7 +278,8 @@
- 	   fi
- 	fi
- 	
--	if test x"$done" = xno; then
-+	if test x"$done" = xyes; then
-+	   done="no"
- 	   AC_MSG_CHECKING([whether -pthread is sufficient with -shared])
- 	   AC_TRY_LINK([#include <pthread.h>],
- 	      [pthread_t th; pthread_join(th, 0);

diff --git a/dev-libs/protobuf/files/protobuf-2.5.0-emacs-24.4.patch b/dev-libs/protobuf/files/protobuf-2.5.0-emacs-24.4.patch
deleted file mode 100644
index 77d62493824..00000000000
--- a/dev-libs/protobuf/files/protobuf-2.5.0-emacs-24.4.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Fix build with emacs-24.4.
-
-http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18845
-
---- protobuf-2.5.0/editors/protobuf-mode.el
-+++ protobuf-2.5.0/editors/protobuf-mode.el
-@@ -66,6 +66,7 @@
- (require 'cc-mode)
- 
- (eval-when-compile
-+  (require 'cl)
-   (require 'cc-langs)
-   (require 'cc-fonts))
- 

diff --git a/dev-libs/protobuf/files/protobuf-2.5.0-x32.patch b/dev-libs/protobuf/files/protobuf-2.5.0-x32.patch
deleted file mode 100644
index 5c8d4783180..00000000000
--- a/dev-libs/protobuf/files/protobuf-2.5.0-x32.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-fix from upstream for building w/x32
-
-https://code.google.com/p/protobuf/issues/detail?id=474
-
---- src/google/protobuf/stubs/atomicops.h	(revision 491)
-+++ src/google/protobuf/stubs/atomicops.h	(revision 492)
-@@ -66,7 +66,7 @@ typedef int32 Atomic32;
- #ifdef GOOGLE_PROTOBUF_ARCH_64_BIT
- // We need to be able to go between Atomic64 and AtomicWord implicitly.  This
- // means Atomic64 and AtomicWord should be the same type on 64-bit.
--#if defined(GOOGLE_PROTOBUF_OS_NACL)
-+#if defined(__ILP32__) || defined(GOOGLE_PROTOBUF_OS_NACL)
- // NaCl's intptr_t is not actually 64-bits on 64-bit!
- // http://code.google.com/p/nativeclient/issues/detail?id=1162
- typedef int64 Atomic64;

diff --git a/dev-libs/protobuf/files/protobuf-2.6.1-protoc-cmdline.patch b/dev-libs/protobuf/files/protobuf-2.6.1-protoc-cmdline.patch
deleted file mode 100644
index 894f2ffd095..00000000000
--- a/dev-libs/protobuf/files/protobuf-2.6.1-protoc-cmdline.patch
+++ /dev/null
@@ -1,256 +0,0 @@
-https://github.com/google/protobuf/pull/235
-
-From 18f71a50a9000e7558ae48a971fa301d76220ff0 Mon Sep 17 00:00:00 2001
-From: Prathmesh Prabhu <pprabhu@chromium.org>
-Date: Tue, 10 Mar 2015 17:04:40 -0400
-Subject: [PATCH] protoc: Add options to redirect input/output to files.
-
-When using protoc to encode/decode protobufs, the input/output was from
-stdin/stdout only. This patch adds command line flags to specify files to read
-the protobuf from and and write the encoded/decoded protobuf to.
----
- .../protobuf/compiler/command_line_interface.cc    | 99 +++++++++++++++++-----
- .../protobuf/compiler/command_line_interface.h     | 11 ++-
- .../compiler/command_line_interface_unittest.cc    | 25 +++++-
- 3 files changed, 110 insertions(+), 25 deletions(-)
-
-diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc
-index 567238a..1db85c9 100644
---- a/src/google/protobuf/compiler/command_line_interface.cc
-+++ b/src/google/protobuf/compiler/command_line_interface.cc
-@@ -745,6 +745,28 @@ int CommandLineInterface::Run(int argc, const char* const argv[]) {
-   }
- 
-   if (mode_ == MODE_ENCODE || mode_ == MODE_DECODE) {
-+    bool success = false;
-+    int in_fd = STDIN_FILENO;
-+    int out_fd = STDOUT_FILENO;
-+
-+    if (!protobuf_in_path_.empty()) {
-+      in_fd = open(protobuf_in_path_.c_str(), O_RDONLY);
-+      if (in_fd == -1) {
-+        cerr << protobuf_in_path_ << ": error: failed to open file." << endl;
-+        return 1;
-+      }
-+    }
-+    if (!protobuf_out_path_.empty()) {
-+      out_fd = open(protobuf_out_path_.c_str(),
-+                    O_WRONLY | O_CREAT | O_TRUNC,
-+                    0644);
-+      if (out_fd == -1) {
-+        cerr << protobuf_out_path_ << ": error: failed to open file." << endl;
-+        close(in_fd);
-+        return 1;
-+      }
-+    }
-+
-     if (codec_type_.empty()) {
-       // HACK:  Define an EmptyMessage type to use for decoding.
-       DescriptorPool pool;
-@@ -753,13 +775,20 @@ int CommandLineInterface::Run(int argc, const char* const argv[]) {
-       file.add_message_type()->set_name("EmptyMessage");
-       GOOGLE_CHECK(pool.BuildFile(file) != NULL);
-       codec_type_ = "EmptyMessage";
--      if (!EncodeOrDecode(&pool)) {
--        return 1;
--      }
-+      success = EncodeOrDecode(&pool, in_fd, out_fd);
-     } else {
--      if (!EncodeOrDecode(importer.pool())) {
--        return 1;
--      }
-+      success = EncodeOrDecode(importer.pool(), in_fd, out_fd);
-+    }
-+
-+    if (in_fd != STDIN_FILENO) {
-+      close(in_fd);
-+    }
-+    if (out_fd != STDOUT_FILENO) {
-+      close(out_fd);
-+    }
-+
-+    if (!success) {
-+      return 1;
-     }
-   }
- 
-@@ -873,6 +902,11 @@ CommandLineInterface::ParseArguments(int argc, const char* const argv[]) {
-     if (status != PARSE_ARGUMENT_DONE_AND_CONTINUE)
-       return status;
-   }
-+  if (mode_ == MODE_COMPILE &&
-+      (!protobuf_in_path_.empty() || !protobuf_out_path_.empty())) {
-+    cerr << "--protobuf_in and --protobuf_out are only valid with "
-+         << "decode operations. Ignoring.";
-+  }
- 
-   // If no --proto_path was given, use the current working directory.
-   if (proto_path_.empty()) {
-@@ -1123,6 +1157,12 @@ CommandLineInterface::InterpretArgument(const string& name,
- 
-     codec_type_ = value;
- 
-+  } else if (name == "--protobuf_in") {
-+    protobuf_in_path_ = value;
-+
-+  } else if (name == "--protobuf_out") {
-+    protobuf_out_path_ = value;
-+
-   } else if (name == "--error_format") {
-     if (value == "gcc") {
-       error_format_ = ERROR_FORMAT_GCC;
-@@ -1238,18 +1278,29 @@ void CommandLineInterface::PrintHelpText() {
- "  --version                   Show version info and exit.\n"
- "  -h, --help                  Show this text and exit.\n"
- "  --encode=MESSAGE_TYPE       Read a text-format message of the given type\n"
--"                              from standard input and write it in binary\n"
--"                              to standard output.  The message type must\n"
--"                              be defined in PROTO_FILES or their imports.\n"
--"  --decode=MESSAGE_TYPE       Read a binary message of the given type from\n"
--"                              standard input and write it in text format\n"
--"                              to standard output.  The message type must\n"
-+"                              an write it in binary.  The message type must\n"
- "                              be defined in PROTO_FILES or their imports.\n"
--"  --decode_raw                Read an arbitrary protocol message from\n"
--"                              standard input and write the raw tag/value\n"
--"                              pairs in text format to standard output.  No\n"
-+"                              The input/output protobuf files are specified\n"
-+"                              using the --protobuf_in and --protobuf_out\n"
-+"                              command line flags.\n"
-+"  --decode=MESSAGE_TYPE       Read a binary message of the given type and\n"
-+"                              write it in text format.  The message type\n"
-+"                              must be defined in PROTO_FILES or their\n"
-+"                              imports. The input/output protobuf files are\n"
-+"                              specified using the --protobuf_in and \n"
-+"                              --protobuf_out command line flags.\n"
-+"  --decode_raw                Read an arbitrary protocol message and write\n"
-+"                              the raw tag/value pairs in text format.  No\n"
- "                              PROTO_FILES should be given when using this\n"
--"                              flag.\n"
-+"                              flag. The input/output protobuf files are\n"
-+"                              specified using the --protobuf_in and \n"
-+"                              --protobuf_out command line flags.\n"
-+"  --protobuf_in               Absolute path to the protobuf file to read to\n"
-+"                              encode/decode.  If omitted, file will be read\n"
-+"                              from STDIN.\n"
-+"  --protobuf_out              Absolute path to the protobuf file to write to\n"
-+"                              after encode/decode operation.  If omitted,\n"
-+"                              output is written to STDOUT.\n"
- "  -oFILE,                     Writes a FileDescriptorSet (a protocol buffer,\n"
- "    --descriptor_set_out=FILE defined in descriptor.proto) containing all of\n"
- "                              the input files to FILE.\n"
-@@ -1490,7 +1541,9 @@ bool CommandLineInterface::GeneratePluginOutput(
-   return true;
- }
- 
--bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool) {
-+bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool,
-+                                          int in_fd,
-+                                          int out_fd) {
-   // Look up the type.
-   const Descriptor* type = pool->FindMessageTypeByName(codec_type_);
-   if (type == NULL) {
-@@ -1502,15 +1555,15 @@ bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool) {
-   google::protobuf::scoped_ptr<Message> message(dynamic_factory.GetPrototype(type)->New());
- 
-   if (mode_ == MODE_ENCODE) {
--    SetFdToTextMode(STDIN_FILENO);
--    SetFdToBinaryMode(STDOUT_FILENO);
-+    SetFdToTextMode(in_fd);
-+    SetFdToBinaryMode(out_fd);
-   } else {
--    SetFdToBinaryMode(STDIN_FILENO);
--    SetFdToTextMode(STDOUT_FILENO);
-+    SetFdToBinaryMode(in_fd);
-+    SetFdToTextMode(out_fd);
-   }
- 
--  io::FileInputStream in(STDIN_FILENO);
--  io::FileOutputStream out(STDOUT_FILENO);
-+  io::FileInputStream in(in_fd);
-+  io::FileOutputStream out(out_fd);
- 
-   if (mode_ == MODE_ENCODE) {
-     // Input is text.
-diff --git a/src/google/protobuf/compiler/command_line_interface.h b/src/google/protobuf/compiler/command_line_interface.h
-index 7e611c4..b6fc38a 100644
---- a/src/google/protobuf/compiler/command_line_interface.h
-+++ b/src/google/protobuf/compiler/command_line_interface.h
-@@ -244,7 +244,9 @@ class LIBPROTOC_EXPORT CommandLineInterface {
-                             string* error);
- 
-   // Implements --encode and --decode.
--  bool EncodeOrDecode(const DescriptorPool* pool);
-+  bool EncodeOrDecode(const DescriptorPool* pool,
-+                      int in_fd,
-+                      int out_fd);
- 
-   // Implements the --descriptor_set_out option.
-   bool WriteDescriptorSet(const vector<const FileDescriptor*> parsed_files);
-@@ -357,6 +359,13 @@ class LIBPROTOC_EXPORT CommandLineInterface {
-   // decoding.  (Empty string indicates --decode_raw.)
-   string codec_type_;
- 
-+  // When using --encode / --decode / --decode_raw absolute path to the output
-+  // file. (Empty string indicates write to STDOUT).
-+  string protobuf_out_path_;
-+  // When using --encode / --decode / --decode_raw, absolute path to the input
-+  // file. (Empty string indicates read from STDIN).
-+  string protobuf_in_path_;
-+
-   // If --descriptor_set_out was given, this is the filename to which the
-   // FileDescriptorSet should be written.  Otherwise, empty.
-   string descriptor_set_name_;
-diff --git a/src/google/protobuf/compiler/command_line_interface_unittest.cc b/src/google/protobuf/compiler/command_line_interface_unittest.cc
-index 2b26f3b..78ff2cf 100644
---- a/src/google/protobuf/compiler/command_line_interface_unittest.cc
-+++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc
-@@ -94,7 +94,7 @@ class CommandLineInterfaceTest : public testing::Test {
-   virtual void SetUp();
-   virtual void TearDown();
- 
--  // Runs the CommandLineInterface with the given command line.  The
-+  // Run the CommandLineInterface with the given command line.  The
-   // command is automatically split on spaces, and the string "$tmpdir"
-   // is replaced with TestTempDir().
-   void Run(const string& command);
-@@ -1680,6 +1680,17 @@ class EncodeDecodeTest : public testing::Test {
-     EXPECT_EQ(StripCR(expected_text), StripCR(captured_stderr_));
-   }
- 
-+  void ExpectBinaryFilesMatch(const string &expected_file,
-+                              const string &actual_file) {
-+    string expected_output, actual_output;
-+    ASSERT_TRUE(File::ReadFileToString(expected_file, &expected_output));
-+    ASSERT_TRUE(File::ReadFileToString(actual_file, &actual_output));
-+
-+    // Don't use EXPECT_EQ because we don't want to print raw binary data to
-+    // stdout on failure.
-+    EXPECT_TRUE(expected_output == actual_output);
-+  }
-+
-  private:
-   int duped_stdin_;
-   string captured_stdout_;
-@@ -1745,6 +1756,18 @@ TEST_F(EncodeDecodeTest, ProtoParseError) {
-     "google/protobuf/no_such_file.proto: File not found.\n");
- }
- 
-+TEST_F(EncodeDecodeTest, RedirectInputOutput) {
-+  string out_file = TestTempDir() + "/golden_message_out.pbf";
-+  string cmd = "";
-+  cmd += "google/protobuf/unittest.proto ";
-+  cmd += "--encode=protobuf_unittest.TestAllTypes ";
-+  cmd += "--protobuf_in=" + TestSourceDir() +
-+         "/google/protobuf/testdata/text_format_unittest_data_oneof_implemented.txt ";
-+  cmd += "--protobuf_out=" + out_file;
-+  EXPECT_TRUE(Run(cmd));
-+  ExpectBinaryFilesMatch(out_file, TestSourceDir() + "/google/protobuf/testdata/golden_message_oneof_implemented");
-+}
-+
- }  // anonymous namespace
- 
- }  // namespace compiler
--- 
-2.3.1
-

diff --git a/dev-libs/protobuf/files/protobuf-3.0.0_beta2-disable-local-gmock.patch b/dev-libs/protobuf/files/protobuf-3.0.0_beta2-disable-local-gmock.patch
deleted file mode 100644
index 341d1128aa1..00000000000
--- a/dev-libs/protobuf/files/protobuf-3.0.0_beta2-disable-local-gmock.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-diff -Naur a/configure.ac b/configure.ac
---- a/configure.ac	2015-12-30 22:21:46.000000000 +0100
-+++ b/configure.ac	2016-04-16 17:46:54.858904639 +0200
-@@ -176,9 +176,9 @@
- # HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
- #   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
- #   too.
--export CFLAGS
--export CXXFLAGS
--AC_CONFIG_SUBDIRS([gmock])
-+#export CFLAGS
-+#export CXXFLAGS
-+#AC_CONFIG_SUBDIRS([gmock])
- 
- AC_CONFIG_FILES([Makefile src/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
- AC_OUTPUT
-diff -Naur a/Makefile.am b/Makefile.am
---- a/Makefile.am	2015-12-30 22:21:46.000000000 +0100
-+++ b/Makefile.am	2016-04-16 17:46:25.355751203 +0200
-@@ -17,9 +17,10 @@
- # want "make install" to recurse into gmock since we don't want to overwrite
- # the installed version of gmock if there is one.
- check-local:
--	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
--	@cd gmock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
--	@cd gmock/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
-+	@echo "Making of gmock disabled"
-+#	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
-+#	@cd gmock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
-+#	@cd gmock/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
- 
- # We would like to clean gmock when "make clean" is invoked.  But we have to
- # be careful because clean-local is also invoked during "make distclean", but
-diff -Naur a/src/Makefile.am b/src/Makefile.am
---- a/src/Makefile.am	2015-12-30 22:21:46.000000000 +0100
-+++ b/src/Makefile.am	2016-04-16 17:47:07.026967535 +0200
-@@ -669,11 +669,8 @@
-                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
-                  $(GZCHECKPROGRAMS)
- protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
--                      ../gmock/gtest/lib/libgtest.la              \
--                      ../gmock/lib/libgmock.la                    \
--                      ../gmock/lib/libgmock_main.la
--protobuf_test_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include \
--                         -I$(srcdir)/../gmock/include
-+                      -L/usr/lib -lgmock -lgmock_main -lgtest
-+protobuf_test_CPPFLAGS = -I/usr/include
- # Disable optimization for tests unless the user explicitly asked for it,
- # since test_util.cc takes forever to compile with optimization (with GCC).
- # See configure.ac for more info.
-@@ -753,11 +750,8 @@
- # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
- protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
-                       libprotoc.la                                   \
--                      ../gmock/gtest/lib/libgtest.la                 \
--                      ../gmock/lib/libgmock.la                       \
--                      ../gmock/lib/libgmock_main.la
--protobuf_lazy_descriptor_test_CPPFLAGS = -I$(srcdir)/../gmock/include       \
--                                         -I$(srcdir)/../gmock/gtest/include \
-+                      -L/usr/lib -lgmock -lgmock_main -lgtest
-+protobuf_lazy_descriptor_test_CPPFLAGS = -I/usr/include \
-                                          -DPROTOBUF_TEST_NO_DESCRIPTORS
- protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lazy_descriptor_test_SOURCES =                        \
-@@ -788,11 +782,8 @@
- # gtest when building the test internally our memory sanitizer doesn't detect
- # memory leaks (don't know why).
- protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
--                      ../gmock/gtest/lib/libgtest.la                 \
--                      ../gmock/lib/libgmock.la                       \
--                      ../gmock/lib/libgmock_main.la
--protobuf_lite_arena_test_CPPFLAGS = -I$(srcdir)/../gmock/include       \
--                                    -I$(srcdir)/../gmock/gtest/include
-+                      -L/usr/lib -lgmock -lgmock_main -lgtest
-+protobuf_lite_arena_test_CPPFLAGS = -I/usr/include
- protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lite_arena_test_SOURCES =       \
-   google/protobuf/lite_arena_unittest.cc \
-@@ -801,8 +792,8 @@
- 
- # Test plugin binary.
- test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
--                    ../gmock/gtest/lib/libgtest.la
--test_plugin_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include
-+                    -L/usr/lib -lgtest
-+test_plugin_CPPFLAGS = -I/usr/include
- test_plugin_SOURCES =                                          \
-   google/protobuf/compiler/mock_code_generator.cc              \
-   google/protobuf/testing/file.cc                              \

diff --git a/dev-libs/protobuf/files/protobuf-3.0.2-disable-local-gmock.patch b/dev-libs/protobuf/files/protobuf-3.0.2-disable-local-gmock.patch
deleted file mode 100644
index a2dda8aafac..00000000000
--- a/dev-libs/protobuf/files/protobuf-3.0.2-disable-local-gmock.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-diff -Naur protobuf-3.0.2.orig/Makefile.am protobuf-3.0.2/Makefile.am
---- protobuf-3.0.2.orig/Makefile.am	2016-09-06 15:40:51.000000000 -0700
-+++ protobuf-3.0.2/Makefile.am	2016-12-14 14:44:50.516520874 -0800
-@@ -17,9 +17,10 @@
- # want "make install" to recurse into gmock since we don't want to overwrite
- # the installed version of gmock if there is one.
- check-local:
--	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
--	@cd gmock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
--	@cd gmock/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
-+	@echo "Making of gmock disabled"
-+#	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
-+#	@cd gmock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
-+#	@cd gmock/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
- 
- # We would like to clean gmock when "make clean" is invoked.  But we have to
- # be careful because clean-local is also invoked during "make distclean", but
-diff -Naur protobuf-3.0.2.orig/configure.ac protobuf-3.0.2/configure.ac
---- protobuf-3.0.2.orig/configure.ac	2016-09-06 15:40:51.000000000 -0700
-+++ protobuf-3.0.2/configure.ac	2016-12-14 14:44:50.516520874 -0800
-@@ -181,9 +181,9 @@
- # HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
- #   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
- #   too.
--export CFLAGS
--export CXXFLAGS
--AC_CONFIG_SUBDIRS([gmock])
-+#export CFLAGS
-+#export CXXFLAGS
-+#AC_CONFIG_SUBDIRS([gmock])
- 
- AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
- AC_OUTPUT
-diff -Naur protobuf-3.0.2.orig/src/Makefile.am protobuf-3.0.2/src/Makefile.am
---- protobuf-3.0.2.orig/src/Makefile.am	2016-09-06 15:40:51.000000000 -0700
-+++ protobuf-3.0.2/src/Makefile.am	2016-12-14 14:44:50.517520885 -0800
-@@ -688,11 +688,8 @@
-                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
-                  no-warning-test $(GZCHECKPROGRAMS)
- protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
--                      ../gmock/gtest/lib/libgtest.la              \
--                      ../gmock/lib/libgmock.la                    \
--                      ../gmock/lib/libgmock_main.la
--protobuf_test_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include \
--                         -I$(srcdir)/../gmock/include
-+                      -L/usr/lib -lgmock -lgmock_main -lgtest
-+protobuf_test_CPPFLAGS = -I/usr/include
- # Disable optimization for tests unless the user explicitly asked for it,
- # since test_util.cc takes forever to compile with optimization (with GCC).
- # See configure.ac for more info.
-@@ -775,11 +772,8 @@
- # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
- protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
-                       libprotoc.la                                   \
--                      ../gmock/gtest/lib/libgtest.la                 \
--                      ../gmock/lib/libgmock.la                       \
--                      ../gmock/lib/libgmock_main.la
--protobuf_lazy_descriptor_test_CPPFLAGS = -I$(srcdir)/../gmock/include       \
--                                         -I$(srcdir)/../gmock/gtest/include \
-+                      -L/usr/lib -lgmock -lgmock_main -lgtest
-+protobuf_lazy_descriptor_test_CPPFLAGS = -I/usr/include \
-                                          -DPROTOBUF_TEST_NO_DESCRIPTORS
- protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lazy_descriptor_test_SOURCES =                        \
-@@ -810,11 +804,8 @@
- # gtest when building the test internally our memory sanitizer doesn't detect
- # memory leaks (don't know why).
- protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
--                      ../gmock/gtest/lib/libgtest.la                 \
--                      ../gmock/lib/libgmock.la                       \
--                      ../gmock/lib/libgmock_main.la
--protobuf_lite_arena_test_CPPFLAGS = -I$(srcdir)/../gmock/include       \
--                                    -I$(srcdir)/../gmock/gtest/include
-+                      -L/usr/lib -lgmock -lgmock_main -lgtest
-+protobuf_lite_arena_test_CPPFLAGS = -I/usr/include
- protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lite_arena_test_SOURCES =       \
-   google/protobuf/lite_arena_unittest.cc \
-@@ -823,8 +814,8 @@
- 
- # Test plugin binary.
- test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
--                    ../gmock/gtest/lib/libgtest.la
--test_plugin_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include
-+                    -L/usr/lib -lgtest
-+test_plugin_CPPFLAGS = -I/usr/include
- test_plugin_SOURCES =                                          \
-   google/protobuf/compiler/mock_code_generator.cc              \
-   google/protobuf/testing/file.cc                              \
-@@ -853,9 +844,8 @@
- 	echo "TEST(NoWarningTest, Empty) {}" >> no_warning_test.cc
- 
- no_warning_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la      \
--                        ../gmock/gtest/lib/libgtest.la      \
--                        ../gmock/gtest/lib/libgtest_main.la
--no_warning_test_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include
-+                        -L/usr/lib -lgtest -lgtest_main
-+no_warning_test_CPPFLAGS = -I/usr/include
- no_warning_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) \
-                            -Wall -Werror
- nodist_no_warning_test_SOURCES = no_warning_test.cc $(protoc_outputs)

diff --git a/dev-libs/protobuf/files/protobuf-3.3.0-disable-local-gmock.patch b/dev-libs/protobuf/files/protobuf-3.3.0-disable-local-gmock.patch
deleted file mode 100644
index 25dc7bd074b..00000000000
--- a/dev-libs/protobuf/files/protobuf-3.3.0-disable-local-gmock.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-diff -Naur protobuf-3.3.0.orig/Makefile.am protobuf-3.3.0/Makefile.am
---- protobuf-3.3.0.orig/Makefile.am	2017-05-01 20:04:35.448840428 -0700
-+++ protobuf-3.3.0/Makefile.am	2017-05-01 20:04:48.855978898 -0700
-@@ -17,9 +17,10 @@
- # want "make install" to recurse into gmock since we don't want to overwrite
- # the installed version of gmock if there is one.
- check-local:
--	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
--	@cd gmock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
--	@cd gmock/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
-+	@echo "Making of gmock disabled"
-+#	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
-+#	@cd gmock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
-+#	@cd gmock/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
- 
- # We would like to clean gmock when "make clean" is invoked.  But we have to
- # be careful because clean-local is also invoked during "make distclean", but
-diff -Naur protobuf-3.3.0.orig/configure.ac protobuf-3.3.0/configure.ac
---- protobuf-3.3.0.orig/configure.ac	2017-05-01 20:04:35.497840933 -0700
-+++ protobuf-3.3.0/configure.ac	2017-05-01 20:04:48.856978908 -0700
-@@ -203,9 +203,9 @@
- # HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
- #   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
- #   too.
--export CFLAGS
--export CXXFLAGS
--AC_CONFIG_SUBDIRS([gmock])
-+#export CFLAGS
-+#export CXXFLAGS
-+#AC_CONFIG_SUBDIRS([gmock])
- 
- AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
- AC_OUTPUT
-diff -Naur protobuf-3.3.0.orig/src/Makefile.am protobuf-3.3.0/src/Makefile.am
---- protobuf-3.3.0.orig/src/Makefile.am	2017-05-01 20:04:35.549841471 -0700
-+++ protobuf-3.3.0/src/Makefile.am	2017-05-01 20:06:46.307191948 -0700
-@@ -748,11 +748,8 @@
-                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
-                  no-warning-test $(GZCHECKPROGRAMS)
- protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
--                      ../gmock/gtest/lib/libgtest.la              \
--                      ../gmock/lib/libgmock.la                    \
--                      ../gmock/lib/libgmock_main.la
--protobuf_test_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include \
--                         -I$(srcdir)/../gmock/include
-+                      -L/usr/lib -lgmock -lgmock_main -lgtest
-+protobuf_test_CPPFLAGS = -I/usr/include
- # Disable optimization for tests unless the user explicitly asked for it,
- # since test_util.cc takes forever to compile with optimization (with GCC).
- # See configure.ac for more info.
-@@ -837,11 +834,8 @@
- # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
- protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
-                       libprotoc.la                                   \
--                      ../gmock/gtest/lib/libgtest.la                 \
--                      ../gmock/lib/libgmock.la                       \
--                      ../gmock/lib/libgmock_main.la
--protobuf_lazy_descriptor_test_CPPFLAGS = -I$(srcdir)/../gmock/include       \
--                                         -I$(srcdir)/../gmock/gtest/include \
-+                      -L/usr/lib -lgmock -lgmock_main -lgtest
-+protobuf_lazy_descriptor_test_CPPFLAGS = -I/usr/include \
-                                          -DPROTOBUF_TEST_NO_DESCRIPTORS
- protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lazy_descriptor_test_SOURCES =                        \
-@@ -862,11 +856,8 @@
- # full runtime and we want to make sure this test builds without full
- # runtime.
- protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
--                           ../gmock/gtest/lib/libgtest.la      \
--                           ../gmock/lib/libgmock.la            \
--                           ../gmock/lib/libgmock_main.la
--protobuf_lite_test_CPPFLAGS= -I$(srcdir)/../gmock/include \
--                             -I$(srcdir)/../gmock/gtest/include
-+                      -L/usr/lib -lgmock -lgmock_main -lgtest
-+protobuf_lite_test_CPPFLAGS = -I/usr/include
- protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lite_test_SOURCES =                                           \
-   google/protobuf/lite_unittest.cc                                     \
-@@ -877,11 +868,8 @@
- # gtest when building the test internally our memory sanitizer doesn't detect
- # memory leaks (don't know why).
- protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
--                      ../gmock/gtest/lib/libgtest.la                 \
--                      ../gmock/lib/libgmock.la                       \
--                      ../gmock/lib/libgmock_main.la
--protobuf_lite_arena_test_CPPFLAGS = -I$(srcdir)/../gmock/include       \
--                                    -I$(srcdir)/../gmock/gtest/include
-+                      -L/usr/lib -lgmock -lgmock_main -lgtest
-+protobuf_lite_arena_test_CPPFLAGS = -I/usr/include
- protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lite_arena_test_SOURCES =       \
-   google/protobuf/lite_arena_unittest.cc \
-@@ -890,8 +878,8 @@
- 
- # Test plugin binary.
- test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
--                    ../gmock/gtest/lib/libgtest.la
--test_plugin_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include
-+                    -L/usr/lib -lgtest
-+test_plugin_CPPFLAGS = -I/usr/include
- test_plugin_SOURCES =                                          \
-   google/protobuf/compiler/mock_code_generator.cc              \
-   google/protobuf/testing/file.cc                              \
-@@ -920,9 +908,8 @@
- 	echo "TEST(NoWarningTest, Empty) {}" >> no_warning_test.cc
- 
- no_warning_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la      \
--                        ../gmock/gtest/lib/libgtest.la      \
--                        ../gmock/gtest/lib/libgtest_main.la
--no_warning_test_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include
-+                        -L/usr/lib -lgtest -lgtest_main
-+no_warning_test_CPPFLAGS = -I/usr/include
- no_warning_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) \
-                            -Wall -Werror
- nodist_no_warning_test_SOURCES = no_warning_test.cc $(protoc_outputs)

diff --git a/dev-libs/protobuf/metadata.xml b/dev-libs/protobuf/metadata.xml
index 27b70440161..6aeca898035 100644
--- a/dev-libs/protobuf/metadata.xml
+++ b/dev-libs/protobuf/metadata.xml
@@ -12,10 +12,6 @@
 	<slots>
 		<subslots>Soname version number</subslots>
 	</slots>
-	<use>
-		<flag name="java">Builds the Java implementation. This is not needed for Java support in protoc.</flag>
-		<flag name="python">Builds the Python implementation. This is not needed for Python support in protoc.</flag>
-	</use>
 	<upstream>
 		<remote-id type="github">google/protobuf</remote-id>
 	</upstream>

diff --git a/dev-libs/protobuf/protobuf-2.5.0-r2.ebuild b/dev-libs/protobuf/protobuf-2.5.0-r2.ebuild
deleted file mode 100644
index 5c13a2976ed..00000000000
--- a/dev-libs/protobuf/protobuf-2.5.0-r2.ebuild
+++ /dev/null
@@ -1,132 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-AUTOTOOLS_AUTORECONF=1
-AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
-JAVA_PKG_IUSE="source"
-PYTHON_COMPAT=( python2_7 )
-DISTUTILS_OPTIONAL=1
-
-inherit autotools-multilib eutils flag-o-matic distutils-r1 java-pkg-opt-2 elisp-common
-
-DESCRIPTION="Google's Protocol Buffers -- an efficient method of encoding structured data"
-HOMEPAGE="https://code.google.com/p/protobuf/"
-SRC_URI="https://protobuf.googlecode.com/files/${P}.tar.bz2"
-
-LICENSE="BSD"
-SLOT="0/8" # subslot = soname major version
-KEYWORDS="amd64 arm -hppa ~ia64 ~mips ppc ~ppc64 x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
-IUSE="emacs examples java python static-libs vim-syntax"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-CDEPEND="emacs? ( virtual/emacs )
-	python? ( ${PYTHON_DEPS} )"
-DEPEND="${CDEPEND}
-	java? ( >=virtual/jdk-1.5 )
-	python? ( dev-python/setuptools[${PYTHON_USEDEP}] )"
-RDEPEND="${CDEPEND}
-	java? ( >=virtual/jre-1.5 )"
-
-src_prepare() {
-	append-cxxflags -DGOOGLE_PROTOBUF_NO_RTTI
-
-	epatch "${FILESDIR}"/${P}-x32.patch
-
-	# breaks Darwin, bug #472514
-	[[ ${CHOST} != *-darwin* ]] && epatch "${FILESDIR}"/${PN}-2.3.0-asneeded-2.patch
-
-	# fix build with emacs-24.4 (bug #524100)
-	epatch "${FILESDIR}"/${P}-emacs-24.4.patch
-
-	autotools-multilib_src_prepare
-
-	if use python; then
-		cd python && distutils-r1_src_prepare
-	fi
-}
-
-multilib_src_compile() {
-	default
-
-	if multilib_is_native_abi; then
-		if use python; then
-			einfo "Compiling Python library ..."
-			pushd "${S}"/python >/dev/null
-			PROTOC="${BUILD_DIR}"/src/protoc distutils-r1_src_compile
-			popd >/dev/null
-		fi
-
-		if use java; then
-			einfo "Compiling Java library ..."
-			pushd "${S}" >/dev/null
-			"${BUILD_DIR}"/src/protoc --java_out=java/src/main/java --proto_path=src src/google/protobuf/descriptor.proto
-			mkdir java/build
-			pushd java/src/main/java >/dev/null
-			ejavac -d ../../../build $(find . -name '*.java') || die "java compilation failed"
-			popd >/dev/null
-			jar cf ${PN}.jar -C java/build . || die "jar failed"
-			popd >/dev/null
-		fi
-	fi
-}
-
-src_compile() {
-	autotools-multilib_src_compile
-
-	if use emacs; then
-		elisp-compile "${S}"/editors/protobuf-mode.el
-	fi
-}
-
-src_test() {
-	autotools-multilib_src_test check
-
-	if use python; then
-		pushd python >/dev/null
-		distutils-r1_src_test
-		popd >/dev/null
-	fi
-}
-
-src_install() {
-	autotools-multilib_src_install
-
-	dodoc CHANGES.txt CONTRIBUTORS.txt README.txt
-
-	if use python; then
-		pushd python >/dev/null
-		distutils-r1_src_install
-		popd >/dev/null
-	fi
-
-	if use java; then
-		java-pkg_dojar ${PN}.jar
-		use source && java-pkg_dosrc java/src/main/java/*
-	fi
-
-	if use vim-syntax; then
-		insinto /usr/share/vim/vimfiles/syntax
-		doins editors/proto.vim
-		insinto /usr/share/vim/vimfiles/ftdetect/
-		doins "${FILESDIR}"/proto.vim
-	fi
-
-	if use emacs; then
-		elisp-install ${PN} editors/protobuf-mode.el*
-		elisp-site-file-install "${FILESDIR}"/70${PN}-gentoo.el
-	fi
-
-	if use examples; then
-		dodoc -r examples
-		docompress -x /usr/share/doc/${PF}/examples
-	fi
-}
-
-pkg_postinst() {
-	use emacs && elisp-site-regen
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}

diff --git a/dev-libs/protobuf/protobuf-2.6.1-r3.ebuild b/dev-libs/protobuf/protobuf-2.6.1-r3.ebuild
deleted file mode 100644
index 8d93c1be7e4..00000000000
--- a/dev-libs/protobuf/protobuf-2.6.1-r3.ebuild
+++ /dev/null
@@ -1,158 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-AUTOTOOLS_AUTORECONF=1
-AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
-JAVA_PKG_IUSE="source"
-PYTHON_COMPAT=( python2_7 )
-DISTUTILS_OPTIONAL=1
-
-inherit autotools-multilib eutils flag-o-matic toolchain-funcs distutils-r1 java-pkg-opt-2 elisp-common
-
-DESCRIPTION="Google's Protocol Buffers -- an efficient method of encoding structured data"
-HOMEPAGE="https://code.google.com/p/protobuf/ https://github.com/google/protobuf/"
-SRC_URI="https://github.com/google/${PN}/releases/download/v${PV}/${P}.tar.bz2"
-
-LICENSE="BSD"
-SLOT="0/9" # subslot = soname major version
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
-IUSE="emacs examples java python static-libs vim-syntax zlib"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-CDEPEND="emacs? ( virtual/emacs )
-	python? ( ${PYTHON_DEPS} )
-	zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )"
-DEPEND="${CDEPEND}
-	java? ( >=virtual/jdk-1.5 )
-	python? (
-		dev-python/google-apputils[${PYTHON_USEDEP}]
-		dev-python/setuptools[${PYTHON_USEDEP}]
-	)"
-RDEPEND="${CDEPEND}
-	java? ( >=virtual/jre-1.5 )"
-
-src_prepare() {
-	append-cxxflags -DGOOGLE_PROTOBUF_NO_RTTI
-
-	# breaks Darwin, bug #472514
-	[[ ${CHOST} != *-darwin* ]] && epatch "${FILESDIR}"/${PN}-2.3.0-asneeded-2.patch
-
-	# fix build with emacs-24.4 (bug #524100)
-	epatch "${FILESDIR}"/${PN}-2.5.0-emacs-24.4.patch
-	epatch "${FILESDIR}"/${PN}-2.6.1-protoc-cmdline.patch
-
-	autotools-multilib_src_prepare
-
-	if use python; then
-		cd python && distutils-r1_src_prepare
-	fi
-}
-
-src_configure() {
-	local myeconfargs=(
-		$(use_with zlib)
-	)
-
-	if tc-is-cross-compiler; then
-		# The build system wants `protoc` when building, so we need a copy that
-		# runs on the host.  This is more hermetic than relying on the version
-		# installed in the host being the exact same version.
-		mkdir -p "${WORKDIR}"/build || die
-		pushd "${WORKDIR}"/build >/dev/null
-		ECONF_SOURCE=${S} econf_build "${myeconfargs[@]}"
-		myeconfargs+=( --with-protoc="${PWD}"/src/protoc )
-		popd >/dev/null
-	fi
-
-	autotools-multilib_src_configure
-}
-
-multilib_src_compile() {
-	default
-
-	if multilib_is_native_abi; then
-		if use python; then
-			einfo "Compiling Python library ..."
-			pushd "${S}"/python >/dev/null
-			PROTOC="${BUILD_DIR}"/src/protoc distutils-r1_src_compile
-			popd >/dev/null
-		fi
-
-		if use java; then
-			einfo "Compiling Java library ..."
-			pushd "${S}" >/dev/null
-			"${BUILD_DIR}"/src/protoc --java_out=java/src/main/java --proto_path=src src/google/protobuf/descriptor.proto
-			mkdir java/build
-			pushd java/src/main/java >/dev/null
-			ejavac -d ../../../build $(find . -name '*.java') || die "java compilation failed"
-			popd >/dev/null
-			jar cf ${PN}.jar -C java/build . || die "jar failed"
-			popd >/dev/null
-		fi
-	fi
-}
-
-src_compile() {
-	if tc-is-cross-compiler; then
-		emake -C "${WORKDIR}"/build/src protoc
-	fi
-
-	autotools-multilib_src_compile
-
-	if use emacs; then
-		elisp-compile "${S}"/editors/protobuf-mode.el
-	fi
-}
-
-src_test() {
-	autotools-multilib_src_test check
-
-	if use python; then
-		pushd python >/dev/null
-		distutils-r1_src_test
-		popd >/dev/null
-	fi
-}
-
-src_install() {
-	autotools-multilib_src_install
-
-	dodoc CHANGES.txt CONTRIBUTORS.txt README.md
-
-	if use python; then
-		pushd python >/dev/null
-		distutils-r1_src_install
-		popd >/dev/null
-	fi
-
-	if use java; then
-		java-pkg_dojar ${PN}.jar
-		use source && java-pkg_dosrc java/src/main/java/*
-	fi
-
-	if use vim-syntax; then
-		insinto /usr/share/vim/vimfiles/syntax
-		doins editors/proto.vim
-		insinto /usr/share/vim/vimfiles/ftdetect/
-		doins "${FILESDIR}"/proto.vim
-	fi
-
-	if use emacs; then
-		elisp-install ${PN} editors/protobuf-mode.el*
-		elisp-site-file-install "${FILESDIR}"/70${PN}-gentoo.el
-	fi
-
-	if use examples; then
-		dodoc -r examples
-		docompress -x /usr/share/doc/${PF}/examples
-	fi
-}
-
-pkg_postinst() {
-	use emacs && elisp-site-regen
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}

diff --git a/dev-libs/protobuf/protobuf-3.0.0_beta3_p1.ebuild b/dev-libs/protobuf/protobuf-3.0.0_beta3_p1.ebuild
deleted file mode 100644
index c61f89d74ab..00000000000
--- a/dev-libs/protobuf/protobuf-3.0.0_beta3_p1.ebuild
+++ /dev/null
@@ -1,107 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python2_7 python3_4 python3_5 )
-inherit python-r1 autotools flag-o-matic toolchain-funcs elisp-common multilib-minimal
-
-# If you bump this package, also consider bumping the official language bindings!
-# At the current time these are java and python.
-MY_PV=${PV/_beta/-beta-}
-MY_PV=${MY_PV/_p/.}
-
-DESCRIPTION="Google's Protocol Buffers -- an efficient method of encoding structured data"
-HOMEPAGE="https://github.com/google/protobuf/ https://developers.google.com/protocol-buffers/"
-SRC_URI="https://github.com/google/protobuf/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0/10b3"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
-IUSE="emacs examples java python static-libs test vim-syntax zlib"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-RDEPEND="
-	emacs? ( virtual/emacs )
-	python? ( ${PYTHON_DEPS} )
-	zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
-	test? ( dev-cpp/gmock[${MULTILIB_USEDEP}] )"
-# This is provided for backwards compatibility due to (likely incorrect) use in consumers.
-PDEPEND="java? ( dev-java/protobuf-java )
-	python? ( dev-python/protobuf-python[${PYTHON_USEDEP}] )"
-
-S="${WORKDIR}/${PN}-${MY_PV}"
-PATCHES=(
-	"${FILESDIR}/${PN}-2.5.0-emacs-24.4.patch"
-	"${FILESDIR}/${PN}-2.6.1-protoc-cmdline.patch"
-	"${FILESDIR}/${PN}-3.0.0_beta2-disable-local-gmock.patch"
-)
-
-src_prepare() {
-	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
-	default
-	eautoreconf
-}
-
-multilib_src_configure() {
-	local myeconfargs=(
-		$(use_enable static-libs static)
-		$(use_with zlib)
-	)
-	if tc-is-cross-compiler; then
-		# The build system wants `protoc` when building, so we need a copy that
-		# runs on the host.  This is more hermetic than relying on the version
-		# installed in the host being the exact same version.
-		mkdir -p "${WORKDIR}"/build || die
-		pushd "${WORKDIR}"/build >/dev/null || die
-		ECONF_SOURCE=${S} econf_build "${myeconfargs[@]}"
-		myeconfargs+=( --with-protoc="${PWD}"/src/protoc )
-		popd >/dev/null || die
-	fi
-	ECONF_SOURCE=${S} econf "${myeconfargs[@]}"
-}
-
-multilib_src_compile() {
-	if tc-is-cross-compiler; then
-		emake -C "${WORKDIR}"/build/src protoc
-	fi
-
-	default
-
-	if use emacs; then
-		elisp-compile "${S}"/editors/protobuf-mode.el
-	fi
-}
-
-multilib_src_test() {
-	emake check
-}
-
-src_install() {
-	multilib-minimal_src_install
-
-	if use vim-syntax; then
-		insinto /usr/share/vim/vimfiles/syntax
-		doins editors/proto.vim
-		insinto /usr/share/vim/vimfiles/ftdetect/
-		doins "${FILESDIR}/proto.vim"
-	fi
-
-	if use emacs; then
-		elisp-install "${PN}" editors/protobuf-mode.el*
-		elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
-	fi
-
-	if use examples; then
-		DOCS+=( examples )
-	fi
-}
-
-pkg_postinst() {
-	use emacs && elisp-site-regen
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}

diff --git a/dev-libs/protobuf/protobuf-3.0.2.ebuild b/dev-libs/protobuf/protobuf-3.0.2.ebuild
deleted file mode 100644
index e24d24c5801..00000000000
--- a/dev-libs/protobuf/protobuf-3.0.2.ebuild
+++ /dev/null
@@ -1,111 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python2_7 python3_4 python3_5 )
-inherit autotools elisp-common flag-o-matic python-r1 toolchain-funcs multilib-minimal
-
-# If you bump this package, also consider bumping the official language bindings!
-# At the current time these are java and python.
-MY_PV=${PV/_beta/-beta-}
-MY_PV=${MY_PV/_p/.}
-
-DESCRIPTION="Google's Protocol Buffers -- an efficient method of encoding structured data"
-HOMEPAGE="https://github.com/google/protobuf/ https://developers.google.com/protocol-buffers/"
-SRC_URI="https://github.com/google/protobuf/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0/10"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
-IUSE="emacs examples java python static-libs test vim-syntax zlib"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-RDEPEND="
-	emacs? ( virtual/emacs )
-	python? ( ${PYTHON_DEPS} )
-	zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
-	test? ( dev-cpp/gmock[${MULTILIB_USEDEP}] )"
-# This is provided for backwards compatibility due to (likely incorrect) use in consumers.
-PDEPEND="
-	java? ( dev-java/protobuf-java )
-	python? ( dev-python/protobuf-python[${PYTHON_USEDEP}] )"
-
-DOCS=( CHANGES.txt CONTRIBUTORS.txt README.md )
-
-PATCHES=(
-	"${FILESDIR}/${PN}-2.5.0-emacs-24.4.patch"
-	"${FILESDIR}/${PN}-2.6.1-protoc-cmdline.patch"
-	"${FILESDIR}/${PN}-3.0.2-disable-local-gmock.patch"
-)
-
-S="${WORKDIR}/${PN}-${MY_PV}"
-src_prepare() {
-	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
-	default
-	eautoreconf
-}
-
-multilib_src_configure() {
-	local myeconfargs=(
-		$(use_enable static-libs static)
-		$(use_with zlib)
-	)
-	if tc-is-cross-compiler; then
-		# The build system wants `protoc` when building, so we need a copy that
-		# runs on the host.  This is more hermetic than relying on the version
-		# installed in the host being the exact same version.
-		mkdir -p "${WORKDIR}"/build || die
-		pushd "${WORKDIR}"/build >/dev/null || die
-		ECONF_SOURCE=${S} econf_build "${myeconfargs[@]}"
-		myeconfargs+=( --with-protoc="${PWD}"/src/protoc )
-		popd >/dev/null || die
-	fi
-	ECONF_SOURCE=${S} econf "${myeconfargs[@]}"
-}
-
-multilib_src_compile() {
-	if tc-is-cross-compiler; then
-		emake -C "${WORKDIR}"/build/src protoc
-	fi
-
-	default
-
-	if use emacs; then
-		elisp-compile "${S}"/editors/protobuf-mode.el
-	fi
-}
-
-multilib_src_test() {
-	emake check
-}
-
-multilib_src_install_all() {
-	if use vim-syntax; then
-		insinto /usr/share/vim/vimfiles/syntax
-		doins editors/proto.vim
-		insinto /usr/share/vim/vimfiles/ftdetect/
-		doins "${FILESDIR}/proto.vim"
-	fi
-
-	if use emacs; then
-		elisp-install "${PN}" editors/protobuf-mode.el*
-		elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
-	fi
-
-	if use examples; then
-		DOCS+=( examples )
-		docompress -x /usr/share/doc/"${PF}"/examples
-	fi
-
-	einstalldocs
-}
-
-pkg_postinst() {
-	use emacs && elisp-site-regen
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}

diff --git a/dev-libs/protobuf/protobuf-3.1.0.ebuild b/dev-libs/protobuf/protobuf-3.1.0.ebuild
deleted file mode 100644
index 22bb288f8b4..00000000000
--- a/dev-libs/protobuf/protobuf-3.1.0.ebuild
+++ /dev/null
@@ -1,110 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python2_7 python3_4 python3_5 )
-inherit autotools elisp-common flag-o-matic python-r1 toolchain-funcs multilib-minimal
-
-# If you bump this package, also consider bumping the official language bindings!
-# At the current time these are java and python.
-MY_PV=${PV/_beta/-beta-}
-MY_PV=${MY_PV/_p/.}
-
-DESCRIPTION="Google's Protocol Buffers -- an efficient method of encoding structured data"
-HOMEPAGE="https://github.com/google/protobuf/ https://developers.google.com/protocol-buffers/"
-SRC_URI="https://github.com/google/protobuf/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0/11"
-KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 ~sh ~sparc x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
-IUSE="emacs examples java python static-libs test vim-syntax zlib"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-RDEPEND="
-	emacs? ( virtual/emacs )
-	python? ( ${PYTHON_DEPS} )
-	zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
-	test? ( dev-cpp/gmock[${MULTILIB_USEDEP}] )"
-# This is provided for backwards compatibility due to (likely incorrect) use in consumers.
-PDEPEND="
-	java? ( dev-java/protobuf-java )
-	python? ( dev-python/protobuf-python[${PYTHON_USEDEP}] )"
-
-DOCS=( CHANGES.txt CONTRIBUTORS.txt README.md )
-
-PATCHES=(
-	"${FILESDIR}/${PN}-2.6.1-protoc-cmdline.patch"
-	"${FILESDIR}/${PN}-3.0.2-disable-local-gmock.patch"
-)
-
-S="${WORKDIR}/${PN}-${MY_PV}"
-src_prepare() {
-	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
-	default
-	eautoreconf
-}
-
-multilib_src_configure() {
-	local myeconfargs=(
-		$(use_enable static-libs static)
-		$(use_with zlib)
-	)
-	if tc-is-cross-compiler; then
-		# The build system wants `protoc` when building, so we need a copy that
-		# runs on the host.  This is more hermetic than relying on the version
-		# installed in the host being the exact same version.
-		mkdir -p "${WORKDIR}"/build || die
-		pushd "${WORKDIR}"/build >/dev/null || die
-		ECONF_SOURCE=${S} econf_build "${myeconfargs[@]}"
-		myeconfargs+=( --with-protoc="${PWD}"/src/protoc )
-		popd >/dev/null || die
-	fi
-	ECONF_SOURCE=${S} econf "${myeconfargs[@]}"
-}
-
-multilib_src_compile() {
-	if tc-is-cross-compiler; then
-		emake -C "${WORKDIR}"/build/src protoc
-	fi
-
-	default
-
-	if use emacs; then
-		elisp-compile "${S}"/editors/protobuf-mode.el
-	fi
-}
-
-multilib_src_test() {
-	emake check
-}
-
-multilib_src_install_all() {
-	if use vim-syntax; then
-		insinto /usr/share/vim/vimfiles/syntax
-		doins editors/proto.vim
-		insinto /usr/share/vim/vimfiles/ftdetect/
-		doins "${FILESDIR}/proto.vim"
-	fi
-
-	if use emacs; then
-		elisp-install "${PN}" editors/protobuf-mode.el*
-		elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
-	fi
-
-	if use examples; then
-		DOCS+=( examples )
-		docompress -x /usr/share/doc/"${PF}"/examples
-	fi
-
-	einstalldocs
-}
-
-pkg_postinst() {
-	use emacs && elisp-site-regen
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}

diff --git a/dev-libs/protobuf/protobuf-3.3.0.ebuild b/dev-libs/protobuf/protobuf-3.3.0.ebuild
deleted file mode 100644
index 86b099daf47..00000000000
--- a/dev-libs/protobuf/protobuf-3.3.0.ebuild
+++ /dev/null
@@ -1,108 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
-inherit autotools elisp-common flag-o-matic python-r1 toolchain-funcs multilib-minimal
-
-# If you bump this package, also consider bumping the official language bindings!
-# At the current time these are java and python.
-MY_PV=${PV/_beta/-beta-}
-MY_PV=${MY_PV/_p/.}
-
-DESCRIPTION="Google's Protocol Buffers -- an efficient method of encoding structured data"
-HOMEPAGE="https://github.com/google/protobuf/ https://developers.google.com/protocol-buffers/"
-SRC_URI="https://github.com/google/protobuf/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0/13"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
-IUSE="emacs examples java python static-libs test zlib"
-
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-DEPEND="
-	emacs? ( virtual/emacs )
-	zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
-	test? ( dev-cpp/gmock[${MULTILIB_USEDEP}] )"
-
-# This is provided for backwards compatibility due to (likely incorrect) use in consumers.
-PDEPEND="
-	java? ( dev-java/protobuf-java )
-	python? ( dev-python/protobuf-python[${PYTHON_USEDEP}] )"
-
-DOCS=( CHANGES.txt CONTRIBUTORS.txt README.md )
-
-PATCHES=(
-	"${FILESDIR}/${PN}-2.6.1-protoc-cmdline.patch"
-	"${FILESDIR}/${PN}-3.3.0-disable-local-gmock.patch"
-)
-
-S="${WORKDIR}/${PN}-${MY_PV}"
-src_prepare() {
-	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
-	default
-	eautoreconf
-}
-
-multilib_src_configure() {
-	local myeconfargs=(
-		$(use_enable static-libs static)
-		$(use_with zlib)
-	)
-	if tc-is-cross-compiler; then
-		# The build system wants `protoc` when building, so we need a copy that
-		# runs on the host.  This is more hermetic than relying on the version
-		# installed in the host being the exact same version.
-		mkdir -p "${WORKDIR}"/build || die
-		pushd "${WORKDIR}"/build >/dev/null || die
-		ECONF_SOURCE=${S} econf_build "${myeconfargs[@]}"
-		myeconfargs+=( --with-protoc="${PWD}"/src/protoc )
-		popd >/dev/null || die
-	fi
-	ECONF_SOURCE=${S} econf "${myeconfargs[@]}"
-}
-
-multilib_src_compile() {
-	if tc-is-cross-compiler; then
-		emake -C "${WORKDIR}"/build/src protoc
-	fi
-
-	default
-
-	if use emacs; then
-		elisp-compile "${S}"/editors/protobuf-mode.el
-	fi
-}
-
-multilib_src_test() {
-	emake check
-}
-
-multilib_src_install_all() {
-	insinto /usr/share/vim/vimfiles/syntax
-	doins editors/proto.vim
-	insinto /usr/share/vim/vimfiles/ftdetect
-	doins "${FILESDIR}/proto.vim"
-
-	if use emacs; then
-		elisp-install "${PN}" editors/protobuf-mode.el*
-		elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
-	fi
-
-	if use examples; then
-		DOCS+=( examples )
-		docompress -x /usr/share/doc/"${PF}"/examples
-	fi
-
-	einstalldocs
-}
-
-pkg_postinst() {
-	use emacs && elisp-site-regen
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2018-07-07  2:03 Mike Gilbert
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Gilbert @ 2018-07-07  2:03 UTC (permalink / raw
  To: gentoo-commits

commit:     52c7cd4159d9a0b9eda57de784e36c0aafb73fee
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Jun 24 14:27:31 2018 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Jul  7 02:02:53 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52c7cd41

dev-libs/protobuf: Version bump (3.6.0.1).

 dev-libs/protobuf/Manifest                         |   1 +
 .../protobuf-3.6.0-disable_no-warning-test.patch   |  19 ++
 .../protobuf-3.6.0-protoc_input_output_files.patch | 233 +++++++++++++++++++++
 .../files/protobuf-3.6.0-system_libraries.patch    | 121 +++++++++++
 dev-libs/protobuf/protobuf-3.6.0.1.ebuild          | 105 ++++++++++
 5 files changed, 479 insertions(+)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index aa6d99043ce..f6e4af7f648 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -1,3 +1,4 @@
 DIST protobuf-3.4.1.tar.gz 4490100 BLAKE2B e2bc1ef2ee1a0af44830b3c65a6c9e73883fe6ec0d07f6a6136f5564f0e85306005440ca6f8c4eb834c7c70f909792c9e2457a761f10f95431981263a9acd7a3 SHA512 471e52198fa878a79183dc8fbc39d9c65239be4d9dff799e12281ee9b1af61a427584534b1baae1773bc6e4c86467f89ca2e7911a21effd86bc5f40cc7d94c34
 DIST protobuf-3.5.1.1.tar.gz 4584489 BLAKE2B 995ee2f06a6358e9935b488269ee50f0dccede417c1757828b0108fbe8c67034301f3a9cb87517430acd9838ae71bb677f4edd8b59b2418f99c15d8ea3d33591 SHA512 f25ecf772facc8efd196b7c06012ce9ec24152b2c0cde38ed2e29ecded8f534221b008e649f4cbd991436ad3436130cd2e31d51e75019d08240d518111fb4496
 DIST protobuf-3.5.2.tar.gz 4584659 BLAKE2B f582212169d802a5844574eb900c9f8cbb343b7e73f2074e5ff0bfc544ebd13f4bc2b78271fb70f4465d78fdc39972ed68339f453c0d3ffe98d8564fbf520544 SHA512 09d10cf0c07a0ba249428bbf20f5dbed840965fa06b3c09682f286a4dee9d84bb96f3b5b50e993d48ef1f20440531255ce7d0e60a648bf3fe536a5f2b0b74181
+DIST protobuf-3.6.0.1.tar.gz 4483964 BLAKE2B 8afc1e4f4a6eba0eb453fa7cbee8e8ab4986ab9dda39a0005de9d07ec4bd4fd27a5af4ab359b139b4117a5da580be6da3387295266625ee8cc7ec9421c5c0235 SHA512 63cd799d5d6edbb05a87bc07992271c5bdb9595366d698b4dc5476cc89dc278d1c43186b9e56340958aefea2ce23e15a9c3a550158414add868b56e789ceafe4

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
new file mode 100644
index 00000000000..834f6b0d1ab
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.6.0-disable_no-warning-test.patch
@@ -0,0 +1,19 @@
+Disable no-warning-test which is compiled with -Werror option and whose only purpose is checking if compilation results in any warnings.
+
+--- /src/Makefile.am
++++ /src/Makefile.am
+@@ -717,7 +717,7 @@
+ GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
+ check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
+                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
+-                 no-warning-test $(GZCHECKPROGRAMS)
++                 $(GZCHECKPROGRAMS)
+ protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+                       $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
+                       $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
+@@ -900,4 +900,4 @@
+ 
+ TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
+         google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS)     \
+-        protobuf-lite-arena-test no-warning-test
++        protobuf-lite-arena-test

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
new file mode 100644
index 00000000000..f515b6cd1a4
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.6.0-protoc_input_output_files.patch
@@ -0,0 +1,233 @@
+https://github.com/google/protobuf/pull/235
+
+--- /src/google/protobuf/compiler/command_line_interface.cc
++++ /src/google/protobuf/compiler/command_line_interface.cc
+@@ -931,6 +931,28 @@
+   }
+ 
+   if (mode_ == MODE_ENCODE || mode_ == MODE_DECODE) {
++    bool success = false;
++    int in_fd = STDIN_FILENO;
++    int out_fd = STDOUT_FILENO;
++
++    if (!protobuf_in_path_.empty()) {
++      in_fd = open(protobuf_in_path_.c_str(), O_RDONLY);
++      if (in_fd == -1) {
++        std::cerr << protobuf_in_path_ << ": error: failed to open file." << std::endl;
++        return 1;
++      }
++    }
++    if (!protobuf_out_path_.empty()) {
++      out_fd = open(protobuf_out_path_.c_str(),
++                    O_WRONLY | O_CREAT | O_TRUNC,
++                    0644);
++      if (out_fd == -1) {
++        std::cerr << protobuf_out_path_ << ": error: failed to open file." << std::endl;
++        close(in_fd);
++        return 1;
++      }
++    }
++
+     if (codec_type_.empty()) {
+       // HACK:  Define an EmptyMessage type to use for decoding.
+       DescriptorPool pool;
+@@ -939,13 +961,20 @@
+       file.add_message_type()->set_name("EmptyMessage");
+       GOOGLE_CHECK(pool.BuildFile(file) != NULL);
+       codec_type_ = "EmptyMessage";
+-      if (!EncodeOrDecode(&pool)) {
+-        return 1;
+-      }
++      success = EncodeOrDecode(&pool, in_fd, out_fd);
+     } else {
+-      if (!EncodeOrDecode(descriptor_pool.get())) {
+-        return 1;
+-      }
++      success = EncodeOrDecode(descriptor_pool.get(), in_fd, out_fd);
++    }
++
++    if (in_fd != STDIN_FILENO) {
++      close(in_fd);
++    }
++    if (out_fd != STDOUT_FILENO) {
++      close(out_fd);
++    }
++
++    if (!success) {
++      return 1;
+     }
+   }
+ 
+@@ -983,6 +1012,11 @@
+   for (int i = 0; i < proto_path_.size(); i++) {
+     source_tree->MapPath(proto_path_[i].first, proto_path_[i].second);
+   }
++  if (mode_ == MODE_COMPILE &&
++      (!protobuf_in_path_.empty() || !protobuf_out_path_.empty())) {
++    std::cerr << "--protobuf_in and --protobuf_out are only valid with "
++         << "decode operations. Ignoring.";
++  }
+ 
+   // Map input files to virtual paths if possible.
+   if (!MakeInputsBeProtoPathRelative(source_tree)) {
+@@ -1571,6 +1605,12 @@
+ 
+     codec_type_ = value;
+ 
++  } else if (name == "--protobuf_in") {
++    protobuf_in_path_ = value;
++
++  } else if (name == "--protobuf_out") {
++    protobuf_out_path_ = value;
++
+   } else if (name == "--error_format") {
+     if (value == "gcc") {
+       error_format_ = ERROR_FORMAT_GCC;
+@@ -1693,18 +1733,29 @@
+ "  --version                   Show version info and exit.\n"
+ "  -h, --help                  Show this text and exit.\n"
+ "  --encode=MESSAGE_TYPE       Read a text-format message of the given type\n"
+-"                              from standard input and write it in binary\n"
+-"                              to standard output.  The message type must\n"
+-"                              be defined in PROTO_FILES or their imports.\n"
+-"  --decode=MESSAGE_TYPE       Read a binary message of the given type from\n"
+-"                              standard input and write it in text format\n"
+-"                              to standard output.  The message type must\n"
++"                              an write it in binary.  The message type must\n"
+ "                              be defined in PROTO_FILES or their imports.\n"
+-"  --decode_raw                Read an arbitrary protocol message from\n"
+-"                              standard input and write the raw tag/value\n"
+-"                              pairs in text format to standard output.  No\n"
++"                              The input/output protobuf files are specified\n"
++"                              using the --protobuf_in and --protobuf_out\n"
++"                              command line flags.\n"
++"  --decode=MESSAGE_TYPE       Read a binary message of the given type and\n"
++"                              write it in text format.  The message type\n"
++"                              must be defined in PROTO_FILES or their\n"
++"                              imports. The input/output protobuf files are\n"
++"                              specified using the --protobuf_in and \n"
++"                              --protobuf_out command line flags.\n"
++"  --decode_raw                Read an arbitrary protocol message and write\n"
++"                              the raw tag/value pairs in text format.  No\n"
+ "                              PROTO_FILES should be given when using this\n"
+-"                              flag.\n"
++"                              flag. The input/output protobuf files are\n"
++"                              specified using the --protobuf_in and \n"
++"                              --protobuf_out command line flags.\n"
++"  --protobuf_in               Absolute path to the protobuf file to read to\n"
++"                              encode/decode.  If omitted, file will be read\n"
++"                              from STDIN.\n"
++"  --protobuf_out              Absolute path to the protobuf file to write to\n"
++"                              after encode/decode operation.  If omitted,\n"
++"                              output is written to STDOUT.\n"
+ "  --descriptor_set_in=FILES   Specifies a delimited list of FILES\n"
+ "                              each containing a FileDescriptorSet (a\n"
+ "                              protocol buffer defined in descriptor.proto).\n"
+@@ -1983,7 +2034,9 @@
+   return true;
+ }
+ 
+-bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool) {
++bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool,
++                                          int in_fd,
++                                          int out_fd) {
+   // Look up the type.
+   const Descriptor* type = pool->FindMessageTypeByName(codec_type_);
+   if (type == NULL) {
+@@ -1995,15 +2048,15 @@
+   std::unique_ptr<Message> message(dynamic_factory.GetPrototype(type)->New());
+ 
+   if (mode_ == MODE_ENCODE) {
+-    SetFdToTextMode(STDIN_FILENO);
+-    SetFdToBinaryMode(STDOUT_FILENO);
++    SetFdToTextMode(in_fd);
++    SetFdToBinaryMode(out_fd);
+   } else {
+-    SetFdToBinaryMode(STDIN_FILENO);
+-    SetFdToTextMode(STDOUT_FILENO);
++    SetFdToBinaryMode(in_fd);
++    SetFdToTextMode(out_fd);
+   }
+ 
+-  io::FileInputStream in(STDIN_FILENO);
+-  io::FileOutputStream out(STDOUT_FILENO);
++  io::FileInputStream in(in_fd);
++  io::FileOutputStream out(out_fd);
+ 
+   if (mode_ == MODE_ENCODE) {
+     // Input is text.
+--- /src/google/protobuf/compiler/command_line_interface.h
++++ /src/google/protobuf/compiler/command_line_interface.h
+@@ -272,7 +272,9 @@
+       GeneratorContext* generator_context, string* error);
+ 
+   // Implements --encode and --decode.
+-  bool EncodeOrDecode(const DescriptorPool* pool);
++  bool EncodeOrDecode(const DescriptorPool* pool,
++                      int in_fd,
++                      int out_fd);
+ 
+   // Implements the --descriptor_set_out option.
+   bool WriteDescriptorSet(
+@@ -405,6 +407,13 @@
+   // parsed FileDescriptorSets to be used for loading protos.  Otherwise, empty.
+   std::vector<string> descriptor_set_in_names_;
+ 
++  // When using --encode / --decode / --decode_raw absolute path to the output
++  // file. (Empty string indicates write to STDOUT).
++  string protobuf_out_path_;
++  // When using --encode / --decode / --decode_raw, absolute path to the input
++  // file. (Empty string indicates read from STDIN).
++  string protobuf_in_path_;
++
+   // If --descriptor_set_out was given, this is the filename to which the
+   // FileDescriptorSet should be written.  Otherwise, empty.
+   string descriptor_set_out_name_;
+--- /src/google/protobuf/compiler/command_line_interface_unittest.cc
++++ /src/google/protobuf/compiler/command_line_interface_unittest.cc
+@@ -94,7 +94,7 @@
+   virtual void SetUp();
+   virtual void TearDown();
+ 
+-  // Runs the CommandLineInterface with the given command line.  The
++  // Run the CommandLineInterface with the given command line.  The
+   // command is automatically split on spaces, and the string "$tmpdir"
+   // is replaced with TestTempDir().
+   void Run(const string& command);
+@@ -2337,6 +2337,17 @@
+     EXPECT_EQ(StripCR(expected_text), StripCR(captured_stderr_));
+   }
+ 
++  void ExpectBinaryFilesMatch(const string &expected_file,
++                              const string &actual_file) {
++    string expected_output, actual_output;
++    ASSERT_TRUE(File::ReadFileToString(expected_file, &expected_output));
++    ASSERT_TRUE(File::ReadFileToString(actual_file, &actual_output));
++
++    // Don't use EXPECT_EQ because we don't want to print raw binary data to
++    // stdout on failure.
++    EXPECT_TRUE(expected_output == actual_output);
++  }
++
+  private:
+   void WriteUnittestProtoDescriptorSet() {
+     unittest_proto_descriptor_set_filename_ =
+@@ -2427,6 +2438,18 @@
+       "google/protobuf/no_such_file.proto: No such file or directory\n");
+ }
+ 
++TEST_P(EncodeDecodeTest, RedirectInputOutput) {
++  string out_file = TestTempDir() + "/golden_message_out.pbf";
++  string cmd = "";
++  cmd += "google/protobuf/unittest.proto ";
++  cmd += "--encode=protobuf_unittest.TestAllTypes ";
++  cmd += "--protobuf_in=" + TestSourceDir() +
++         "/google/protobuf/testdata/text_format_unittest_data_oneof_implemented.txt ";
++  cmd += "--protobuf_out=" + out_file;
++  EXPECT_TRUE(Run(cmd));
++  ExpectBinaryFilesMatch(out_file, TestSourceDir() + "/google/protobuf/testdata/golden_message_oneof_implemented");
++}
++
+ INSTANTIATE_TEST_CASE_P(FileDescriptorSetSource,
+                         EncodeDecodeTest,
+                         testing::Values(PROTO_PATH, DESCRIPTOR_SET_IN));

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
new file mode 100644
index 00000000000..b1408f050e0
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.6.0-system_libraries.patch
@@ -0,0 +1,121 @@
+--- /Makefile.am
++++ /Makefile.am
+@@ -11,28 +11,10 @@
+ # Always include third_party directories in distributions.
+ DIST_SUBDIRS = src conformance benchmarks third_party/googletest
+ 
+-# Build gmock before we build protobuf tests.  We don't add gmock to SUBDIRS
+-# because then "make check" would also build and run all of gmock's own tests,
+-# which takes a lot of time and is generally not useful to us.  Also, we don't
+-# want "make install" to recurse into gmock since we don't want to overwrite
+-# the installed version of gmock if there is one.
+ check-local:
+-	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
+-	@cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
+-	@cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
+ 
+-# We would like to clean gmock when "make clean" is invoked.  But we have to
+-# be careful because clean-local is also invoked during "make distclean", but
+-# "make distclean" already recurses into gmock because it's listed among the
+-# DIST_SUBDIRS.  distclean will delete gmock/Makefile, so if we then try to
+-# cd to the directory again and "make clean" it will fail.  So, check that the
+-# Makefile exists before recursing.
+ clean-local:
+-	@if test -e third_party/googletest/Makefile; then \
+-	  echo "Making clean in googletest"; \
+-	  cd third_party/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; \
+-	fi; \
+-	if test -e conformance/Makefile; then \
++	@if test -e conformance/Makefile; then \
+ 	  echo "Making clean in conformance"; \
+ 	  cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \
+ 	fi; \
+--- /configure.ac
++++ /configure.ac
+@@ -209,12 +209,5 @@
+ 
+ AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
+ 
+-# HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
+-#   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
+-#   too.
+-export CFLAGS
+-export CXXFLAGS
+-AC_CONFIG_SUBDIRS([third_party/googletest])
+-
+ AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
+ AC_OUTPUT
+--- /src/Makefile.am
++++ /src/Makefile.am
+@@ -711,19 +711,11 @@
+   google/protobuf/testing/file.cc                              \
+   google/protobuf/testing/file.h
+ 
+-GOOGLETEST_BUILD_DIR=../third_party/googletest/googletest
+-GOOGLEMOCK_BUILD_DIR=../third_party/googletest/googlemock
+-GOOGLETEST_SRC_DIR=$(srcdir)/../third_party/googletest/googletest
+-GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
+ check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
+                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
+                  $(GZCHECKPROGRAMS)
+ protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \
+-                         -I$(GOOGLEMOCK_SRC_DIR)/include
++                      -lgtest -lgmock -lgmock_main
+ # Disable optimization for tests unless the user explicitly asked for it,
+ # since test_util.cc takes forever to compile with optimization (with GCC).
+ # See configure.ac for more info.
+@@ -811,12 +803,8 @@
+ # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
+ protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
+                       libprotoc.la                                   \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
+-                                         -I$(GOOGLETEST_SRC_DIR)/include \
+-                                         -DPROTOBUF_TEST_NO_DESCRIPTORS
++                      -lgtest -lgmock -lgmock_main
++protobuf_lazy_descriptor_test_CPPFLAGS = -DPROTOBUF_TEST_NO_DESCRIPTORS
+ protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lazy_descriptor_test_SOURCES =                        \
+   google/protobuf/compiler/cpp/cpp_unittest.cc                 \
+@@ -837,11 +825,7 @@
+ # full runtime and we want to make sure this test builds without full
+ # runtime.
+ protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la     \
+-                           $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
+-                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
+-                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \
+-                             -I$(GOOGLETEST_SRC_DIR)/include
++                           -lgtest -lgmock -lgmock_main
+ protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lite_test_SOURCES =                                           \
+   google/protobuf/lite_unittest.cc                                     \
+@@ -853,11 +837,7 @@
+ # gtest when building the test internally our memory sanitizer doesn't detect
+ # memory leaks (don't know why).
+ protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include  \
+-                                    -I$(GOOGLETEST_SRC_DIR)/include
++                      -lgtest -lgmock -lgmock_main
+ protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lite_arena_test_SOURCES =       \
+   google/protobuf/lite_arena_unittest.cc \
+@@ -867,8 +847,7 @@
+ 
+ # Test plugin binary.
+ test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+-                    $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la
+-test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include
++                    -lgtest
+ test_plugin_SOURCES =                                          \
+   google/protobuf/compiler/mock_code_generator.cc              \
+   google/protobuf/testing/file.cc                              \

diff --git a/dev-libs/protobuf/protobuf-3.6.0.1.ebuild b/dev-libs/protobuf/protobuf-3.6.0.1.ebuild
new file mode 100644
index 00000000000..3153b8aa572
--- /dev/null
+++ b/dev-libs/protobuf/protobuf-3.6.0.1.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit autotools elisp-common flag-o-matic multilib-minimal toolchain-funcs
+
+DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing structured data"
+HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/google/protobuf"
+SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/16"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="emacs examples static-libs test zlib"
+
+RDEPEND="emacs? ( virtual/emacs )
+	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+	test? ( >=dev-cpp/gtest-1.8.0[${MULTILIB_USEDEP}] )"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-3.6.0-disable_no-warning-test.patch"
+	"${FILESDIR}/${PN}-3.6.0-system_libraries.patch"
+	"${FILESDIR}/${PN}-3.6.0-protoc_input_output_files.patch"
+)
+
+DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
+
+src_prepare() {
+	default
+	eautoreconf
+}
+
+src_configure() {
+	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local options=(
+		$(use_enable static-libs static)
+		$(use_with zlib)
+	)
+
+	if tc-is-cross-compiler; then
+		# Build system uses protoc when building, so protoc copy runnable on host is needed.
+		mkdir -p "${WORKDIR}/build" || die
+		pushd "${WORKDIR}/build" > /dev/null || die
+		ECONF_SOURCE="${S}" econf_build "${options[@]}"
+		options+=(--with-protoc="$(pwd)/src/protoc")
+		popd > /dev/null || die
+	fi
+
+	ECONF_SOURCE="${S}" econf "${options[@]}"
+}
+
+src_compile() {
+	multilib-minimal_src_compile
+
+	if use emacs; then
+		elisp-compile editors/protobuf-mode.el
+	fi
+}
+
+multilib_src_compile() {
+	if tc-is-cross-compiler; then
+		emake -C "${WORKDIR}/build/src" protoc
+	fi
+
+	default
+}
+
+multilib_src_test() {
+	emake check
+}
+
+multilib_src_install_all() {
+	find "${D}" -name "*.la" -delete || die
+
+	insinto /usr/share/vim/vimfiles/syntax
+	doins editors/proto.vim
+	insinto /usr/share/vim/vimfiles/ftdetect
+	doins "${FILESDIR}/proto.vim"
+
+	if use emacs; then
+		elisp-install ${PN} editors/protobuf-mode.el*
+		elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
+	fi
+
+	if use examples; then
+		DOCS+=(examples)
+		docompress -x /usr/share/doc/${PF}/examples
+	fi
+
+	einstalldocs
+}
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+}


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2019-04-19 16:39 Mike Gilbert
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Gilbert @ 2019-04-19 16:39 UTC (permalink / raw
  To: gentoo-commits

commit:     78245b85a8d6b58f97f27a0bdb9526f2052fa7d0
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Apr 18 19:16:35 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Apr 19 16:39:07 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78245b85

dev-libs/protobuf: Add live ebuild.

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 .../protobuf-3.8.0-protoc_input_output_files.patch | 262 +++++++++++++++++++++
 dev-libs/protobuf/protobuf-9999.ebuild             | 118 ++++++++++
 2 files changed, 380 insertions(+)

diff --git a/dev-libs/protobuf/files/protobuf-3.8.0-protoc_input_output_files.patch b/dev-libs/protobuf/files/protobuf-3.8.0-protoc_input_output_files.patch
new file mode 100644
index 00000000000..a60bd74f39a
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.8.0-protoc_input_output_files.patch
@@ -0,0 +1,262 @@
+https://github.com/protocolbuffers/protobuf/pull/235
+
+--- /src/google/protobuf/compiler/command_line_interface.cc
++++ /src/google/protobuf/compiler/command_line_interface.cc
+@@ -949,6 +949,28 @@
+   }
+ 
+   if (mode_ == MODE_ENCODE || mode_ == MODE_DECODE) {
++    bool success = false;
++    int in_fd = STDIN_FILENO;
++    int out_fd = STDOUT_FILENO;
++
++    if (!protobuf_in_path_.empty()) {
++      in_fd = open(protobuf_in_path_.c_str(), O_RDONLY);
++      if (in_fd == -1) {
++        std::cerr << protobuf_in_path_ << ": error: failed to open file." << std::endl;
++        return 1;
++      }
++    }
++    if (!protobuf_out_path_.empty()) {
++      out_fd = open(protobuf_out_path_.c_str(),
++                    O_WRONLY | O_CREAT | O_TRUNC,
++                    0644);
++      if (out_fd == -1) {
++        std::cerr << protobuf_out_path_ << ": error: failed to open file." << std::endl;
++        close(in_fd);
++        return 1;
++      }
++    }
++
+     if (codec_type_.empty()) {
+       // HACK:  Define an EmptyMessage type to use for decoding.
+       DescriptorPool pool;
+@@ -957,13 +979,20 @@
+       file.add_message_type()->set_name("EmptyMessage");
+       GOOGLE_CHECK(pool.BuildFile(file) != NULL);
+       codec_type_ = "EmptyMessage";
+-      if (!EncodeOrDecode(&pool)) {
+-        return 1;
+-      }
++      success = EncodeOrDecode(&pool, in_fd, out_fd);
+     } else {
+-      if (!EncodeOrDecode(descriptor_pool.get())) {
+-        return 1;
+-      }
++      success = EncodeOrDecode(descriptor_pool.get(), in_fd, out_fd);
++    }
++
++    if (in_fd != STDIN_FILENO) {
++      close(in_fd);
++    }
++    if (out_fd != STDOUT_FILENO) {
++      close(out_fd);
++    }
++
++    if (!success) {
++      return 1;
+     }
+   }
+ 
+@@ -1001,6 +1030,11 @@
+   for (int i = 0; i < proto_path_.size(); i++) {
+     source_tree->MapPath(proto_path_[i].first, proto_path_[i].second);
+   }
++  if (mode_ == MODE_COMPILE &&
++      (!protobuf_in_path_.empty() || !protobuf_out_path_.empty())) {
++    std::cerr << "--protobuf_in and --protobuf_out are only valid with "
++         << "decode operations. Ignoring.";
++  }
+ 
+   // Map input files to virtual paths if possible.
+   if (!MakeInputsBeProtoPathRelative(source_tree, fallback_database)) {
+@@ -1627,6 +1661,12 @@
+ 
+     codec_type_ = value;
+ 
++  } else if (name == "--protobuf_in") {
++    protobuf_in_path_ = value;
++
++  } else if (name == "--protobuf_out") {
++    protobuf_out_path_ = value;
++
+   } else if (name == "--error_format") {
+     if (value == "gcc") {
+       error_format_ = ERROR_FORMAT_GCC;
+@@ -1763,29 +1803,50 @@
+          "  -h, --help                  Show this text and exit.\n"
+          "  --encode=MESSAGE_TYPE       Read a text-format message of the "
+          "given type\n"
+-         "                              from standard input and write it in "
+-         "binary\n"
+-         "                              to standard output.  The message type "
+-         "must\n"
++         "                              and write it in binary.  The message "
++         "type must\n"
+          "                              be defined in PROTO_FILES or their "
+          "imports.\n"
++         "                              The input/output protobuf files are "
++         "specified\n"
++         "                              using the --protobuf_in and "
++         "--protobuf_out\n"
++         "                              command line flags.\n"
+          "  --decode=MESSAGE_TYPE       Read a binary message of the given "
+-         "type from\n"
+-         "                              standard input and write it in text "
+-         "format\n"
+-         "                              to standard output.  The message type "
+-         "must\n"
+-         "                              be defined in PROTO_FILES or their "
+-         "imports.\n"
++         "type and\n"
++         "                              write it in text format.  The message "
++         "type\n"
++         "                              must be defined in PROTO_FILES or "
++         "their imports.\n"
++         "                              The input/output protobuf files are "
++         "specified\n"
++         "                              using the --protobuf_in and "
++         "--protobuf_out\n"
++         "                              command line flags.\n"
+          "  --decode_raw                Read an arbitrary protocol message "
+-         "from\n"
+-         "                              standard input and write the raw "
+-         "tag/value\n"
+-         "                              pairs in text format to standard "
+-         "output.  No\n"
++         "and write\n"
++         "                              the raw tag/value pairs in text format."
++         "  No\n"
+          "                              PROTO_FILES should be given when using "
+          "this\n"
+-         "                              flag.\n"
++         "                              flag.  The input/output protobuf files "
++         "are\n"
++         "                              specified using the --protobuf_in and\n"
++         "                              --protobuf_out command line flags.\n"
++         "  --protobuf_in=FILE          Absolute path to the protobuf file "
++         "from which\n"
++         "                              input of encoding/decoding operation "
++         "will be\n"
++         "                              read.  If omitted, input will be read "
++         "from\n"
++         "                              standard input.\n"
++         "  --protobuf_out=FILE         Absolute path to the protobuf file "
++         "to which\n"
++         "                              output of encoding/decoding operation "
++         "will be\n"
++         "                              written.  If omitted, output will be "
++         "written to\n"
++         "                              standard output.\n"
+          "  --descriptor_set_in=FILES   Specifies a delimited list of FILES\n"
+          "                              each containing a FileDescriptorSet "
+          "(a\n"
+@@ -2101,7 +2162,9 @@
+   return true;
+ }
+ 
+-bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool) {
++bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool,
++                                          int in_fd,
++                                          int out_fd) {
+   // Look up the type.
+   const Descriptor* type = pool->FindMessageTypeByName(codec_type_);
+   if (type == NULL) {
+@@ -2113,15 +2176,15 @@
+   std::unique_ptr<Message> message(dynamic_factory.GetPrototype(type)->New());
+ 
+   if (mode_ == MODE_ENCODE) {
+-    SetFdToTextMode(STDIN_FILENO);
+-    SetFdToBinaryMode(STDOUT_FILENO);
++    SetFdToTextMode(in_fd);
++    SetFdToBinaryMode(out_fd);
+   } else {
+-    SetFdToBinaryMode(STDIN_FILENO);
+-    SetFdToTextMode(STDOUT_FILENO);
++    SetFdToBinaryMode(in_fd);
++    SetFdToTextMode(out_fd);
+   }
+ 
+-  io::FileInputStream in(STDIN_FILENO);
+-  io::FileOutputStream out(STDOUT_FILENO);
++  io::FileInputStream in(in_fd);
++  io::FileOutputStream out(out_fd);
+ 
+   if (mode_ == MODE_ENCODE) {
+     // Input is text.
+--- /src/google/protobuf/compiler/command_line_interface.h
++++ /src/google/protobuf/compiler/command_line_interface.h
+@@ -286,7 +286,9 @@
+       GeneratorContext* generator_context, std::string* error);
+ 
+   // Implements --encode and --decode.
+-  bool EncodeOrDecode(const DescriptorPool* pool);
++  bool EncodeOrDecode(const DescriptorPool* pool,
++                      int in_fd,
++                      int out_fd);
+ 
+   // Implements the --descriptor_set_out option.
+   bool WriteDescriptorSet(
+@@ -418,6 +420,13 @@
+   // parsed FileDescriptorSets to be used for loading protos.  Otherwise, empty.
+   std::vector<std::string> descriptor_set_in_names_;
+ 
++  // When using --encode / --decode / --decode_raw absolute path to the output
++  // file. (Empty string indicates write to STDOUT).
++  std::string protobuf_out_path_;
++  // When using --encode / --decode / --decode_raw, absolute path to the input
++  // file. (Empty string indicates read from STDIN).
++  std::string protobuf_in_path_;
++
+   // If --descriptor_set_out was given, this is the filename to which the
+   // FileDescriptorSet should be written.  Otherwise, empty.
+   std::string descriptor_set_out_name_;
+--- /src/google/protobuf/compiler/command_line_interface_unittest.cc
++++ /src/google/protobuf/compiler/command_line_interface_unittest.cc
+@@ -95,7 +95,7 @@
+   virtual void SetUp();
+   virtual void TearDown();
+ 
+-  // Runs the CommandLineInterface with the given command line.  The
++  // Run the CommandLineInterface with the given command line.  The
+   // command is automatically split on spaces, and the string "$tmpdir"
+   // is replaced with TestTempDir().
+   void Run(const std::string& command);
+@@ -2337,6 +2337,17 @@
+     EXPECT_EQ(StripCR(expected_text), StripCR(captured_stderr_));
+   }
+ 
++  void ExpectBinaryFilesMatch(const string &expected_file,
++                              const string &actual_file) {
++    string expected_output, actual_output;
++    ASSERT_TRUE(File::ReadFileToString(expected_file, &expected_output));
++    ASSERT_TRUE(File::ReadFileToString(actual_file, &actual_output));
++
++    // Don't use EXPECT_EQ because we don't want to print raw binary data to
++    // stdout on failure.
++    EXPECT_TRUE(expected_output == actual_output);
++  }
++
+  private:
+   void WriteUnittestProtoDescriptorSet() {
+     unittest_proto_descriptor_set_filename_ =
+@@ -2431,6 +2442,19 @@
+       "net/proto2/internal/no_such_file.proto: No such file or directory\n");
+ }
+ 
++TEST_P(EncodeDecodeTest, RedirectInputOutput) {
++  string out_file = TestTempDir() + "/golden_message_out.pbf";
++  EXPECT_TRUE(
++      Run(TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto") +
++          " --encode=protobuf_unittest.TestAllTypes" +
++          " --protobuf_in=" + TestUtil::GetTestDataPath(
++              "net/proto2/internal/"
++              "testdata/text_format_unittest_data_oneof_implemented.txt") +
++          " --protobuf_out=" + out_file));
++  ExpectBinaryFilesMatch(out_file, TestUtil::GetTestDataPath(
++      "net/proto2/internal/testdata/golden_message_oneof_implemented"));
++}
++
+ INSTANTIATE_TEST_SUITE_P(FileDescriptorSetSource, EncodeDecodeTest,
+                          testing::Values(PROTO_PATH, DESCRIPTOR_SET_IN));
+ }  // anonymous namespace

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-9999.ebuild
new file mode 100644
index 00000000000..ab63263883b
--- /dev/null
+++ b/dev-libs/protobuf/protobuf-9999.ebuild
@@ -0,0 +1,118 @@
+# Copyright 2008-2019 Arfrever Frehtes Taifersar Arahesis and others
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+inherit autotools elisp-common flag-o-matic multilib-minimal toolchain-funcs
+
+if [[ "${PV}" == "9999" ]]; then
+	inherit git-r3
+
+	EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf"
+	EGIT_SUBMODULES=()
+fi
+
+DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing structured data"
+HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
+if [[ "${PV}" == "9999" ]]; then
+	SRC_URI=""
+else
+	SRC_URI="https://github.com/protocolbuffers/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+fi
+
+LICENSE="BSD"
+SLOT="0/18"
+KEYWORDS=""
+IUSE="emacs examples static-libs test zlib"
+RESTRICT="!test? ( test )"
+
+BDEPEND="emacs? ( virtual/emacs )"
+DEPEND="test? ( >=dev-cpp/gtest-1.8.0[${MULTILIB_USEDEP}] )
+	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
+RDEPEND="emacs? ( virtual/emacs )
+	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-3.7.0-disable_no-warning-test.patch"
+	"${FILESDIR}/${PN}-3.7.1-system_libraries.patch"
+	"${FILESDIR}/${PN}-3.8.0-protoc_input_output_files.patch"
+)
+
+DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
+
+src_prepare() {
+	default
+	eautoreconf
+}
+
+src_configure() {
+	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local options=(
+		$(use_enable static-libs static)
+		$(use_with zlib)
+	)
+
+	if tc-is-cross-compiler; then
+		# Build system uses protoc when building, so protoc copy runnable on host is needed.
+		mkdir -p "${WORKDIR}/build" || die
+		pushd "${WORKDIR}/build" > /dev/null || die
+		ECONF_SOURCE="${S}" econf_build "${options[@]}"
+		options+=(--with-protoc="$(pwd)/src/protoc")
+		popd > /dev/null || die
+	fi
+
+	ECONF_SOURCE="${S}" econf "${options[@]}"
+}
+
+src_compile() {
+	multilib-minimal_src_compile
+
+	if use emacs; then
+		elisp-compile editors/protobuf-mode.el
+	fi
+}
+
+multilib_src_compile() {
+	if tc-is-cross-compiler; then
+		emake -C "${WORKDIR}/build/src" protoc
+	fi
+
+	default
+}
+
+multilib_src_test() {
+	emake check
+}
+
+multilib_src_install_all() {
+	find "${D}" -name "*.la" -delete || die
+
+	insinto /usr/share/vim/vimfiles/syntax
+	doins editors/proto.vim
+	insinto /usr/share/vim/vimfiles/ftdetect
+	doins "${FILESDIR}/proto.vim"
+
+	if use emacs; then
+		elisp-install ${PN} editors/protobuf-mode.el*
+		elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
+	fi
+
+	if use examples; then
+		DOCS+=(examples)
+		docompress -x /usr/share/doc/${PF}/examples
+	fi
+
+	einstalldocs
+}
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+}


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2019-04-19 16:39 Mike Gilbert
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Gilbert @ 2019-04-19 16:39 UTC (permalink / raw
  To: gentoo-commits

commit:     c9478e3527ea47a3f080c7fabb90ab5a0b0102ea
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Apr 18 19:12:09 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Apr 19 16:39:07 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9478e35

dev-libs/protobuf: Version bump (3.7.1).

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 dev-libs/protobuf/Manifest                         |   1 +
 .../protobuf-3.7.0-disable_no-warning-test.patch   |  19 ++
 .../protobuf-3.7.0-protoc_input_output_files.patch | 236 +++++++++++++++++++++
 .../files/protobuf-3.7.1-system_libraries.patch    | 121 +++++++++++
 dev-libs/protobuf/protobuf-3.7.1.ebuild            | 118 +++++++++++
 5 files changed, 495 insertions(+)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index ac2f8a09268..766a6d89f8d 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -1 +1,2 @@
 DIST protobuf-3.6.1.3.tar.gz 4490599 BLAKE2B 5a058f937330bd562e364a8d86e0b1376fdac9fded0fd23d6914cb59c5c15e8bfc1e203ea36b5a4eece8919708c1a9a6616b0ec2028d6ec339704da53ed81963 SHA512 9eadb46c7daa19e612516958169bc90943b38b429a4b2cf2171b66b57f50a2f8a9b66cbf58bdd44517af414b78e0f3ab2e1361891dc60ecd098185da2638d37e
+DIST protobuf-3.7.1.tar.gz 4795774 BLAKE2B a91155169623ee24ba49e397b151829321c01ff06bb27541e6c02701c37ac96ea9606961291ef0d4616dd6dba045bf7e893ec6288f5809d30cc026b60ae76590 SHA512 7d4cfabd4bd55926336a3baafa0bc1f1f15380b1b2af945f70a2bb3ba24c6ac6567f49c492326d6d1c43a488166bff178f9266377758a05d8541d8b242f4f80f

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
new file mode 100644
index 00000000000..eadde9c04dc
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.7.0-disable_no-warning-test.patch
@@ -0,0 +1,19 @@
+Disable no-warning-test which is compiled with -Werror option and whose only purpose is checking if compilation results in any warnings.
+
+--- /src/Makefile.am
++++ /src/Makefile.am
+@@ -709,7 +709,7 @@
+ GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
+ check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
+                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
+-                 no-warning-test $(GZCHECKPROGRAMS)
++                 $(GZCHECKPROGRAMS)
+ protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+                       $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
+                       $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
+@@ -893,4 +893,4 @@
+ 
+ TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
+         google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS)     \
+-        protobuf-lite-arena-test no-warning-test
++        protobuf-lite-arena-test

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
new file mode 100644
index 00000000000..54daa6de4ed
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.7.0-protoc_input_output_files.patch
@@ -0,0 +1,236 @@
+https://github.com/protocolbuffers/protobuf/pull/235
+
+--- /src/google/protobuf/compiler/command_line_interface.cc
++++ /src/google/protobuf/compiler/command_line_interface.cc
+@@ -951,6 +951,28 @@
+   }
+ 
+   if (mode_ == MODE_ENCODE || mode_ == MODE_DECODE) {
++    bool success = false;
++    int in_fd = STDIN_FILENO;
++    int out_fd = STDOUT_FILENO;
++
++    if (!protobuf_in_path_.empty()) {
++      in_fd = open(protobuf_in_path_.c_str(), O_RDONLY);
++      if (in_fd == -1) {
++        std::cerr << protobuf_in_path_ << ": error: failed to open file." << std::endl;
++        return 1;
++      }
++    }
++    if (!protobuf_out_path_.empty()) {
++      out_fd = open(protobuf_out_path_.c_str(),
++                    O_WRONLY | O_CREAT | O_TRUNC,
++                    0644);
++      if (out_fd == -1) {
++        std::cerr << protobuf_out_path_ << ": error: failed to open file." << std::endl;
++        close(in_fd);
++        return 1;
++      }
++    }
++
+     if (codec_type_.empty()) {
+       // HACK:  Define an EmptyMessage type to use for decoding.
+       DescriptorPool pool;
+@@ -959,13 +981,20 @@
+       file.add_message_type()->set_name("EmptyMessage");
+       GOOGLE_CHECK(pool.BuildFile(file) != NULL);
+       codec_type_ = "EmptyMessage";
+-      if (!EncodeOrDecode(&pool)) {
+-        return 1;
+-      }
++      success = EncodeOrDecode(&pool, in_fd, out_fd);
+     } else {
+-      if (!EncodeOrDecode(descriptor_pool.get())) {
+-        return 1;
+-      }
++      success = EncodeOrDecode(descriptor_pool.get(), in_fd, out_fd);
++    }
++
++    if (in_fd != STDIN_FILENO) {
++      close(in_fd);
++    }
++    if (out_fd != STDOUT_FILENO) {
++      close(out_fd);
++    }
++
++    if (!success) {
++      return 1;
+     }
+   }
+ 
+@@ -1003,6 +1032,11 @@
+   for (int i = 0; i < proto_path_.size(); i++) {
+     source_tree->MapPath(proto_path_[i].first, proto_path_[i].second);
+   }
++  if (mode_ == MODE_COMPILE &&
++      (!protobuf_in_path_.empty() || !protobuf_out_path_.empty())) {
++    std::cerr << "--protobuf_in and --protobuf_out are only valid with "
++         << "decode operations. Ignoring.";
++  }
+ 
+   // Map input files to virtual paths if possible.
+   if (!MakeInputsBeProtoPathRelative(source_tree, fallback_database)) {
+@@ -1622,6 +1656,12 @@
+ 
+     codec_type_ = value;
+ 
++  } else if (name == "--protobuf_in") {
++    protobuf_in_path_ = value;
++
++  } else if (name == "--protobuf_out") {
++    protobuf_out_path_ = value;
++
+   } else if (name == "--error_format") {
+     if (value == "gcc") {
+       error_format_ = ERROR_FORMAT_GCC;
+@@ -1749,18 +1789,31 @@
+ "  --version                   Show version info and exit.\n"
+ "  -h, --help                  Show this text and exit.\n"
+ "  --encode=MESSAGE_TYPE       Read a text-format message of the given type\n"
+-"                              from standard input and write it in binary\n"
+-"                              to standard output.  The message type must\n"
+-"                              be defined in PROTO_FILES or their imports.\n"
+-"  --decode=MESSAGE_TYPE       Read a binary message of the given type from\n"
+-"                              standard input and write it in text format\n"
+-"                              to standard output.  The message type must\n"
++"                              and write it in binary.  The message type must\n"
+ "                              be defined in PROTO_FILES or their imports.\n"
+-"  --decode_raw                Read an arbitrary protocol message from\n"
+-"                              standard input and write the raw tag/value\n"
+-"                              pairs in text format to standard output.  No\n"
++"                              The input/output protobuf files are specified\n"
++"                              using the --protobuf_in and --protobuf_out\n"
++"                              command line flags.\n"
++"  --decode=MESSAGE_TYPE       Read a binary message of the given type and\n"
++"                              write it in text format.  The message type\n"
++"                              must be defined in PROTO_FILES or their imports.\n"
++"                              The input/output protobuf files are specified\n"
++"                              using the --protobuf_in and --protobuf_out\n"
++"                              command line flags.\n"
++"  --decode_raw                Read an arbitrary protocol message and write\n"
++"                              the raw tag/value pairs in text format.  No\n"
+ "                              PROTO_FILES should be given when using this\n"
+-"                              flag.\n"
++"                              flag.  The input/output protobuf files are\n"
++"                              specified using the --protobuf_in and\n"
++"                              --protobuf_out command line flags.\n"
++"  --protobuf_in=FILE          Absolute path to the protobuf file from which\n"
++"                              input of encoding/decoding operation will be\n"
++"                              read.  If omitted, input will be read from\n"
++"                              standard input.\n"
++"  --protobuf_out=FILE         Absolute path to the protobuf file to which\n"
++"                              output of encoding/decoding operation will be\n"
++"                              written.  If omitted, output will be written to\n"
++"                              standard output.\n"
+ "  --descriptor_set_in=FILES   Specifies a delimited list of FILES\n"
+ "                              each containing a FileDescriptorSet (a\n"
+ "                              protocol buffer defined in descriptor.proto).\n"
+@@ -2039,7 +2092,9 @@
+   return true;
+ }
+ 
+-bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool) {
++bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool,
++                                          int in_fd,
++                                          int out_fd) {
+   // Look up the type.
+   const Descriptor* type = pool->FindMessageTypeByName(codec_type_);
+   if (type == NULL) {
+@@ -2051,15 +2106,15 @@
+   std::unique_ptr<Message> message(dynamic_factory.GetPrototype(type)->New());
+ 
+   if (mode_ == MODE_ENCODE) {
+-    SetFdToTextMode(STDIN_FILENO);
+-    SetFdToBinaryMode(STDOUT_FILENO);
++    SetFdToTextMode(in_fd);
++    SetFdToBinaryMode(out_fd);
+   } else {
+-    SetFdToBinaryMode(STDIN_FILENO);
+-    SetFdToTextMode(STDOUT_FILENO);
++    SetFdToBinaryMode(in_fd);
++    SetFdToTextMode(out_fd);
+   }
+ 
+-  io::FileInputStream in(STDIN_FILENO);
+-  io::FileOutputStream out(STDOUT_FILENO);
++  io::FileInputStream in(in_fd);
++  io::FileOutputStream out(out_fd);
+ 
+   if (mode_ == MODE_ENCODE) {
+     // Input is text.
+--- /src/google/protobuf/compiler/command_line_interface.h
++++ /src/google/protobuf/compiler/command_line_interface.h
+@@ -285,7 +285,9 @@
+       GeneratorContext* generator_context, std::string* error);
+ 
+   // Implements --encode and --decode.
+-  bool EncodeOrDecode(const DescriptorPool* pool);
++  bool EncodeOrDecode(const DescriptorPool* pool,
++                      int in_fd,
++                      int out_fd);
+ 
+   // Implements the --descriptor_set_out option.
+   bool WriteDescriptorSet(
+@@ -418,6 +420,13 @@
+   // parsed FileDescriptorSets to be used for loading protos.  Otherwise, empty.
+   std::vector<std::string> descriptor_set_in_names_;
+ 
++  // When using --encode / --decode / --decode_raw absolute path to the output
++  // file. (Empty string indicates write to STDOUT).
++  std::string protobuf_out_path_;
++  // When using --encode / --decode / --decode_raw, absolute path to the input
++  // file. (Empty string indicates read from STDIN).
++  std::string protobuf_in_path_;
++
+   // If --descriptor_set_out was given, this is the filename to which the
+   // FileDescriptorSet should be written.  Otherwise, empty.
+   std::string descriptor_set_out_name_;
+--- /src/google/protobuf/compiler/command_line_interface_unittest.cc
++++ /src/google/protobuf/compiler/command_line_interface_unittest.cc
+@@ -95,7 +95,7 @@
+   virtual void SetUp();
+   virtual void TearDown();
+ 
+-  // Runs the CommandLineInterface with the given command line.  The
++  // Run the CommandLineInterface with the given command line.  The
+   // command is automatically split on spaces, and the string "$tmpdir"
+   // is replaced with TestTempDir().
+   void Run(const string& command);
+@@ -2367,6 +2367,17 @@
+     EXPECT_EQ(StripCR(expected_text), StripCR(captured_stderr_));
+   }
+ 
++  void ExpectBinaryFilesMatch(const string &expected_file,
++                              const string &actual_file) {
++    string expected_output, actual_output;
++    ASSERT_TRUE(File::ReadFileToString(expected_file, &expected_output));
++    ASSERT_TRUE(File::ReadFileToString(actual_file, &actual_output));
++
++    // Don't use EXPECT_EQ because we don't want to print raw binary data to
++    // stdout on failure.
++    EXPECT_TRUE(expected_output == actual_output);
++  }
++
+  private:
+   void WriteUnittestProtoDescriptorSet() {
+     unittest_proto_descriptor_set_filename_ =
+@@ -2463,6 +2474,19 @@
+       "net/proto2/internal/no_such_file.proto: No such file or directory\n");
+ }
+ 
++TEST_P(EncodeDecodeTest, RedirectInputOutput) {
++  string out_file = TestTempDir() + "/golden_message_out.pbf";
++  EXPECT_TRUE(
++      Run(TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto") +
++          " --encode=protobuf_unittest.TestAllTypes" +
++          " --protobuf_in=" + TestUtil::GetTestDataPath(
++              "net/proto2/internal/"
++              "testdata/text_format_unittest_data_oneof_implemented.txt") +
++          " --protobuf_out=" + out_file));
++  ExpectBinaryFilesMatch(out_file, TestUtil::GetTestDataPath(
++      "net/proto2/internal/testdata/golden_message_oneof_implemented"));
++}
++
+ INSTANTIATE_TEST_CASE_P(FileDescriptorSetSource,
+                         EncodeDecodeTest,
+                         testing::Values(PROTO_PATH, DESCRIPTOR_SET_IN));

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
new file mode 100644
index 00000000000..3ae92e2b87a
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.7.1-system_libraries.patch
@@ -0,0 +1,121 @@
+--- /Makefile.am
++++ /Makefile.am
+@@ -11,28 +11,10 @@
+ # Always include third_party directories in distributions.
+ DIST_SUBDIRS = src conformance benchmarks third_party/googletest
+ 
+-# Build gmock before we build protobuf tests.  We don't add gmock to SUBDIRS
+-# because then "make check" would also build and run all of gmock's own tests,
+-# which takes a lot of time and is generally not useful to us.  Also, we don't
+-# want "make install" to recurse into gmock since we don't want to overwrite
+-# the installed version of gmock if there is one.
+ check-local:
+-	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
+-	@cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
+-	@cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
+ 
+-# We would like to clean gmock when "make clean" is invoked.  But we have to
+-# be careful because clean-local is also invoked during "make distclean", but
+-# "make distclean" already recurses into gmock because it's listed among the
+-# DIST_SUBDIRS.  distclean will delete gmock/Makefile, so if we then try to
+-# cd to the directory again and "make clean" it will fail.  So, check that the
+-# Makefile exists before recursing.
+ clean-local:
+-	@if test -e third_party/googletest/Makefile; then \
+-	  echo "Making clean in googletest"; \
+-	  cd third_party/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; \
+-	fi; \
+-	if test -e conformance/Makefile; then \
++	@if test -e conformance/Makefile; then \
+ 	  echo "Making clean in conformance"; \
+ 	  cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \
+ 	fi; \
+--- /configure.ac
++++ /configure.ac
+@@ -218,12 +218,5 @@
+ esac
+ AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1])
+ 
+-# HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
+-#   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
+-#   too.
+-export CFLAGS
+-export CXXFLAGS
+-AC_CONFIG_SUBDIRS([third_party/googletest])
+-
+ AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
+ AC_OUTPUT
+--- /src/Makefile.am
++++ /src/Makefile.am
+@@ -703,19 +703,11 @@
+   google/protobuf/testing/file.cc                              \
+   google/protobuf/testing/file.h
+ 
+-GOOGLETEST_BUILD_DIR=../third_party/googletest/googletest
+-GOOGLEMOCK_BUILD_DIR=../third_party/googletest/googlemock
+-GOOGLETEST_SRC_DIR=$(srcdir)/../third_party/googletest/googletest
+-GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
+ check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
+                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
+                  $(GZCHECKPROGRAMS)
+ protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \
+-                         -I$(GOOGLEMOCK_SRC_DIR)/include
++                      -lgtest -lgmock -lgmock_main
+ # Disable optimization for tests unless the user explicitly asked for it,
+ # since test_util.cc takes forever to compile with optimization (with GCC).
+ # See configure.ac for more info.
+@@ -804,12 +796,8 @@
+ # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
+ protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
+                       libprotoc.la                                   \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
+-                                         -I$(GOOGLETEST_SRC_DIR)/include \
+-                                         -DPROTOBUF_TEST_NO_DESCRIPTORS
++                      -lgtest -lgmock -lgmock_main
++protobuf_lazy_descriptor_test_CPPFLAGS = -DPROTOBUF_TEST_NO_DESCRIPTORS
+ protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lazy_descriptor_test_SOURCES =                        \
+   google/protobuf/compiler/cpp/cpp_unittest.cc                 \
+@@ -830,11 +818,7 @@
+ # full runtime and we want to make sure this test builds without full
+ # runtime.
+ protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la     \
+-                           $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
+-                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
+-                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \
+-                             -I$(GOOGLETEST_SRC_DIR)/include
++                           -lgtest -lgmock -lgmock_main
+ protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lite_test_SOURCES =                                           \
+   google/protobuf/lite_unittest.cc                                     \
+@@ -846,11 +830,7 @@
+ # gtest when building the test internally our memory sanitizer doesn't detect
+ # memory leaks (don't know why).
+ protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include  \
+-                                    -I$(GOOGLETEST_SRC_DIR)/include
++                      -lgtest -lgmock -lgmock_main
+ protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lite_arena_test_SOURCES =       \
+   google/protobuf/lite_arena_unittest.cc \
+@@ -860,8 +840,7 @@
+ 
+ # Test plugin binary.
+ test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+-                    $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la
+-test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include
++                    -lgtest
+ test_plugin_SOURCES =                                          \
+   google/protobuf/compiler/mock_code_generator.cc              \
+   google/protobuf/testing/file.cc                              \

diff --git a/dev-libs/protobuf/protobuf-3.7.1.ebuild b/dev-libs/protobuf/protobuf-3.7.1.ebuild
new file mode 100644
index 00000000000..f28a36c024b
--- /dev/null
+++ b/dev-libs/protobuf/protobuf-3.7.1.ebuild
@@ -0,0 +1,118 @@
+# Copyright 2008-2019 Arfrever Frehtes Taifersar Arahesis and others
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+inherit autotools elisp-common flag-o-matic multilib-minimal toolchain-funcs
+
+if [[ "${PV}" == "9999" ]]; then
+	inherit git-r3
+
+	EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf"
+	EGIT_SUBMODULES=()
+fi
+
+DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing structured data"
+HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
+if [[ "${PV}" == "9999" ]]; then
+	SRC_URI=""
+else
+	SRC_URI="https://github.com/protocolbuffers/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+fi
+
+LICENSE="BSD"
+SLOT="0/18"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="emacs examples static-libs test zlib"
+RESTRICT="!test? ( test )"
+
+BDEPEND="emacs? ( virtual/emacs )"
+DEPEND="test? ( >=dev-cpp/gtest-1.8.0[${MULTILIB_USEDEP}] )
+	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
+RDEPEND="emacs? ( virtual/emacs )
+	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-3.7.0-disable_no-warning-test.patch"
+	"${FILESDIR}/${PN}-3.7.1-system_libraries.patch"
+	"${FILESDIR}/${PN}-3.7.0-protoc_input_output_files.patch"
+)
+
+DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
+
+src_prepare() {
+	default
+	eautoreconf
+}
+
+src_configure() {
+	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local options=(
+		$(use_enable static-libs static)
+		$(use_with zlib)
+	)
+
+	if tc-is-cross-compiler; then
+		# Build system uses protoc when building, so protoc copy runnable on host is needed.
+		mkdir -p "${WORKDIR}/build" || die
+		pushd "${WORKDIR}/build" > /dev/null || die
+		ECONF_SOURCE="${S}" econf_build "${options[@]}"
+		options+=(--with-protoc="$(pwd)/src/protoc")
+		popd > /dev/null || die
+	fi
+
+	ECONF_SOURCE="${S}" econf "${options[@]}"
+}
+
+src_compile() {
+	multilib-minimal_src_compile
+
+	if use emacs; then
+		elisp-compile editors/protobuf-mode.el
+	fi
+}
+
+multilib_src_compile() {
+	if tc-is-cross-compiler; then
+		emake -C "${WORKDIR}/build/src" protoc
+	fi
+
+	default
+}
+
+multilib_src_test() {
+	emake check
+}
+
+multilib_src_install_all() {
+	find "${D}" -name "*.la" -delete || die
+
+	insinto /usr/share/vim/vimfiles/syntax
+	doins editors/proto.vim
+	insinto /usr/share/vim/vimfiles/ftdetect
+	doins "${FILESDIR}/proto.vim"
+
+	if use emacs; then
+		elisp-install ${PN} editors/protobuf-mode.el*
+		elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
+	fi
+
+	if use examples; then
+		DOCS+=(examples)
+		docompress -x /usr/share/doc/${PF}/examples
+	fi
+
+	einstalldocs
+}
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+}


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2019-12-29 19:34 Mike Gilbert
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Gilbert @ 2019-12-29 19:34 UTC (permalink / raw
  To: gentoo-commits

commit:     20e78d282cc777dd80bbca0999a6f9c04217506d
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Dec 23 20:43:39 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Dec 29 19:31:31 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20e78d28

dev-libs/protobuf: Version bump (3.11.2).

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 dev-libs/protobuf/Manifest                         |   1 +
 .../protobuf-3.11.0-disable_no-warning-test.patch  |  19 ++
 ...protobuf-3.11.0-protoc_input_output_files.patch | 262 +++++++++++++++++++++
 .../files/protobuf-3.11.0-system_libraries.patch   | 121 ++++++++++
 ...protobuf-9999.ebuild => protobuf-3.11.2.ebuild} |  18 +-
 dev-libs/protobuf/protobuf-9999.ebuild             |  10 +-
 6 files changed, 420 insertions(+), 11 deletions(-)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index 7a362466e88..15ae0824bb2 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -1,4 +1,5 @@
 DIST protobuf-3.10.1.tar.gz 4905995 BLAKE2B 1dde3b6260918da8430c2ce69210462f339c492b2a4e53d5d9c1bea3747aead905370507fc4bd703560f6885c0f3f8393a998b875c19744ad94827109ecbb49f SHA512 aba0c4034c0d3b1759904adb6270eee94dd5dc568f433b219e3f1f70c0033993cdfa3bf476ad3f5767c7629edb9fd029c686405abf93731dde808286b336330d
+DIST protobuf-3.11.2.tar.gz 5133897 BLAKE2B 275ea52a072b4e0226e4b6dc476d4bc28e8f4f05bca0709eab51da91c02869e96c3b0ac9ab4cc46290f875d4eac6ac72374c5b45e27fa89ad3d58fd56a2c8b7e SHA512 8319c1e003e5fc64e91b512de016ec1cf10265b294d3b4beea60856beaeb02b4d7682343c74b2c12b0f6d4d6258451af9b9d72bcb4b495293b7637da21030c8f
 DIST protobuf-3.7.1.tar.gz 4795774 BLAKE2B a91155169623ee24ba49e397b151829321c01ff06bb27541e6c02701c37ac96ea9606961291ef0d4616dd6dba045bf7e893ec6288f5809d30cc026b60ae76590 SHA512 7d4cfabd4bd55926336a3baafa0bc1f1f15380b1b2af945f70a2bb3ba24c6ac6567f49c492326d6d1c43a488166bff178f9266377758a05d8541d8b242f4f80f
 DIST protobuf-3.8.0.tar.gz 4934577 BLAKE2B 4b86ab216e8a8b2c99c3620da9417c0562498e9d4dbf4957db186f51c62b0ed73b1322635a076b2d4054e015bdf6c8c50cc7fd0cb78d24a93b29d2a5b48f66fe SHA512 ba27c64e5193cd4a144bf0c9dc0d195fbbe6e580aaca01960362f0f185074588ca40046d3bcea76e1deae7508b722f6c5be484ea957122ae8e98229c7c3a4ad2
 DIST protobuf-3.9.1.tar.gz 4947402 BLAKE2B c1e366438ca619044d84d7a75453c35b48d5f64867b7aaec78c04966d4e62223a8909a28be850156ce3d47f0e7f42e80a231ec5d814d2820e1edfa963d89e177 SHA512 9accb56c1aadef83bf27280e15a99809a3561cbd4b39d6605dec730cc112bf4fd2e9f1ac39127b32a1b87253e712be4b4f12afe4061a8f7be76266b3f4bca314

diff --git a/dev-libs/protobuf/files/protobuf-3.11.0-disable_no-warning-test.patch b/dev-libs/protobuf/files/protobuf-3.11.0-disable_no-warning-test.patch
new file mode 100644
index 00000000000..ec043e3865c
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.11.0-disable_no-warning-test.patch
@@ -0,0 +1,19 @@
+Disable no-warning-test which is compiled with -Werror option and whose only purpose is checking if compilation results in any warnings.
+
+--- /src/Makefile.am
++++ /src/Makefile.am
+@@ -714,7 +714,7 @@
+ GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
+ check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
+                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
+-                 no-warning-test $(GZCHECKPROGRAMS)
++                 $(GZCHECKPROGRAMS)
+ protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+                       $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
+                       $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
+@@ -901,4 +901,4 @@
+ 
+ TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
+         google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS)     \
+-        protobuf-lite-arena-test no-warning-test
++        protobuf-lite-arena-test

diff --git a/dev-libs/protobuf/files/protobuf-3.11.0-protoc_input_output_files.patch b/dev-libs/protobuf/files/protobuf-3.11.0-protoc_input_output_files.patch
new file mode 100644
index 00000000000..0e22b34efc3
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.11.0-protoc_input_output_files.patch
@@ -0,0 +1,262 @@
+https://github.com/protocolbuffers/protobuf/pull/235
+
+--- /src/google/protobuf/compiler/command_line_interface.cc
++++ /src/google/protobuf/compiler/command_line_interface.cc
+@@ -938,6 +938,28 @@
+   }
+ 
+   if (mode_ == MODE_ENCODE || mode_ == MODE_DECODE) {
++    bool success = false;
++    int in_fd = STDIN_FILENO;
++    int out_fd = STDOUT_FILENO;
++
++    if (!protobuf_in_path_.empty()) {
++      in_fd = open(protobuf_in_path_.c_str(), O_RDONLY);
++      if (in_fd == -1) {
++        std::cerr << protobuf_in_path_ << ": error: failed to open file." << std::endl;
++        return 1;
++      }
++    }
++    if (!protobuf_out_path_.empty()) {
++      out_fd = open(protobuf_out_path_.c_str(),
++                    O_WRONLY | O_CREAT | O_TRUNC,
++                    0644);
++      if (out_fd == -1) {
++        std::cerr << protobuf_out_path_ << ": error: failed to open file." << std::endl;
++        close(in_fd);
++        return 1;
++      }
++    }
++
+     if (codec_type_.empty()) {
+       // HACK:  Define an EmptyMessage type to use for decoding.
+       DescriptorPool pool;
+@@ -946,13 +968,20 @@
+       file.add_message_type()->set_name("EmptyMessage");
+       GOOGLE_CHECK(pool.BuildFile(file) != NULL);
+       codec_type_ = "EmptyMessage";
+-      if (!EncodeOrDecode(&pool)) {
+-        return 1;
+-      }
++      success = EncodeOrDecode(&pool, in_fd, out_fd);
+     } else {
+-      if (!EncodeOrDecode(descriptor_pool.get())) {
+-        return 1;
+-      }
++      success = EncodeOrDecode(descriptor_pool.get(), in_fd, out_fd);
++    }
++
++    if (in_fd != STDIN_FILENO) {
++      close(in_fd);
++    }
++    if (out_fd != STDOUT_FILENO) {
++      close(out_fd);
++    }
++
++    if (!success) {
++      return 1;
+     }
+   }
+ 
+@@ -990,6 +1019,11 @@
+   for (int i = 0; i < proto_path_.size(); i++) {
+     source_tree->MapPath(proto_path_[i].first, proto_path_[i].second);
+   }
++  if (mode_ == MODE_COMPILE &&
++      (!protobuf_in_path_.empty() || !protobuf_out_path_.empty())) {
++    std::cerr << "--protobuf_in and --protobuf_out are only valid with "
++         << "decode operations. Ignoring.";
++  }
+ 
+   // Map input files to virtual paths if possible.
+   if (!MakeInputsBeProtoPathRelative(source_tree, fallback_database)) {
+@@ -1650,6 +1684,12 @@
+ 
+     codec_type_ = value;
+ 
++  } else if (name == "--protobuf_in") {
++    protobuf_in_path_ = value;
++
++  } else if (name == "--protobuf_out") {
++    protobuf_out_path_ = value;
++
+   } else if (name == "--error_format") {
+     if (value == "gcc") {
+       error_format_ = ERROR_FORMAT_GCC;
+@@ -1786,29 +1826,50 @@
+          "  -h, --help                  Show this text and exit.\n"
+          "  --encode=MESSAGE_TYPE       Read a text-format message of the "
+          "given type\n"
+-         "                              from standard input and write it in "
+-         "binary\n"
+-         "                              to standard output.  The message type "
+-         "must\n"
++         "                              and write it in binary.  The message "
++         "type must\n"
+          "                              be defined in PROTO_FILES or their "
+          "imports.\n"
++         "                              The input/output protobuf files are "
++         "specified\n"
++         "                              using the --protobuf_in and "
++         "--protobuf_out\n"
++         "                              command line flags.\n"
+          "  --decode=MESSAGE_TYPE       Read a binary message of the given "
+-         "type from\n"
+-         "                              standard input and write it in text "
+-         "format\n"
+-         "                              to standard output.  The message type "
+-         "must\n"
+-         "                              be defined in PROTO_FILES or their "
+-         "imports.\n"
++         "type and\n"
++         "                              write it in text format.  The message "
++         "type\n"
++         "                              must be defined in PROTO_FILES or "
++         "their imports.\n"
++         "                              The input/output protobuf files are "
++         "specified\n"
++         "                              using the --protobuf_in and "
++         "--protobuf_out\n"
++         "                              command line flags.\n"
+          "  --decode_raw                Read an arbitrary protocol message "
+-         "from\n"
+-         "                              standard input and write the raw "
+-         "tag/value\n"
+-         "                              pairs in text format to standard "
+-         "output.  No\n"
++         "and write\n"
++         "                              the raw tag/value pairs in text format."
++         "  No\n"
+          "                              PROTO_FILES should be given when using "
+          "this\n"
+-         "                              flag.\n"
++         "                              flag.  The input/output protobuf files "
++         "are\n"
++         "                              specified using the --protobuf_in and\n"
++         "                              --protobuf_out command line flags.\n"
++         "  --protobuf_in=FILE          Absolute path to the protobuf file "
++         "from which\n"
++         "                              input of encoding/decoding operation "
++         "will be\n"
++         "                              read.  If omitted, input will be read "
++         "from\n"
++         "                              standard input.\n"
++         "  --protobuf_out=FILE         Absolute path to the protobuf file "
++         "to which\n"
++         "                              output of encoding/decoding operation "
++         "will be\n"
++         "                              written.  If omitted, output will be "
++         "written to\n"
++         "                              standard output.\n"
+          "  --descriptor_set_in=FILES   Specifies a delimited list of FILES\n"
+          "                              each containing a FileDescriptorSet "
+          "(a\n"
+@@ -2123,7 +2184,9 @@
+   return true;
+ }
+ 
+-bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool) {
++bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool,
++                                          int in_fd,
++                                          int out_fd) {
+   // Look up the type.
+   const Descriptor* type = pool->FindMessageTypeByName(codec_type_);
+   if (type == NULL) {
+@@ -2135,15 +2198,15 @@
+   std::unique_ptr<Message> message(dynamic_factory.GetPrototype(type)->New());
+ 
+   if (mode_ == MODE_ENCODE) {
+-    SetFdToTextMode(STDIN_FILENO);
+-    SetFdToBinaryMode(STDOUT_FILENO);
++    SetFdToTextMode(in_fd);
++    SetFdToBinaryMode(out_fd);
+   } else {
+-    SetFdToBinaryMode(STDIN_FILENO);
+-    SetFdToTextMode(STDOUT_FILENO);
++    SetFdToBinaryMode(in_fd);
++    SetFdToTextMode(out_fd);
+   }
+ 
+-  io::FileInputStream in(STDIN_FILENO);
+-  io::FileOutputStream out(STDOUT_FILENO);
++  io::FileInputStream in(in_fd);
++  io::FileOutputStream out(out_fd);
+ 
+   if (mode_ == MODE_ENCODE) {
+     // Input is text.
+--- /src/google/protobuf/compiler/command_line_interface.h
++++ /src/google/protobuf/compiler/command_line_interface.h
+@@ -288,7 +288,9 @@
+       GeneratorContext* generator_context, std::string* error);
+ 
+   // Implements --encode and --decode.
+-  bool EncodeOrDecode(const DescriptorPool* pool);
++  bool EncodeOrDecode(const DescriptorPool* pool,
++                      int in_fd,
++                      int out_fd);
+ 
+   // Implements the --descriptor_set_out option.
+   bool WriteDescriptorSet(
+@@ -420,6 +422,13 @@
+   // parsed FileDescriptorSets to be used for loading protos.  Otherwise, empty.
+   std::vector<std::string> descriptor_set_in_names_;
+ 
++  // When using --encode / --decode / --decode_raw absolute path to the output
++  // file. (Empty string indicates write to STDOUT).
++  std::string protobuf_out_path_;
++  // When using --encode / --decode / --decode_raw, absolute path to the input
++  // file. (Empty string indicates read from STDIN).
++  std::string protobuf_in_path_;
++
+   // If --descriptor_set_out was given, this is the filename to which the
+   // FileDescriptorSet should be written.  Otherwise, empty.
+   std::string descriptor_set_out_name_;
+--- /src/google/protobuf/compiler/command_line_interface_unittest.cc
++++ /src/google/protobuf/compiler/command_line_interface_unittest.cc
+@@ -95,7 +95,7 @@
+   virtual void SetUp();
+   virtual void TearDown();
+ 
+-  // Runs the CommandLineInterface with the given command line.  The
++  // Run the CommandLineInterface with the given command line.  The
+   // command is automatically split on spaces, and the string "$tmpdir"
+   // is replaced with TestTempDir().
+   void Run(const std::string& command);
+@@ -2491,6 +2491,17 @@
+               std::string::npos);
+   }
+ 
++  void ExpectBinaryFilesMatch(const string &expected_file,
++                              const string &actual_file) {
++    string expected_output, actual_output;
++    ASSERT_TRUE(File::ReadFileToString(expected_file, &expected_output));
++    ASSERT_TRUE(File::ReadFileToString(actual_file, &actual_output));
++
++    // Don't use EXPECT_EQ because we don't want to print raw binary data to
++    // stdout on failure.
++    EXPECT_TRUE(expected_output == actual_output);
++  }
++
+  private:
+   void WriteUnittestProtoDescriptorSet() {
+     unittest_proto_descriptor_set_filename_ =
+@@ -2585,6 +2596,19 @@
+       "net/proto2/internal/no_such_file.proto: No such file or directory\n");
+ }
+ 
++TEST_P(EncodeDecodeTest, RedirectInputOutput) {
++  string out_file = TestTempDir() + "/golden_message_out.pbf";
++  EXPECT_TRUE(
++      Run(TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto") +
++          " --encode=protobuf_unittest.TestAllTypes" +
++          " --protobuf_in=" + TestUtil::GetTestDataPath(
++              "net/proto2/internal/"
++              "testdata/text_format_unittest_data_oneof_implemented.txt") +
++          " --protobuf_out=" + out_file));
++  ExpectBinaryFilesMatch(out_file, TestUtil::GetTestDataPath(
++      "net/proto2/internal/testdata/golden_message_oneof_implemented"));
++}
++
+ INSTANTIATE_TEST_SUITE_P(FileDescriptorSetSource, EncodeDecodeTest,
+                          testing::Values(PROTO_PATH, DESCRIPTOR_SET_IN));
+ }  // anonymous namespace

diff --git a/dev-libs/protobuf/files/protobuf-3.11.0-system_libraries.patch b/dev-libs/protobuf/files/protobuf-3.11.0-system_libraries.patch
new file mode 100644
index 00000000000..8311ce8b22e
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.11.0-system_libraries.patch
@@ -0,0 +1,121 @@
+--- /Makefile.am
++++ /Makefile.am
+@@ -11,28 +11,10 @@
+ # Always include third_party directories in distributions.
+ DIST_SUBDIRS = src conformance benchmarks third_party/googletest
+ 
+-# Build gmock before we build protobuf tests.  We don't add gmock to SUBDIRS
+-# because then "make check" would also build and run all of gmock's own tests,
+-# which takes a lot of time and is generally not useful to us.  Also, we don't
+-# want "make install" to recurse into gmock since we don't want to overwrite
+-# the installed version of gmock if there is one.
+ check-local:
+-	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
+-	@cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
+-	@cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
+ 
+-# We would like to clean gmock when "make clean" is invoked.  But we have to
+-# be careful because clean-local is also invoked during "make distclean", but
+-# "make distclean" already recurses into gmock because it's listed among the
+-# DIST_SUBDIRS.  distclean will delete gmock/Makefile, so if we then try to
+-# cd to the directory again and "make clean" it will fail.  So, check that the
+-# Makefile exists before recursing.
+ clean-local:
+-	@if test -e third_party/googletest/Makefile; then \
+-	  echo "Making clean in googletest"; \
+-	  cd third_party/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; \
+-	fi; \
+-	if test -e conformance/Makefile; then \
++	@if test -e conformance/Makefile; then \
+ 	  echo "Making clean in conformance"; \
+ 	  cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \
+ 	fi; \
+--- /configure.ac
++++ /configure.ac
+@@ -223,12 +223,5 @@
+ esac
+ AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1])
+ 
+-# HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
+-#   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
+-#   too.
+-export CFLAGS
+-export CXXFLAGS
+-AC_CONFIG_SUBDIRS([third_party/googletest])
+-
+ AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
+ AC_OUTPUT
+--- /src/Makefile.am
++++ /src/Makefile.am
+@@ -708,19 +708,11 @@
+   google/protobuf/testing/file.cc                              \
+   google/protobuf/testing/file.h
+ 
+-GOOGLETEST_BUILD_DIR=../third_party/googletest/googletest
+-GOOGLEMOCK_BUILD_DIR=../third_party/googletest/googlemock
+-GOOGLETEST_SRC_DIR=$(srcdir)/../third_party/googletest/googletest
+-GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
+ check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
+                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
+                  $(GZCHECKPROGRAMS)
+ protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \
+-                         -I$(GOOGLEMOCK_SRC_DIR)/include
++                      -lgtest -lgmock -lgmock_main
+ # Disable optimization for tests unless the user explicitly asked for it,
+ # since test_util.cc takes forever to compile with optimization (with GCC).
+ # See configure.ac for more info.
+@@ -812,12 +804,8 @@
+ # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
+ protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
+                       libprotoc.la                                   \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
+-                                         -I$(GOOGLETEST_SRC_DIR)/include \
+-                                         -DPROTOBUF_TEST_NO_DESCRIPTORS
++                      -lgtest -lgmock -lgmock_main
++protobuf_lazy_descriptor_test_CPPFLAGS = -DPROTOBUF_TEST_NO_DESCRIPTORS
+ protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lazy_descriptor_test_SOURCES =                        \
+   google/protobuf/compiler/cpp/cpp_unittest.cc                 \
+@@ -838,11 +826,7 @@
+ # full runtime and we want to make sure this test builds without full
+ # runtime.
+ protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la     \
+-                           $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
+-                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
+-                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \
+-                             -I$(GOOGLETEST_SRC_DIR)/include
++                           -lgtest -lgmock -lgmock_main
+ protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lite_test_SOURCES =                                           \
+   google/protobuf/lite_unittest.cc                                     \
+@@ -854,11 +838,7 @@
+ # gtest when building the test internally our memory sanitizer doesn't detect
+ # memory leaks (don't know why).
+ protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include  \
+-                                    -I$(GOOGLETEST_SRC_DIR)/include
++                      -lgtest -lgmock -lgmock_main
+ protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lite_arena_test_SOURCES =       \
+   google/protobuf/lite_arena_unittest.cc \
+@@ -868,8 +848,7 @@
+ 
+ # Test plugin binary.
+ test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+-                    $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la
+-test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include
++                    -lgtest
+ test_plugin_SOURCES =                                          \
+   google/protobuf/compiler/mock_code_generator.cc              \
+   google/protobuf/testing/file.cc                              \

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-3.11.2.ebuild
similarity index 83%
copy from dev-libs/protobuf/protobuf-9999.ebuild
copy to dev-libs/protobuf/protobuf-3.11.2.ebuild
index 51f9e08de07..d8d5e5fa70a 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-3.11.2.ebuild
@@ -22,20 +22,20 @@ fi
 
 LICENSE="BSD"
 SLOT="0/22"
-KEYWORDS=""
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
 IUSE="emacs examples static-libs test zlib"
 RESTRICT="!test? ( test )"
 
-BDEPEND="emacs? ( >=app-editors/emacs-23.1:* )"
+BDEPEND="emacs? ( app-editors/emacs:* )"
 DEPEND="test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
-RDEPEND="emacs? ( >=app-editors/emacs-23.1:* )
+RDEPEND="emacs? ( app-editors/emacs:* )
 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
 
 PATCHES=(
-	"${FILESDIR}/${PN}-3.8.0-disable_no-warning-test.patch"
-	"${FILESDIR}/${PN}-3.8.0-system_libraries.patch"
-	"${FILESDIR}/${PN}-3.8.0-protoc_input_output_files.patch"
+	"${FILESDIR}/${PN}-3.11.0-disable_no-warning-test.patch"
+	"${FILESDIR}/${PN}-3.11.0-system_libraries.patch"
+	"${FILESDIR}/${PN}-3.11.0-protoc_input_output_files.patch"
 )
 
 DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
@@ -47,6 +47,12 @@ src_prepare() {
 
 src_configure() {
 	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
+
+	if tc-ld-is-gold; then
+		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+		tc-ld-disable-gold
+	fi
+
 	multilib-minimal_src_configure
 }
 

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-9999.ebuild
index 51f9e08de07..eebedecd5f1 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-9999.ebuild
@@ -26,16 +26,16 @@ KEYWORDS=""
 IUSE="emacs examples static-libs test zlib"
 RESTRICT="!test? ( test )"
 
-BDEPEND="emacs? ( >=app-editors/emacs-23.1:* )"
+BDEPEND="emacs? ( app-editors/emacs:* )"
 DEPEND="test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
-RDEPEND="emacs? ( >=app-editors/emacs-23.1:* )
+RDEPEND="emacs? ( app-editors/emacs:* )
 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
 
 PATCHES=(
-	"${FILESDIR}/${PN}-3.8.0-disable_no-warning-test.patch"
-	"${FILESDIR}/${PN}-3.8.0-system_libraries.patch"
-	"${FILESDIR}/${PN}-3.8.0-protoc_input_output_files.patch"
+	"${FILESDIR}/${PN}-3.11.0-disable_no-warning-test.patch"
+	"${FILESDIR}/${PN}-3.11.0-system_libraries.patch"
+	"${FILESDIR}/${PN}-3.11.0-protoc_input_output_files.patch"
 )
 
 DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2019-12-29 19:34 Mike Gilbert
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Gilbert @ 2019-12-29 19:34 UTC (permalink / raw
  To: gentoo-commits

commit:     d23f80e9e13c1085de9777945f3f5fab67143d14
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Dec 23 20:56:12 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Dec 29 19:31:33 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d23f80e9

dev-libs/protobuf: Delete old version (3.7.1).

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 dev-libs/protobuf/Manifest                         |   1 -
 .../protobuf-3.7.0-disable_no-warning-test.patch   |  19 --
 .../protobuf-3.7.0-protoc_input_output_files.patch | 236 ---------------------
 .../files/protobuf-3.7.1-system_libraries.patch    | 121 -----------
 dev-libs/protobuf/protobuf-3.7.1.ebuild            | 126 -----------
 5 files changed, 503 deletions(-)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index 15ae0824bb2..02aa678dff0 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -1,6 +1,5 @@
 DIST protobuf-3.10.1.tar.gz 4905995 BLAKE2B 1dde3b6260918da8430c2ce69210462f339c492b2a4e53d5d9c1bea3747aead905370507fc4bd703560f6885c0f3f8393a998b875c19744ad94827109ecbb49f SHA512 aba0c4034c0d3b1759904adb6270eee94dd5dc568f433b219e3f1f70c0033993cdfa3bf476ad3f5767c7629edb9fd029c686405abf93731dde808286b336330d
 DIST protobuf-3.11.2.tar.gz 5133897 BLAKE2B 275ea52a072b4e0226e4b6dc476d4bc28e8f4f05bca0709eab51da91c02869e96c3b0ac9ab4cc46290f875d4eac6ac72374c5b45e27fa89ad3d58fd56a2c8b7e SHA512 8319c1e003e5fc64e91b512de016ec1cf10265b294d3b4beea60856beaeb02b4d7682343c74b2c12b0f6d4d6258451af9b9d72bcb4b495293b7637da21030c8f
-DIST protobuf-3.7.1.tar.gz 4795774 BLAKE2B a91155169623ee24ba49e397b151829321c01ff06bb27541e6c02701c37ac96ea9606961291ef0d4616dd6dba045bf7e893ec6288f5809d30cc026b60ae76590 SHA512 7d4cfabd4bd55926336a3baafa0bc1f1f15380b1b2af945f70a2bb3ba24c6ac6567f49c492326d6d1c43a488166bff178f9266377758a05d8541d8b242f4f80f
 DIST protobuf-3.8.0.tar.gz 4934577 BLAKE2B 4b86ab216e8a8b2c99c3620da9417c0562498e9d4dbf4957db186f51c62b0ed73b1322635a076b2d4054e015bdf6c8c50cc7fd0cb78d24a93b29d2a5b48f66fe SHA512 ba27c64e5193cd4a144bf0c9dc0d195fbbe6e580aaca01960362f0f185074588ca40046d3bcea76e1deae7508b722f6c5be484ea957122ae8e98229c7c3a4ad2
 DIST protobuf-3.9.1.tar.gz 4947402 BLAKE2B c1e366438ca619044d84d7a75453c35b48d5f64867b7aaec78c04966d4e62223a8909a28be850156ce3d47f0e7f42e80a231ec5d814d2820e1edfa963d89e177 SHA512 9accb56c1aadef83bf27280e15a99809a3561cbd4b39d6605dec730cc112bf4fd2e9f1ac39127b32a1b87253e712be4b4f12afe4061a8f7be76266b3f4bca314
 DIST protobuf-3.9.2.tar.gz 4947582 BLAKE2B ff0150970286d1eb452bd2f252fa8200617ddf491dcb3b9b60cebb36268c5a3072df3d24142ca9863306df6690f53ad4d4761c7846c677c4610716ec22e0838c SHA512 510349ddc59b4e53087b5247ca8784e9f852d66d755e1b014c6214e14c003f31dd336a724e9eb87a5b85a70e22793eb3211744c85a514b24b687346563717bec

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
deleted file mode 100644
index eadde9c04dc..00000000000
--- a/dev-libs/protobuf/files/protobuf-3.7.0-disable_no-warning-test.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Disable no-warning-test which is compiled with -Werror option and whose only purpose is checking if compilation results in any warnings.
-
---- /src/Makefile.am
-+++ /src/Makefile.am
-@@ -709,7 +709,7 @@
- GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
- check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
-                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
--                 no-warning-test $(GZCHECKPROGRAMS)
-+                 $(GZCHECKPROGRAMS)
- protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
-                       $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
-                       $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
-@@ -893,4 +893,4 @@
- 
- TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
-         google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS)     \
--        protobuf-lite-arena-test no-warning-test
-+        protobuf-lite-arena-test

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
deleted file mode 100644
index 54daa6de4ed..00000000000
--- a/dev-libs/protobuf/files/protobuf-3.7.0-protoc_input_output_files.patch
+++ /dev/null
@@ -1,236 +0,0 @@
-https://github.com/protocolbuffers/protobuf/pull/235
-
---- /src/google/protobuf/compiler/command_line_interface.cc
-+++ /src/google/protobuf/compiler/command_line_interface.cc
-@@ -951,6 +951,28 @@
-   }
- 
-   if (mode_ == MODE_ENCODE || mode_ == MODE_DECODE) {
-+    bool success = false;
-+    int in_fd = STDIN_FILENO;
-+    int out_fd = STDOUT_FILENO;
-+
-+    if (!protobuf_in_path_.empty()) {
-+      in_fd = open(protobuf_in_path_.c_str(), O_RDONLY);
-+      if (in_fd == -1) {
-+        std::cerr << protobuf_in_path_ << ": error: failed to open file." << std::endl;
-+        return 1;
-+      }
-+    }
-+    if (!protobuf_out_path_.empty()) {
-+      out_fd = open(protobuf_out_path_.c_str(),
-+                    O_WRONLY | O_CREAT | O_TRUNC,
-+                    0644);
-+      if (out_fd == -1) {
-+        std::cerr << protobuf_out_path_ << ": error: failed to open file." << std::endl;
-+        close(in_fd);
-+        return 1;
-+      }
-+    }
-+
-     if (codec_type_.empty()) {
-       // HACK:  Define an EmptyMessage type to use for decoding.
-       DescriptorPool pool;
-@@ -959,13 +981,20 @@
-       file.add_message_type()->set_name("EmptyMessage");
-       GOOGLE_CHECK(pool.BuildFile(file) != NULL);
-       codec_type_ = "EmptyMessage";
--      if (!EncodeOrDecode(&pool)) {
--        return 1;
--      }
-+      success = EncodeOrDecode(&pool, in_fd, out_fd);
-     } else {
--      if (!EncodeOrDecode(descriptor_pool.get())) {
--        return 1;
--      }
-+      success = EncodeOrDecode(descriptor_pool.get(), in_fd, out_fd);
-+    }
-+
-+    if (in_fd != STDIN_FILENO) {
-+      close(in_fd);
-+    }
-+    if (out_fd != STDOUT_FILENO) {
-+      close(out_fd);
-+    }
-+
-+    if (!success) {
-+      return 1;
-     }
-   }
- 
-@@ -1003,6 +1032,11 @@
-   for (int i = 0; i < proto_path_.size(); i++) {
-     source_tree->MapPath(proto_path_[i].first, proto_path_[i].second);
-   }
-+  if (mode_ == MODE_COMPILE &&
-+      (!protobuf_in_path_.empty() || !protobuf_out_path_.empty())) {
-+    std::cerr << "--protobuf_in and --protobuf_out are only valid with "
-+         << "decode operations. Ignoring.";
-+  }
- 
-   // Map input files to virtual paths if possible.
-   if (!MakeInputsBeProtoPathRelative(source_tree, fallback_database)) {
-@@ -1622,6 +1656,12 @@
- 
-     codec_type_ = value;
- 
-+  } else if (name == "--protobuf_in") {
-+    protobuf_in_path_ = value;
-+
-+  } else if (name == "--protobuf_out") {
-+    protobuf_out_path_ = value;
-+
-   } else if (name == "--error_format") {
-     if (value == "gcc") {
-       error_format_ = ERROR_FORMAT_GCC;
-@@ -1749,18 +1789,31 @@
- "  --version                   Show version info and exit.\n"
- "  -h, --help                  Show this text and exit.\n"
- "  --encode=MESSAGE_TYPE       Read a text-format message of the given type\n"
--"                              from standard input and write it in binary\n"
--"                              to standard output.  The message type must\n"
--"                              be defined in PROTO_FILES or their imports.\n"
--"  --decode=MESSAGE_TYPE       Read a binary message of the given type from\n"
--"                              standard input and write it in text format\n"
--"                              to standard output.  The message type must\n"
-+"                              and write it in binary.  The message type must\n"
- "                              be defined in PROTO_FILES or their imports.\n"
--"  --decode_raw                Read an arbitrary protocol message from\n"
--"                              standard input and write the raw tag/value\n"
--"                              pairs in text format to standard output.  No\n"
-+"                              The input/output protobuf files are specified\n"
-+"                              using the --protobuf_in and --protobuf_out\n"
-+"                              command line flags.\n"
-+"  --decode=MESSAGE_TYPE       Read a binary message of the given type and\n"
-+"                              write it in text format.  The message type\n"
-+"                              must be defined in PROTO_FILES or their imports.\n"
-+"                              The input/output protobuf files are specified\n"
-+"                              using the --protobuf_in and --protobuf_out\n"
-+"                              command line flags.\n"
-+"  --decode_raw                Read an arbitrary protocol message and write\n"
-+"                              the raw tag/value pairs in text format.  No\n"
- "                              PROTO_FILES should be given when using this\n"
--"                              flag.\n"
-+"                              flag.  The input/output protobuf files are\n"
-+"                              specified using the --protobuf_in and\n"
-+"                              --protobuf_out command line flags.\n"
-+"  --protobuf_in=FILE          Absolute path to the protobuf file from which\n"
-+"                              input of encoding/decoding operation will be\n"
-+"                              read.  If omitted, input will be read from\n"
-+"                              standard input.\n"
-+"  --protobuf_out=FILE         Absolute path to the protobuf file to which\n"
-+"                              output of encoding/decoding operation will be\n"
-+"                              written.  If omitted, output will be written to\n"
-+"                              standard output.\n"
- "  --descriptor_set_in=FILES   Specifies a delimited list of FILES\n"
- "                              each containing a FileDescriptorSet (a\n"
- "                              protocol buffer defined in descriptor.proto).\n"
-@@ -2039,7 +2092,9 @@
-   return true;
- }
- 
--bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool) {
-+bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool,
-+                                          int in_fd,
-+                                          int out_fd) {
-   // Look up the type.
-   const Descriptor* type = pool->FindMessageTypeByName(codec_type_);
-   if (type == NULL) {
-@@ -2051,15 +2106,15 @@
-   std::unique_ptr<Message> message(dynamic_factory.GetPrototype(type)->New());
- 
-   if (mode_ == MODE_ENCODE) {
--    SetFdToTextMode(STDIN_FILENO);
--    SetFdToBinaryMode(STDOUT_FILENO);
-+    SetFdToTextMode(in_fd);
-+    SetFdToBinaryMode(out_fd);
-   } else {
--    SetFdToBinaryMode(STDIN_FILENO);
--    SetFdToTextMode(STDOUT_FILENO);
-+    SetFdToBinaryMode(in_fd);
-+    SetFdToTextMode(out_fd);
-   }
- 
--  io::FileInputStream in(STDIN_FILENO);
--  io::FileOutputStream out(STDOUT_FILENO);
-+  io::FileInputStream in(in_fd);
-+  io::FileOutputStream out(out_fd);
- 
-   if (mode_ == MODE_ENCODE) {
-     // Input is text.
---- /src/google/protobuf/compiler/command_line_interface.h
-+++ /src/google/protobuf/compiler/command_line_interface.h
-@@ -285,7 +285,9 @@
-       GeneratorContext* generator_context, std::string* error);
- 
-   // Implements --encode and --decode.
--  bool EncodeOrDecode(const DescriptorPool* pool);
-+  bool EncodeOrDecode(const DescriptorPool* pool,
-+                      int in_fd,
-+                      int out_fd);
- 
-   // Implements the --descriptor_set_out option.
-   bool WriteDescriptorSet(
-@@ -418,6 +420,13 @@
-   // parsed FileDescriptorSets to be used for loading protos.  Otherwise, empty.
-   std::vector<std::string> descriptor_set_in_names_;
- 
-+  // When using --encode / --decode / --decode_raw absolute path to the output
-+  // file. (Empty string indicates write to STDOUT).
-+  std::string protobuf_out_path_;
-+  // When using --encode / --decode / --decode_raw, absolute path to the input
-+  // file. (Empty string indicates read from STDIN).
-+  std::string protobuf_in_path_;
-+
-   // If --descriptor_set_out was given, this is the filename to which the
-   // FileDescriptorSet should be written.  Otherwise, empty.
-   std::string descriptor_set_out_name_;
---- /src/google/protobuf/compiler/command_line_interface_unittest.cc
-+++ /src/google/protobuf/compiler/command_line_interface_unittest.cc
-@@ -95,7 +95,7 @@
-   virtual void SetUp();
-   virtual void TearDown();
- 
--  // Runs the CommandLineInterface with the given command line.  The
-+  // Run the CommandLineInterface with the given command line.  The
-   // command is automatically split on spaces, and the string "$tmpdir"
-   // is replaced with TestTempDir().
-   void Run(const string& command);
-@@ -2367,6 +2367,17 @@
-     EXPECT_EQ(StripCR(expected_text), StripCR(captured_stderr_));
-   }
- 
-+  void ExpectBinaryFilesMatch(const string &expected_file,
-+                              const string &actual_file) {
-+    string expected_output, actual_output;
-+    ASSERT_TRUE(File::ReadFileToString(expected_file, &expected_output));
-+    ASSERT_TRUE(File::ReadFileToString(actual_file, &actual_output));
-+
-+    // Don't use EXPECT_EQ because we don't want to print raw binary data to
-+    // stdout on failure.
-+    EXPECT_TRUE(expected_output == actual_output);
-+  }
-+
-  private:
-   void WriteUnittestProtoDescriptorSet() {
-     unittest_proto_descriptor_set_filename_ =
-@@ -2463,6 +2474,19 @@
-       "net/proto2/internal/no_such_file.proto: No such file or directory\n");
- }
- 
-+TEST_P(EncodeDecodeTest, RedirectInputOutput) {
-+  string out_file = TestTempDir() + "/golden_message_out.pbf";
-+  EXPECT_TRUE(
-+      Run(TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto") +
-+          " --encode=protobuf_unittest.TestAllTypes" +
-+          " --protobuf_in=" + TestUtil::GetTestDataPath(
-+              "net/proto2/internal/"
-+              "testdata/text_format_unittest_data_oneof_implemented.txt") +
-+          " --protobuf_out=" + out_file));
-+  ExpectBinaryFilesMatch(out_file, TestUtil::GetTestDataPath(
-+      "net/proto2/internal/testdata/golden_message_oneof_implemented"));
-+}
-+
- INSTANTIATE_TEST_CASE_P(FileDescriptorSetSource,
-                         EncodeDecodeTest,
-                         testing::Values(PROTO_PATH, DESCRIPTOR_SET_IN));

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
deleted file mode 100644
index 3ae92e2b87a..00000000000
--- a/dev-libs/protobuf/files/protobuf-3.7.1-system_libraries.patch
+++ /dev/null
@@ -1,121 +0,0 @@
---- /Makefile.am
-+++ /Makefile.am
-@@ -11,28 +11,10 @@
- # Always include third_party directories in distributions.
- DIST_SUBDIRS = src conformance benchmarks third_party/googletest
- 
--# Build gmock before we build protobuf tests.  We don't add gmock to SUBDIRS
--# because then "make check" would also build and run all of gmock's own tests,
--# which takes a lot of time and is generally not useful to us.  Also, we don't
--# want "make install" to recurse into gmock since we don't want to overwrite
--# the installed version of gmock if there is one.
- check-local:
--	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
--	@cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
--	@cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
- 
--# We would like to clean gmock when "make clean" is invoked.  But we have to
--# be careful because clean-local is also invoked during "make distclean", but
--# "make distclean" already recurses into gmock because it's listed among the
--# DIST_SUBDIRS.  distclean will delete gmock/Makefile, so if we then try to
--# cd to the directory again and "make clean" it will fail.  So, check that the
--# Makefile exists before recursing.
- clean-local:
--	@if test -e third_party/googletest/Makefile; then \
--	  echo "Making clean in googletest"; \
--	  cd third_party/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; \
--	fi; \
--	if test -e conformance/Makefile; then \
-+	@if test -e conformance/Makefile; then \
- 	  echo "Making clean in conformance"; \
- 	  cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \
- 	fi; \
---- /configure.ac
-+++ /configure.ac
-@@ -218,12 +218,5 @@
- esac
- AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1])
- 
--# HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
--#   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
--#   too.
--export CFLAGS
--export CXXFLAGS
--AC_CONFIG_SUBDIRS([third_party/googletest])
--
- AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
- AC_OUTPUT
---- /src/Makefile.am
-+++ /src/Makefile.am
-@@ -703,19 +703,11 @@
-   google/protobuf/testing/file.cc                              \
-   google/protobuf/testing/file.h
- 
--GOOGLETEST_BUILD_DIR=../third_party/googletest/googletest
--GOOGLEMOCK_BUILD_DIR=../third_party/googletest/googlemock
--GOOGLETEST_SRC_DIR=$(srcdir)/../third_party/googletest/googletest
--GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
- check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
-                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
-                  $(GZCHECKPROGRAMS)
- protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
--                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
--protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \
--                         -I$(GOOGLEMOCK_SRC_DIR)/include
-+                      -lgtest -lgmock -lgmock_main
- # Disable optimization for tests unless the user explicitly asked for it,
- # since test_util.cc takes forever to compile with optimization (with GCC).
- # See configure.ac for more info.
-@@ -804,12 +796,8 @@
- # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
- protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
-                       libprotoc.la                                   \
--                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
--protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
--                                         -I$(GOOGLETEST_SRC_DIR)/include \
--                                         -DPROTOBUF_TEST_NO_DESCRIPTORS
-+                      -lgtest -lgmock -lgmock_main
-+protobuf_lazy_descriptor_test_CPPFLAGS = -DPROTOBUF_TEST_NO_DESCRIPTORS
- protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lazy_descriptor_test_SOURCES =                        \
-   google/protobuf/compiler/cpp/cpp_unittest.cc                 \
-@@ -830,11 +818,7 @@
- # full runtime and we want to make sure this test builds without full
- # runtime.
- protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la     \
--                           $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
--                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
--                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
--protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \
--                             -I$(GOOGLETEST_SRC_DIR)/include
-+                           -lgtest -lgmock -lgmock_main
- protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lite_test_SOURCES =                                           \
-   google/protobuf/lite_unittest.cc                                     \
-@@ -846,11 +830,7 @@
- # gtest when building the test internally our memory sanitizer doesn't detect
- # memory leaks (don't know why).
- protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
--                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
--protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include  \
--                                    -I$(GOOGLETEST_SRC_DIR)/include
-+                      -lgtest -lgmock -lgmock_main
- protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lite_arena_test_SOURCES =       \
-   google/protobuf/lite_arena_unittest.cc \
-@@ -860,8 +840,7 @@
- 
- # Test plugin binary.
- test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
--                    $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la
--test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include
-+                    -lgtest
- test_plugin_SOURCES =                                          \
-   google/protobuf/compiler/mock_code_generator.cc              \
-   google/protobuf/testing/file.cc                              \

diff --git a/dev-libs/protobuf/protobuf-3.7.1.ebuild b/dev-libs/protobuf/protobuf-3.7.1.ebuild
deleted file mode 100644
index d7c2d8b60c6..00000000000
--- a/dev-libs/protobuf/protobuf-3.7.1.ebuild
+++ /dev/null
@@ -1,126 +0,0 @@
-# Copyright 2008-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# True Authors: Arfrever Frehtes Taifersar Arahesis and others
-
-EAPI="7"
-
-inherit autotools elisp-common flag-o-matic multilib-minimal toolchain-funcs
-
-if [[ "${PV}" == "9999" ]]; then
-	inherit git-r3
-
-	EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf"
-	EGIT_SUBMODULES=()
-fi
-
-DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing structured data"
-HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
-if [[ "${PV}" == "9999" ]]; then
-	SRC_URI=""
-else
-	SRC_URI="https://github.com/protocolbuffers/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-fi
-
-LICENSE="BSD"
-SLOT="0/18"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
-IUSE="emacs examples static-libs test zlib"
-RESTRICT="!test? ( test )"
-
-BDEPEND="emacs? ( >=app-editors/emacs-23.1:* )"
-DEPEND="test? ( >=dev-cpp/gtest-1.8.0[${MULTILIB_USEDEP}] )
-	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
-RDEPEND="emacs? ( >=app-editors/emacs-23.1:* )
-	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
-
-PATCHES=(
-	"${FILESDIR}/${PN}-3.7.0-disable_no-warning-test.patch"
-	"${FILESDIR}/${PN}-3.7.1-system_libraries.patch"
-	"${FILESDIR}/${PN}-3.7.0-protoc_input_output_files.patch"
-)
-
-DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
-
-src_prepare() {
-	default
-	eautoreconf
-}
-
-src_configure() {
-	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
-
-	if tc-ld-is-gold; then
-		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
-		tc-ld-disable-gold
-	fi
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local options=(
-		$(use_enable static-libs static)
-		$(use_with zlib)
-	)
-
-	if tc-is-cross-compiler; then
-		# Build system uses protoc when building, so protoc copy runnable on host is needed.
-		mkdir -p "${WORKDIR}/build" || die
-		pushd "${WORKDIR}/build" > /dev/null || die
-		ECONF_SOURCE="${S}" econf_build "${options[@]}"
-		options+=(--with-protoc="$(pwd)/src/protoc")
-		popd > /dev/null || die
-	fi
-
-	ECONF_SOURCE="${S}" econf "${options[@]}"
-}
-
-src_compile() {
-	multilib-minimal_src_compile
-
-	if use emacs; then
-		elisp-compile editors/protobuf-mode.el
-	fi
-}
-
-multilib_src_compile() {
-	if tc-is-cross-compiler; then
-		emake -C "${WORKDIR}/build/src" protoc
-	fi
-
-	default
-}
-
-multilib_src_test() {
-	emake check
-}
-
-multilib_src_install_all() {
-	find "${D}" -name "*.la" -delete || die
-
-	insinto /usr/share/vim/vimfiles/syntax
-	doins editors/proto.vim
-	insinto /usr/share/vim/vimfiles/ftdetect
-	doins "${FILESDIR}/proto.vim"
-
-	if use emacs; then
-		elisp-install ${PN} editors/protobuf-mode.el*
-		elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
-	fi
-
-	if use examples; then
-		DOCS+=(examples)
-		docompress -x /usr/share/doc/${PF}/examples
-	fi
-
-	einstalldocs
-}
-
-pkg_postinst() {
-	use emacs && elisp-site-regen
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2020-07-04 13:53 Mike Gilbert
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Gilbert @ 2020-07-04 13:53 UTC (permalink / raw
  To: gentoo-commits

commit:     e39c922037535c263b85013d0ecbfeb94dc1ddb1
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Jul  2 12:44:28 2020 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Jul  4 13:52:26 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e39c9220

dev-libs/protobuf: Version bump (3.12.2).

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 dev-libs/protobuf/Manifest                         |   1 +
 .../protobuf-3.12.0-disable_no-warning-test.patch  |  19 ++
 ...protobuf-3.12.0-protoc_input_output_files.patch | 262 +++++++++++++++++++++
 .../files/protobuf-3.12.0-system_libraries.patch   | 121 ++++++++++
 ...protobuf-9999.ebuild => protobuf-3.12.2.ebuild} |  18 +-
 dev-libs/protobuf/protobuf-9999.ebuild             |   6 +-
 6 files changed, 420 insertions(+), 7 deletions(-)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index 806addb1d66..4667b310046 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -1,2 +1,3 @@
 DIST protobuf-3.10.1.tar.gz 4905995 BLAKE2B 1dde3b6260918da8430c2ce69210462f339c492b2a4e53d5d9c1bea3747aead905370507fc4bd703560f6885c0f3f8393a998b875c19744ad94827109ecbb49f SHA512 aba0c4034c0d3b1759904adb6270eee94dd5dc568f433b219e3f1f70c0033993cdfa3bf476ad3f5767c7629edb9fd029c686405abf93731dde808286b336330d
 DIST protobuf-3.11.4.tar.gz 5140799 BLAKE2B 97b450c0623593efe6a42b66582ff183344b8831689e6a5b4d36096dbd57c33da9569bbf26578536aaf73ecd866ac0588b6cb7d55a6a9b9a6e840d4c57099001 SHA512 777bbb0e9e2375eaebe6b8c87abd660bac70ee469c9ad00dd25917b82d7fb5bbe33cf87f0d69c90e19d55c07a7285ec20974ba4768623ce9ccfadf147fd5e261
+DIST protobuf-3.12.2.tar.gz 5309688 BLAKE2B 6f04ab75a165d8135b4c1de210f8698f56f309f73d664192209de10580e0ef850bf56f6f394b860f21912e341141f7bbb1f63198eaee55fd7ad74d86b00c3b1f SHA512 84a349a1dcb5bce6a6a892cf11264390b557ed1e7b05883b71fa9cfb7460d9f73119da1f2861066869e33c752246ea438d5ce2c2b3ff7a4b07696d9450b7916b

diff --git a/dev-libs/protobuf/files/protobuf-3.12.0-disable_no-warning-test.patch b/dev-libs/protobuf/files/protobuf-3.12.0-disable_no-warning-test.patch
new file mode 100644
index 00000000000..d7dd5b5b1bb
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.12.0-disable_no-warning-test.patch
@@ -0,0 +1,19 @@
+Disable no-warning-test which is compiled with -Werror option and whose only purpose is checking if compilation results in any warnings.
+
+--- /src/Makefile.am
++++ /src/Makefile.am
+@@ -717,7 +717,7 @@
+ GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
+ check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
+                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
+-                 no-warning-test $(GZCHECKPROGRAMS)
++                 $(GZCHECKPROGRAMS)
+ protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+                       $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
+                       $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
+@@ -904,4 +904,4 @@
+ 
+ TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
+         google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS)     \
+-        protobuf-lite-arena-test no-warning-test
++        protobuf-lite-arena-test

diff --git a/dev-libs/protobuf/files/protobuf-3.12.0-protoc_input_output_files.patch b/dev-libs/protobuf/files/protobuf-3.12.0-protoc_input_output_files.patch
new file mode 100644
index 00000000000..3123ae5b27b
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.12.0-protoc_input_output_files.patch
@@ -0,0 +1,262 @@
+https://github.com/protocolbuffers/protobuf/pull/235
+
+--- /src/google/protobuf/compiler/command_line_interface.cc
++++ /src/google/protobuf/compiler/command_line_interface.cc
+@@ -997,6 +997,28 @@
+   }
+ 
+   if (mode_ == MODE_ENCODE || mode_ == MODE_DECODE) {
++    bool success = false;
++    int in_fd = STDIN_FILENO;
++    int out_fd = STDOUT_FILENO;
++
++    if (!protobuf_in_path_.empty()) {
++      in_fd = open(protobuf_in_path_.c_str(), O_RDONLY);
++      if (in_fd == -1) {
++        std::cerr << protobuf_in_path_ << ": error: failed to open file." << std::endl;
++        return 1;
++      }
++    }
++    if (!protobuf_out_path_.empty()) {
++      out_fd = open(protobuf_out_path_.c_str(),
++                    O_WRONLY | O_CREAT | O_TRUNC,
++                    0644);
++      if (out_fd == -1) {
++        std::cerr << protobuf_out_path_ << ": error: failed to open file." << std::endl;
++        close(in_fd);
++        return 1;
++      }
++    }
++
+     if (codec_type_.empty()) {
+       // HACK:  Define an EmptyMessage type to use for decoding.
+       DescriptorPool pool;
+@@ -1005,13 +1027,20 @@
+       file.add_message_type()->set_name("EmptyMessage");
+       GOOGLE_CHECK(pool.BuildFile(file) != NULL);
+       codec_type_ = "EmptyMessage";
+-      if (!EncodeOrDecode(&pool)) {
+-        return 1;
+-      }
++      success = EncodeOrDecode(&pool, in_fd, out_fd);
+     } else {
+-      if (!EncodeOrDecode(descriptor_pool.get())) {
+-        return 1;
+-      }
++      success = EncodeOrDecode(descriptor_pool.get(), in_fd, out_fd);
++    }
++
++    if (in_fd != STDIN_FILENO) {
++      close(in_fd);
++    }
++    if (out_fd != STDOUT_FILENO) {
++      close(out_fd);
++    }
++
++    if (!success) {
++      return 1;
+     }
+   }
+ 
+@@ -1049,6 +1078,11 @@
+   for (int i = 0; i < proto_path_.size(); i++) {
+     source_tree->MapPath(proto_path_[i].first, proto_path_[i].second);
+   }
++  if (mode_ == MODE_COMPILE &&
++      (!protobuf_in_path_.empty() || !protobuf_out_path_.empty())) {
++    std::cerr << "--protobuf_in and --protobuf_out are only valid with "
++         << "decode operations. Ignoring.";
++  }
+ 
+   // Map input files to virtual paths if possible.
+   if (!MakeInputsBeProtoPathRelative(source_tree, fallback_database)) {
+@@ -1750,6 +1784,12 @@
+ 
+     codec_type_ = value;
+ 
++  } else if (name == "--protobuf_in") {
++    protobuf_in_path_ = value;
++
++  } else if (name == "--protobuf_out") {
++    protobuf_out_path_ = value;
++
+   } else if (name == "--error_format") {
+     if (value == "gcc") {
+       error_format_ = ERROR_FORMAT_GCC;
+@@ -1886,29 +1926,50 @@
+          "  -h, --help                  Show this text and exit.\n"
+          "  --encode=MESSAGE_TYPE       Read a text-format message of the "
+          "given type\n"
+-         "                              from standard input and write it in "
+-         "binary\n"
+-         "                              to standard output.  The message type "
+-         "must\n"
++         "                              and write it in binary.  The message "
++         "type must\n"
+          "                              be defined in PROTO_FILES or their "
+          "imports.\n"
++         "                              The input/output protobuf files are "
++         "specified\n"
++         "                              using the --protobuf_in and "
++         "--protobuf_out\n"
++         "                              command line flags.\n"
+          "  --decode=MESSAGE_TYPE       Read a binary message of the given "
+-         "type from\n"
+-         "                              standard input and write it in text "
+-         "format\n"
+-         "                              to standard output.  The message type "
+-         "must\n"
+-         "                              be defined in PROTO_FILES or their "
+-         "imports.\n"
++         "type and\n"
++         "                              write it in text format.  The message "
++         "type\n"
++         "                              must be defined in PROTO_FILES or "
++         "their imports.\n"
++         "                              The input/output protobuf files are "
++         "specified\n"
++         "                              using the --protobuf_in and "
++         "--protobuf_out\n"
++         "                              command line flags.\n"
+          "  --decode_raw                Read an arbitrary protocol message "
+-         "from\n"
+-         "                              standard input and write the raw "
+-         "tag/value\n"
+-         "                              pairs in text format to standard "
+-         "output.  No\n"
++         "and write\n"
++         "                              the raw tag/value pairs in text format."
++         "  No\n"
+          "                              PROTO_FILES should be given when using "
+          "this\n"
+-         "                              flag.\n"
++         "                              flag.  The input/output protobuf files "
++         "are\n"
++         "                              specified using the --protobuf_in and\n"
++         "                              --protobuf_out command line flags.\n"
++         "  --protobuf_in=FILE          Absolute path to the protobuf file "
++         "from which\n"
++         "                              input of encoding/decoding operation "
++         "will be\n"
++         "                              read.  If omitted, input will be read "
++         "from\n"
++         "                              standard input.\n"
++         "  --protobuf_out=FILE         Absolute path to the protobuf file "
++         "to which\n"
++         "                              output of encoding/decoding operation "
++         "will be\n"
++         "                              written.  If omitted, output will be "
++         "written to\n"
++         "                              standard output.\n"
+          "  --descriptor_set_in=FILES   Specifies a delimited list of FILES\n"
+          "                              each containing a FileDescriptorSet "
+          "(a\n"
+@@ -2254,7 +2315,9 @@
+   return true;
+ }
+ 
+-bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool) {
++bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool,
++                                          int in_fd,
++                                          int out_fd) {
+   // Look up the type.
+   const Descriptor* type = pool->FindMessageTypeByName(codec_type_);
+   if (type == NULL) {
+@@ -2266,15 +2329,15 @@
+   std::unique_ptr<Message> message(dynamic_factory.GetPrototype(type)->New());
+ 
+   if (mode_ == MODE_ENCODE) {
+-    SetFdToTextMode(STDIN_FILENO);
+-    SetFdToBinaryMode(STDOUT_FILENO);
++    SetFdToTextMode(in_fd);
++    SetFdToBinaryMode(out_fd);
+   } else {
+-    SetFdToBinaryMode(STDIN_FILENO);
+-    SetFdToTextMode(STDOUT_FILENO);
++    SetFdToBinaryMode(in_fd);
++    SetFdToTextMode(out_fd);
+   }
+ 
+-  io::FileInputStream in(STDIN_FILENO);
+-  io::FileOutputStream out(STDOUT_FILENO);
++  io::FileInputStream in(in_fd);
++  io::FileOutputStream out(out_fd);
+ 
+   if (mode_ == MODE_ENCODE) {
+     // Input is text.
+--- /src/google/protobuf/compiler/command_line_interface.h
++++ /src/google/protobuf/compiler/command_line_interface.h
+@@ -296,7 +296,9 @@
+       GeneratorContext* generator_context, std::string* error);
+ 
+   // Implements --encode and --decode.
+-  bool EncodeOrDecode(const DescriptorPool* pool);
++  bool EncodeOrDecode(const DescriptorPool* pool,
++                      int in_fd,
++                      int out_fd);
+ 
+   // Implements the --descriptor_set_out option.
+   bool WriteDescriptorSet(
+@@ -428,6 +430,13 @@
+   // parsed FileDescriptorSets to be used for loading protos.  Otherwise, empty.
+   std::vector<std::string> descriptor_set_in_names_;
+ 
++  // When using --encode / --decode / --decode_raw absolute path to the output
++  // file. (Empty string indicates write to STDOUT).
++  std::string protobuf_out_path_;
++  // When using --encode / --decode / --decode_raw, absolute path to the input
++  // file. (Empty string indicates read from STDIN).
++  std::string protobuf_in_path_;
++
+   // If --descriptor_set_out was given, this is the filename to which the
+   // FileDescriptorSet should be written.  Otherwise, empty.
+   std::string descriptor_set_out_name_;
+--- /src/google/protobuf/compiler/command_line_interface_unittest.cc
++++ /src/google/protobuf/compiler/command_line_interface_unittest.cc
+@@ -95,7 +95,7 @@
+   virtual void SetUp();
+   virtual void TearDown();
+ 
+-  // Runs the CommandLineInterface with the given command line.  The
++  // Run the CommandLineInterface with the given command line.  The
+   // command is automatically split on spaces, and the string "$tmpdir"
+   // is replaced with TestTempDir().
+   void Run(const std::string& command);
+@@ -2625,6 +2625,17 @@
+               std::string::npos);
+   }
+ 
++  void ExpectBinaryFilesMatch(const string &expected_file,
++                              const string &actual_file) {
++    string expected_output, actual_output;
++    ASSERT_TRUE(File::ReadFileToString(expected_file, &expected_output));
++    ASSERT_TRUE(File::ReadFileToString(actual_file, &actual_output));
++
++    // Don't use EXPECT_EQ because we don't want to print raw binary data to
++    // stdout on failure.
++    EXPECT_TRUE(expected_output == actual_output);
++  }
++
+  private:
+   void WriteUnittestProtoDescriptorSet() {
+     unittest_proto_descriptor_set_filename_ =
+@@ -2719,6 +2730,19 @@
+       "net/proto2/internal/no_such_file.proto: No such file or directory\n");
+ }
+ 
++TEST_P(EncodeDecodeTest, RedirectInputOutput) {
++  string out_file = TestTempDir() + "/golden_message_out.pbf";
++  EXPECT_TRUE(
++      Run(TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto") +
++          " --encode=protobuf_unittest.TestAllTypes" +
++          " --protobuf_in=" + TestUtil::GetTestDataPath(
++              "net/proto2/internal/"
++              "testdata/text_format_unittest_data_oneof_implemented.txt") +
++          " --protobuf_out=" + out_file));
++  ExpectBinaryFilesMatch(out_file, TestUtil::GetTestDataPath(
++      "net/proto2/internal/testdata/golden_message_oneof_implemented"));
++}
++
+ INSTANTIATE_TEST_SUITE_P(FileDescriptorSetSource, EncodeDecodeTest,
+                          testing::Values(PROTO_PATH, DESCRIPTOR_SET_IN));
+ }  // anonymous namespace

diff --git a/dev-libs/protobuf/files/protobuf-3.12.0-system_libraries.patch b/dev-libs/protobuf/files/protobuf-3.12.0-system_libraries.patch
new file mode 100644
index 00000000000..cd7c3493da8
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.12.0-system_libraries.patch
@@ -0,0 +1,121 @@
+--- /Makefile.am
++++ /Makefile.am
+@@ -11,28 +11,10 @@
+ # Always include third_party directories in distributions.
+ DIST_SUBDIRS = src conformance benchmarks third_party/googletest
+ 
+-# Build gmock before we build protobuf tests.  We don't add gmock to SUBDIRS
+-# because then "make check" would also build and run all of gmock's own tests,
+-# which takes a lot of time and is generally not useful to us.  Also, we don't
+-# want "make install" to recurse into gmock since we don't want to overwrite
+-# the installed version of gmock if there is one.
+ check-local:
+-	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
+-	@cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
+-	@cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
+ 
+-# We would like to clean gmock when "make clean" is invoked.  But we have to
+-# be careful because clean-local is also invoked during "make distclean", but
+-# "make distclean" already recurses into gmock because it's listed among the
+-# DIST_SUBDIRS.  distclean will delete gmock/Makefile, so if we then try to
+-# cd to the directory again and "make clean" it will fail.  So, check that the
+-# Makefile exists before recursing.
+ clean-local:
+-	@if test -e third_party/googletest/Makefile; then \
+-	  echo "Making clean in googletest"; \
+-	  cd third_party/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; \
+-	fi; \
+-	if test -e conformance/Makefile; then \
++	@if test -e conformance/Makefile; then \
+ 	  echo "Making clean in conformance"; \
+ 	  cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \
+ 	fi; \
+--- /configure.ac
++++ /configure.ac
+@@ -223,12 +223,5 @@
+ esac
+ AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1])
+ 
+-# HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
+-#   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
+-#   too.
+-export CFLAGS
+-export CXXFLAGS
+-AC_CONFIG_SUBDIRS([third_party/googletest])
+-
+ AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
+ AC_OUTPUT
+--- /src/Makefile.am
++++ /src/Makefile.am
+@@ -711,19 +711,11 @@
+   google/protobuf/testing/file.cc                              \
+   google/protobuf/testing/file.h
+ 
+-GOOGLETEST_BUILD_DIR=../third_party/googletest/googletest
+-GOOGLEMOCK_BUILD_DIR=../third_party/googletest/googlemock
+-GOOGLETEST_SRC_DIR=$(srcdir)/../third_party/googletest/googletest
+-GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
+ check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
+                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
+                  $(GZCHECKPROGRAMS)
+ protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \
+-                         -I$(GOOGLEMOCK_SRC_DIR)/include
++                      -lgtest -lgmock -lgmock_main
+ # Disable optimization for tests unless the user explicitly asked for it,
+ # since test_util.cc takes forever to compile with optimization (with GCC).
+ # See configure.ac for more info.
+@@ -815,12 +807,8 @@
+ # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
+ protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
+                       libprotoc.la                                   \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
+-                                         -I$(GOOGLETEST_SRC_DIR)/include \
+-                                         -DPROTOBUF_TEST_NO_DESCRIPTORS
++                      -lgtest -lgmock -lgmock_main
++protobuf_lazy_descriptor_test_CPPFLAGS = -DPROTOBUF_TEST_NO_DESCRIPTORS
+ protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lazy_descriptor_test_SOURCES =                        \
+   google/protobuf/compiler/cpp/cpp_unittest.cc                 \
+@@ -841,11 +829,7 @@
+ # full runtime and we want to make sure this test builds without full
+ # runtime.
+ protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la     \
+-                           $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
+-                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
+-                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \
+-                             -I$(GOOGLETEST_SRC_DIR)/include
++                           -lgtest -lgmock -lgmock_main
+ protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lite_test_SOURCES =                                           \
+   google/protobuf/lite_unittest.cc                                     \
+@@ -857,11 +841,7 @@
+ # gtest when building the test internally our memory sanitizer doesn't detect
+ # memory leaks (don't know why).
+ protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include  \
+-                                    -I$(GOOGLETEST_SRC_DIR)/include
++                      -lgtest -lgmock -lgmock_main
+ protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lite_arena_test_SOURCES =       \
+   google/protobuf/lite_arena_unittest.cc \
+@@ -871,8 +851,7 @@
+ 
+ # Test plugin binary.
+ test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+-                    $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la
+-test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include
++                    -lgtest
+ test_plugin_SOURCES =                                          \
+   google/protobuf/compiler/mock_code_generator.cc              \
+   google/protobuf/testing/file.cc                              \

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-3.12.2.ebuild
similarity index 82%
copy from dev-libs/protobuf/protobuf-9999.ebuild
copy to dev-libs/protobuf/protobuf-3.12.2.ebuild
index 5eddabdf177..16f0b7ed8c1 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-3.12.2.ebuild
@@ -22,7 +22,7 @@ fi
 
 LICENSE="BSD"
 SLOT="0/23"
-KEYWORDS=""
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
 IUSE="emacs examples static-libs test zlib"
 RESTRICT="!test? ( test )"
 
@@ -33,20 +33,30 @@ RDEPEND="emacs? ( app-editors/emacs:* )
 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
 
 PATCHES=(
-	"${FILESDIR}/${PN}-3.11.0-disable_no-warning-test.patch"
-	"${FILESDIR}/${PN}-3.11.0-system_libraries.patch"
-	"${FILESDIR}/${PN}-3.11.0-protoc_input_output_files.patch"
+	"${FILESDIR}/${PN}-3.12.0-disable_no-warning-test.patch"
+	"${FILESDIR}/${PN}-3.12.0-system_libraries.patch"
+	"${FILESDIR}/${PN}-3.12.0-protoc_input_output_files.patch"
 )
 
 DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
 
 src_prepare() {
 	default
+
+	# https://github.com/protocolbuffers/protobuf/issues/7413
+	sed -e "/^AC_PROG_CXX_FOR_BUILD$/d" -i configure.ac || die
+
 	eautoreconf
 }
 
 src_configure() {
 	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
+
+	if tc-ld-is-gold; then
+		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+		tc-ld-disable-gold
+	fi
+
 	multilib-minimal_src_configure
 }
 

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-9999.ebuild
index 5eddabdf177..4b1a78fbac4 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-9999.ebuild
@@ -33,9 +33,9 @@ RDEPEND="emacs? ( app-editors/emacs:* )
 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
 
 PATCHES=(
-	"${FILESDIR}/${PN}-3.11.0-disable_no-warning-test.patch"
-	"${FILESDIR}/${PN}-3.11.0-system_libraries.patch"
-	"${FILESDIR}/${PN}-3.11.0-protoc_input_output_files.patch"
+	"${FILESDIR}/${PN}-3.12.0-disable_no-warning-test.patch"
+	"${FILESDIR}/${PN}-3.12.0-system_libraries.patch"
+	"${FILESDIR}/${PN}-3.12.0-protoc_input_output_files.patch"
 )
 
 DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2020-11-22 19:32 Mike Gilbert
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Gilbert @ 2020-11-22 19:32 UTC (permalink / raw
  To: gentoo-commits

commit:     8674b9ae5d43cf28bf1acbb121036c3ac5071ec1
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Nov 22 04:00:00 2020 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Nov 22 19:31:56 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8674b9ae

dev-libs/protobuf: Version bump (3.14.0).

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 dev-libs/protobuf/Manifest                         |   1 +
 ...protobuf-3.14.0-protoc_input_output_files.patch | 268 +++++++++++++++++++++
 ...protobuf-9999.ebuild => protobuf-3.14.0.ebuild} |  14 +-
 dev-libs/protobuf/protobuf-9999.ebuild             |   2 +-
 4 files changed, 282 insertions(+), 3 deletions(-)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index 579b5e38b3f..517abfc7f26 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -2,3 +2,4 @@ DIST protobuf-3.11.4.tar.gz 5140799 BLAKE2B 97b450c0623593efe6a42b66582ff183344b
 DIST protobuf-3.12.2.tar.gz 5309688 BLAKE2B 6f04ab75a165d8135b4c1de210f8698f56f309f73d664192209de10580e0ef850bf56f6f394b860f21912e341141f7bbb1f63198eaee55fd7ad74d86b00c3b1f SHA512 84a349a1dcb5bce6a6a892cf11264390b557ed1e7b05883b71fa9cfb7460d9f73119da1f2861066869e33c752246ea438d5ce2c2b3ff7a4b07696d9450b7916b
 DIST protobuf-3.12.4.tar.gz 5310348 BLAKE2B 2630941672963165467221843c10079a0ed966f2fdfcbc970b0b41e1ed3c7f78734496c1fbd3ec509c68999a14f637fff267b309cf82a8acf2bb5a948484f79b SHA512 c5d24502b9a6be0a606a19213186fe462e0de6830547003636f0897781f36d0bd7e4e7d9689d96390a0399ce04b6438cda3a0fe6f97f0feb700a110e90beef0c
 DIST protobuf-3.13.0.tar.gz 5277913 BLAKE2B 168aaa5beef83be675cd2543ca8efeaf5174f5e7fd861a056b04b01c8c781dc7b1fcbd05068ae89f051dfacfdc47c34b19cc33c8d09dd3212d3827746e3408f2 SHA512 514efa65fc8a36bc0791e6d39bdfb07b2689e9c2a4b82536c657859b800e7bc1e1a0ae86a7ee33f30c43a473a49b5c346ce830ac0057b6da104ed37f90b8b0fd
+DIST protobuf-3.14.0.tar.gz 5319779 BLAKE2B cea083eea4d7fec441536effdfe2bf1811913154b0cc0da2f14f4edeb0efb200236da102c36700e24fab73fd9883aa90576ad64603a7f175ebf5cef0dc29aae5 SHA512 9dabba81119cb6196ef5de382a1032c57f6e69038f4dce0156f8671b98e51bb5095915fb6d05bb5a8ad8b17b559e652e1e9a392dd30c7ed8dcf1d986c137be11

diff --git a/dev-libs/protobuf/files/protobuf-3.14.0-protoc_input_output_files.patch b/dev-libs/protobuf/files/protobuf-3.14.0-protoc_input_output_files.patch
new file mode 100644
index 00000000000..a36bdcb734a
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.14.0-protoc_input_output_files.patch
@@ -0,0 +1,268 @@
+https://github.com/protocolbuffers/protobuf/pull/235
+
+--- /src/google/protobuf/compiler/command_line_interface.cc
++++ /src/google/protobuf/compiler/command_line_interface.cc
+@@ -1109,6 +1109,28 @@
+   }
+ 
+   if (mode_ == MODE_ENCODE || mode_ == MODE_DECODE) {
++    bool success = false;
++    int in_fd = STDIN_FILENO;
++    int out_fd = STDOUT_FILENO;
++
++    if (!protobuf_in_path_.empty()) {
++      in_fd = open(protobuf_in_path_.c_str(), O_RDONLY);
++      if (in_fd == -1) {
++        std::cerr << protobuf_in_path_ << ": error: failed to open file." << std::endl;
++        return 1;
++      }
++    }
++    if (!protobuf_out_path_.empty()) {
++      out_fd = open(protobuf_out_path_.c_str(),
++                    O_WRONLY | O_CREAT | O_TRUNC,
++                    0644);
++      if (out_fd == -1) {
++        std::cerr << protobuf_out_path_ << ": error: failed to open file." << std::endl;
++        close(in_fd);
++        return 1;
++      }
++    }
++
+     if (codec_type_.empty()) {
+       // HACK:  Define an EmptyMessage type to use for decoding.
+       DescriptorPool pool;
+@@ -1117,13 +1139,20 @@
+       file.add_message_type()->set_name("EmptyMessage");
+       GOOGLE_CHECK(pool.BuildFile(file) != NULL);
+       codec_type_ = "EmptyMessage";
+-      if (!EncodeOrDecode(&pool)) {
+-        return 1;
+-      }
++      success = EncodeOrDecode(&pool, in_fd, out_fd);
+     } else {
+-      if (!EncodeOrDecode(descriptor_pool.get())) {
+-        return 1;
+-      }
++      success = EncodeOrDecode(descriptor_pool.get(), in_fd, out_fd);
++    }
++
++    if (in_fd != STDIN_FILENO) {
++      close(in_fd);
++    }
++    if (out_fd != STDOUT_FILENO) {
++      close(out_fd);
++    }
++
++    if (!success) {
++      return 1;
+     }
+   }
+ 
+@@ -1161,6 +1190,11 @@
+   for (int i = 0; i < proto_path_.size(); i++) {
+     source_tree->MapPath(proto_path_[i].first, proto_path_[i].second);
+   }
++  if (mode_ == MODE_COMPILE &&
++      (!protobuf_in_path_.empty() || !protobuf_out_path_.empty())) {
++    std::cerr << "--protobuf_in and --protobuf_out are only valid with "
++         << "decode operations. Ignoring.";
++  }
+ 
+   // Map input files to virtual paths if possible.
+   if (!MakeInputsBeProtoPathRelative(source_tree, fallback_database)) {
+@@ -1904,6 +1938,12 @@
+   } else if (name == "--deterministic_output") {
+     deterministic_output_ = true;
+ 
++  } else if (name == "--protobuf_in") {
++    protobuf_in_path_ = value;
++
++  } else if (name == "--protobuf_out") {
++    protobuf_out_path_ = value;
++
+   } else if (name == "--error_format") {
+     if (value == "gcc") {
+       error_format_ = ERROR_FORMAT_GCC;
+@@ -2040,12 +2080,15 @@
+          "  -h, --help                  Show this text and exit.\n"
+          "  --encode=MESSAGE_TYPE       Read a text-format message of the "
+          "given type\n"
+-         "                              from standard input and write it in "
+-         "binary\n"
+-         "                              to standard output.  The message type "
+-         "must\n"
++         "                              and write it in binary.  The message "
++         "type must\n"
+          "                              be defined in PROTO_FILES or their "
+          "imports.\n"
++         "                              The input/output protobuf files are "
++         "specified\n"
++         "                              using the --protobuf_in and "
++         "--protobuf_out\n"
++         "                              command line flags.\n"
+          "  --deterministic_output      When using --encode, ensure map fields "
+          "are\n"
+          "                              deterministically ordered. Note that"
+@@ -2053,22 +2096,40 @@
+          "                              canonical, and changes across builds"
+          "or releases of protoc.\n"
+          "  --decode=MESSAGE_TYPE       Read a binary message of the given "
+-         "type from\n"
+-         "                              standard input and write it in text "
+-         "format\n"
+-         "                              to standard output.  The message type "
+-         "must\n"
+-         "                              be defined in PROTO_FILES or their "
+-         "imports.\n"
++         "type and\n"
++         "                              write it in text format.  The message "
++         "type\n"
++         "                              must be defined in PROTO_FILES or "
++         "their imports.\n"
++         "                              The input/output protobuf files are "
++         "specified\n"
++         "                              using the --protobuf_in and "
++         "--protobuf_out\n"
++         "                              command line flags.\n"
+          "  --decode_raw                Read an arbitrary protocol message "
+-         "from\n"
+-         "                              standard input and write the raw "
+-         "tag/value\n"
+-         "                              pairs in text format to standard "
+-         "output.  No\n"
++         "and write\n"
++         "                              the raw tag/value pairs in text format."
++         "  No\n"
+          "                              PROTO_FILES should be given when using "
+          "this\n"
+-         "                              flag.\n"
++         "                              flag.  The input/output protobuf files "
++         "are\n"
++         "                              specified using the --protobuf_in and\n"
++         "                              --protobuf_out command line flags.\n"
++         "  --protobuf_in=FILE          Absolute path to the protobuf file "
++         "from which\n"
++         "                              input of encoding/decoding operation "
++         "will be\n"
++         "                              read.  If omitted, input will be read "
++         "from\n"
++         "                              standard input.\n"
++         "  --protobuf_out=FILE         Absolute path to the protobuf file "
++         "to which\n"
++         "                              output of encoding/decoding operation "
++         "will be\n"
++         "                              written.  If omitted, output will be "
++         "written to\n"
++         "                              standard output.\n"
+          "  --descriptor_set_in=FILES   Specifies a delimited list of FILES\n"
+          "                              each containing a FileDescriptorSet "
+          "(a\n"
+@@ -2416,7 +2477,9 @@
+   return true;
+ }
+ 
+-bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool) {
++bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool,
++                                          int in_fd,
++                                          int out_fd) {
+   // Look up the type.
+   const Descriptor* type = pool->FindMessageTypeByName(codec_type_);
+   if (type == NULL) {
+@@ -2428,15 +2491,15 @@
+   std::unique_ptr<Message> message(dynamic_factory.GetPrototype(type)->New());
+ 
+   if (mode_ == MODE_ENCODE) {
+-    SetFdToTextMode(STDIN_FILENO);
+-    SetFdToBinaryMode(STDOUT_FILENO);
++    SetFdToTextMode(in_fd);
++    SetFdToBinaryMode(out_fd);
+   } else {
+-    SetFdToBinaryMode(STDIN_FILENO);
+-    SetFdToTextMode(STDOUT_FILENO);
++    SetFdToBinaryMode(in_fd);
++    SetFdToTextMode(out_fd);
+   }
+ 
+-  io::FileInputStream in(STDIN_FILENO);
+-  io::FileOutputStream out(STDOUT_FILENO);
++  io::FileInputStream in(in_fd);
++  io::FileOutputStream out(out_fd);
+ 
+   if (mode_ == MODE_ENCODE) {
+     // Input is text.
+--- /src/google/protobuf/compiler/command_line_interface.h
++++ /src/google/protobuf/compiler/command_line_interface.h
+@@ -296,7 +296,9 @@
+       GeneratorContext* generator_context, std::string* error);
+ 
+   // Implements --encode and --decode.
+-  bool EncodeOrDecode(const DescriptorPool* pool);
++  bool EncodeOrDecode(const DescriptorPool* pool,
++                      int in_fd,
++                      int out_fd);
+ 
+   // Implements the --descriptor_set_out option.
+   bool WriteDescriptorSet(
+@@ -428,6 +430,13 @@
+   // parsed FileDescriptorSets to be used for loading protos.  Otherwise, empty.
+   std::vector<std::string> descriptor_set_in_names_;
+ 
++  // When using --encode / --decode / --decode_raw absolute path to the output
++  // file. (Empty string indicates write to STDOUT).
++  std::string protobuf_out_path_;
++  // When using --encode / --decode / --decode_raw, absolute path to the input
++  // file. (Empty string indicates read from STDIN).
++  std::string protobuf_in_path_;
++
+   // If --descriptor_set_out was given, this is the filename to which the
+   // FileDescriptorSet should be written.  Otherwise, empty.
+   std::string descriptor_set_out_name_;
+--- /src/google/protobuf/compiler/command_line_interface_unittest.cc
++++ /src/google/protobuf/compiler/command_line_interface_unittest.cc
+@@ -97,7 +97,7 @@
+   virtual void SetUp();
+   virtual void TearDown();
+ 
+-  // Runs the CommandLineInterface with the given command line.  The
++  // Run the CommandLineInterface with the given command line.  The
+   // command is automatically split on spaces, and the string "$tmpdir"
+   // is replaced with TestTempDir().
+   void Run(const std::string& command);
+@@ -2638,6 +2638,17 @@
+               std::string::npos);
+   }
+ 
++  void ExpectBinaryFilesMatch(const string &expected_file,
++                              const string &actual_file) {
++    string expected_output, actual_output;
++    ASSERT_TRUE(File::ReadFileToString(expected_file, &expected_output));
++    ASSERT_TRUE(File::ReadFileToString(actual_file, &actual_output));
++
++    // Don't use EXPECT_EQ because we don't want to print raw binary data to
++    // stdout on failure.
++    EXPECT_TRUE(expected_output == actual_output);
++  }
++
+  private:
+   void WriteUnittestProtoDescriptorSet() {
+     unittest_proto_descriptor_set_filename_ =
+@@ -2761,6 +2772,19 @@
+       "Can only use --deterministic_output with --encode.\n");
+ }
+ 
++TEST_P(EncodeDecodeTest, RedirectInputOutput) {
++  string out_file = TestTempDir() + "/golden_message_out.pbf";
++  EXPECT_TRUE(
++      Run(TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto") +
++          " --encode=protobuf_unittest.TestAllTypes" +
++          " --protobuf_in=" + TestUtil::GetTestDataPath(
++              "net/proto2/internal/"
++              "testdata/text_format_unittest_data_oneof_implemented.txt") +
++          " --protobuf_out=" + out_file));
++  ExpectBinaryFilesMatch(out_file, TestUtil::GetTestDataPath(
++      "net/proto2/internal/testdata/golden_message_oneof_implemented"));
++}
++
+ INSTANTIATE_TEST_SUITE_P(FileDescriptorSetSource, EncodeDecodeTest,
+                          testing::Values(PROTO_PATH, DESCRIPTOR_SET_IN));
+ }  // anonymous namespace

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-3.14.0.ebuild
similarity index 86%
copy from dev-libs/protobuf/protobuf-9999.ebuild
copy to dev-libs/protobuf/protobuf-3.14.0.ebuild
index f11f9015315..706e7d50e34 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-3.14.0.ebuild
@@ -22,7 +22,7 @@ fi
 
 LICENSE="BSD"
 SLOT="0/25"
-KEYWORDS=""
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
 IUSE="emacs examples static-libs test zlib"
 RESTRICT="!test? ( test )"
 
@@ -35,18 +35,28 @@ RDEPEND="emacs? ( app-editors/emacs:* )
 PATCHES=(
 	"${FILESDIR}/${PN}-3.13.0-disable_no-warning-test.patch"
 	"${FILESDIR}/${PN}-3.13.0-system_libraries.patch"
-	"${FILESDIR}/${PN}-3.13.0-protoc_input_output_files.patch"
+	"${FILESDIR}/${PN}-3.14.0-protoc_input_output_files.patch"
 )
 
 DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
 
 src_prepare() {
 	default
+
+	# https://github.com/protocolbuffers/protobuf/issues/7413
+	sed -e "/^AC_PROG_CXX_FOR_BUILD$/d" -i configure.ac || die
+
 	eautoreconf
 }
 
 src_configure() {
 	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
+
+	if tc-ld-is-gold; then
+		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+		tc-ld-disable-gold
+	fi
+
 	multilib-minimal_src_configure
 }
 

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-9999.ebuild
index f11f9015315..ae36a439b16 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-9999.ebuild
@@ -35,7 +35,7 @@ RDEPEND="emacs? ( app-editors/emacs:* )
 PATCHES=(
 	"${FILESDIR}/${PN}-3.13.0-disable_no-warning-test.patch"
 	"${FILESDIR}/${PN}-3.13.0-system_libraries.patch"
-	"${FILESDIR}/${PN}-3.13.0-protoc_input_output_files.patch"
+	"${FILESDIR}/${PN}-3.14.0-protoc_input_output_files.patch"
 )
 
 DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2021-06-06 17:04 Mike Gilbert
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Gilbert @ 2021-06-06 17:04 UTC (permalink / raw
  To: gentoo-commits

commit:     540f19a175063c37713fbebc9dac081cedd4f1e8
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sat Jun  5 00:00:00 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Jun  6 17:04:39 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=540f19a1

dev-libs/protobuf: Delete old version (3.14.0).

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 dev-libs/protobuf/Manifest                         |   1 -
 .../protobuf-3.13.0-disable_no-warning-test.patch  |  19 --
 .../files/protobuf-3.13.0-system_libraries.patch   | 121 ----------
 ...protobuf-3.14.0-protoc_input_output_files.patch | 268 ---------------------
 dev-libs/protobuf/protobuf-3.14.0.ebuild           | 131 ----------
 5 files changed, 540 deletions(-)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index db2b1f99008..a4051caa640 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -1,4 +1,3 @@
-DIST protobuf-3.14.0.tar.gz 5319779 BLAKE2B cea083eea4d7fec441536effdfe2bf1811913154b0cc0da2f14f4edeb0efb200236da102c36700e24fab73fd9883aa90576ad64603a7f175ebf5cef0dc29aae5 SHA512 9dabba81119cb6196ef5de382a1032c57f6e69038f4dce0156f8671b98e51bb5095915fb6d05bb5a8ad8b17b559e652e1e9a392dd30c7ed8dcf1d986c137be11
 DIST protobuf-3.15.0.tar.gz 5284848 BLAKE2B 6c1135499dd73b6d1764f47ded6415f8073841bccf5d5626e751fc159b67a6103d71a84096f563053c34c9e4235504238fcdc86ebb757d38b2f4bc1674d08674 SHA512 f52dfbfabdff3306d26ec05cbba7cd47bf3db8b08f4fb27e2cbd5a594de57f0a7ab2212dcea2055a9adfddc94ae4df2d0b1caea311ead75bb850ef8458b1b74a
 DIST protobuf-3.15.1.tar.gz 5284851 BLAKE2B 5e3f487ba1c3f6a3d2d87f2421f9b07aa4618df0853b05364d7f29e93d8e7dc4c3ece08ba3b7cd0bf69d0faaa32ccc952218a8df7575b74aa6216977f2b2219b SHA512 24efeec969ee72833c377e6287e3b06a431d54d9b3be50635685f6903534f15c2957d78cdbf4bcc6482732ecdbc735dc894c0b9095486419b8d11d6df6169180
 DIST protobuf-3.15.2.tar.gz 5284455 BLAKE2B 433ac18774395174798d110e4eaae95c44bc8be89cfae85648497f8531cf19513f4c7745a6afc27d6d49a07e7e1fb4faeff73530fa082665727095e837f11940 SHA512 34e82ece83f47249fd5398a955e4f0a32d0722abcaa4e90c741bdc5106a0bd92088babe3d10d818dd89e2e9254cecbb68ae0c182ea408d4f1e2d70318e7baf37

diff --git a/dev-libs/protobuf/files/protobuf-3.13.0-disable_no-warning-test.patch b/dev-libs/protobuf/files/protobuf-3.13.0-disable_no-warning-test.patch
deleted file mode 100644
index 1c583fec0fd..00000000000
--- a/dev-libs/protobuf/files/protobuf-3.13.0-disable_no-warning-test.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Disable no-warning-test which is compiled with -Werror option and whose only purpose is checking if compilation results in any warnings.
-
---- /src/Makefile.am
-+++ /src/Makefile.am
-@@ -708,7 +708,7 @@
- GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
- check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
-                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
--                 no-warning-test $(GZCHECKPROGRAMS)
-+                 $(GZCHECKPROGRAMS)
- protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
-                       $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
-                       $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
-@@ -895,4 +895,4 @@
- 
- TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
-         google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS)     \
--        protobuf-lite-arena-test no-warning-test
-+        protobuf-lite-arena-test

diff --git a/dev-libs/protobuf/files/protobuf-3.13.0-system_libraries.patch b/dev-libs/protobuf/files/protobuf-3.13.0-system_libraries.patch
deleted file mode 100644
index 990081ae1ab..00000000000
--- a/dev-libs/protobuf/files/protobuf-3.13.0-system_libraries.patch
+++ /dev/null
@@ -1,121 +0,0 @@
---- /Makefile.am
-+++ /Makefile.am
-@@ -11,28 +11,10 @@
- # Always include third_party directories in distributions.
- DIST_SUBDIRS = src conformance benchmarks third_party/googletest
- 
--# Build gmock before we build protobuf tests.  We don't add gmock to SUBDIRS
--# because then "make check" would also build and run all of gmock's own tests,
--# which takes a lot of time and is generally not useful to us.  Also, we don't
--# want "make install" to recurse into gmock since we don't want to overwrite
--# the installed version of gmock if there is one.
- check-local:
--	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
--	@cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
--	@cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
- 
--# We would like to clean gmock when "make clean" is invoked.  But we have to
--# be careful because clean-local is also invoked during "make distclean", but
--# "make distclean" already recurses into gmock because it's listed among the
--# DIST_SUBDIRS.  distclean will delete gmock/Makefile, so if we then try to
--# cd to the directory again and "make clean" it will fail.  So, check that the
--# Makefile exists before recursing.
- clean-local:
--	@if test -e third_party/googletest/Makefile; then \
--	  echo "Making clean in googletest"; \
--	  cd third_party/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; \
--	fi; \
--	if test -e conformance/Makefile; then \
-+	@if test -e conformance/Makefile; then \
- 	  echo "Making clean in conformance"; \
- 	  cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \
- 	fi; \
---- /configure.ac
-+++ /configure.ac
-@@ -223,12 +223,5 @@
- esac
- AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1])
- 
--# HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
--#   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
--#   too.
--export CFLAGS
--export CXXFLAGS
--AC_CONFIG_SUBDIRS([third_party/googletest])
--
- AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
- AC_OUTPUT
---- /src/Makefile.am
-+++ /src/Makefile.am
-@@ -702,19 +702,11 @@
-   google/protobuf/testing/file.cc                              \
-   google/protobuf/testing/file.h
- 
--GOOGLETEST_BUILD_DIR=../third_party/googletest/googletest
--GOOGLEMOCK_BUILD_DIR=../third_party/googletest/googlemock
--GOOGLETEST_SRC_DIR=$(srcdir)/../third_party/googletest/googletest
--GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
- check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
-                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
-                  $(GZCHECKPROGRAMS)
- protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
--                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
--protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \
--                         -I$(GOOGLEMOCK_SRC_DIR)/include
-+                      -lgtest -lgmock -lgmock_main
- # Disable optimization for tests unless the user explicitly asked for it,
- # since test_util.cc takes forever to compile with optimization (with GCC).
- # See configure.ac for more info.
-@@ -806,12 +798,8 @@
- # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
- protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
-                       libprotoc.la                                   \
--                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
--protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
--                                         -I$(GOOGLETEST_SRC_DIR)/include \
--                                         -DPROTOBUF_TEST_NO_DESCRIPTORS
-+                      -lgtest -lgmock -lgmock_main
-+protobuf_lazy_descriptor_test_CPPFLAGS = -DPROTOBUF_TEST_NO_DESCRIPTORS
- protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lazy_descriptor_test_SOURCES =                        \
-   google/protobuf/compiler/cpp/cpp_unittest.cc                 \
-@@ -832,11 +820,7 @@
- # full runtime and we want to make sure this test builds without full
- # runtime.
- protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la     \
--                           $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
--                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
--                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
--protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \
--                             -I$(GOOGLETEST_SRC_DIR)/include
-+                           -lgtest -lgmock -lgmock_main
- protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lite_test_SOURCES =                                           \
-   google/protobuf/lite_unittest.cc                                     \
-@@ -848,11 +832,7 @@
- # gtest when building the test internally our memory sanitizer doesn't detect
- # memory leaks (don't know why).
- protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
--                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
--protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include  \
--                                    -I$(GOOGLETEST_SRC_DIR)/include
-+                      -lgtest -lgmock -lgmock_main
- protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lite_arena_test_SOURCES =       \
-   google/protobuf/lite_arena_unittest.cc \
-@@ -862,8 +842,7 @@
- 
- # Test plugin binary.
- test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
--                    $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la
--test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include
-+                    -lgtest
- test_plugin_SOURCES =                                          \
-   google/protobuf/compiler/mock_code_generator.cc              \
-   google/protobuf/testing/file.cc                              \

diff --git a/dev-libs/protobuf/files/protobuf-3.14.0-protoc_input_output_files.patch b/dev-libs/protobuf/files/protobuf-3.14.0-protoc_input_output_files.patch
deleted file mode 100644
index a36bdcb734a..00000000000
--- a/dev-libs/protobuf/files/protobuf-3.14.0-protoc_input_output_files.patch
+++ /dev/null
@@ -1,268 +0,0 @@
-https://github.com/protocolbuffers/protobuf/pull/235
-
---- /src/google/protobuf/compiler/command_line_interface.cc
-+++ /src/google/protobuf/compiler/command_line_interface.cc
-@@ -1109,6 +1109,28 @@
-   }
- 
-   if (mode_ == MODE_ENCODE || mode_ == MODE_DECODE) {
-+    bool success = false;
-+    int in_fd = STDIN_FILENO;
-+    int out_fd = STDOUT_FILENO;
-+
-+    if (!protobuf_in_path_.empty()) {
-+      in_fd = open(protobuf_in_path_.c_str(), O_RDONLY);
-+      if (in_fd == -1) {
-+        std::cerr << protobuf_in_path_ << ": error: failed to open file." << std::endl;
-+        return 1;
-+      }
-+    }
-+    if (!protobuf_out_path_.empty()) {
-+      out_fd = open(protobuf_out_path_.c_str(),
-+                    O_WRONLY | O_CREAT | O_TRUNC,
-+                    0644);
-+      if (out_fd == -1) {
-+        std::cerr << protobuf_out_path_ << ": error: failed to open file." << std::endl;
-+        close(in_fd);
-+        return 1;
-+      }
-+    }
-+
-     if (codec_type_.empty()) {
-       // HACK:  Define an EmptyMessage type to use for decoding.
-       DescriptorPool pool;
-@@ -1117,13 +1139,20 @@
-       file.add_message_type()->set_name("EmptyMessage");
-       GOOGLE_CHECK(pool.BuildFile(file) != NULL);
-       codec_type_ = "EmptyMessage";
--      if (!EncodeOrDecode(&pool)) {
--        return 1;
--      }
-+      success = EncodeOrDecode(&pool, in_fd, out_fd);
-     } else {
--      if (!EncodeOrDecode(descriptor_pool.get())) {
--        return 1;
--      }
-+      success = EncodeOrDecode(descriptor_pool.get(), in_fd, out_fd);
-+    }
-+
-+    if (in_fd != STDIN_FILENO) {
-+      close(in_fd);
-+    }
-+    if (out_fd != STDOUT_FILENO) {
-+      close(out_fd);
-+    }
-+
-+    if (!success) {
-+      return 1;
-     }
-   }
- 
-@@ -1161,6 +1190,11 @@
-   for (int i = 0; i < proto_path_.size(); i++) {
-     source_tree->MapPath(proto_path_[i].first, proto_path_[i].second);
-   }
-+  if (mode_ == MODE_COMPILE &&
-+      (!protobuf_in_path_.empty() || !protobuf_out_path_.empty())) {
-+    std::cerr << "--protobuf_in and --protobuf_out are only valid with "
-+         << "decode operations. Ignoring.";
-+  }
- 
-   // Map input files to virtual paths if possible.
-   if (!MakeInputsBeProtoPathRelative(source_tree, fallback_database)) {
-@@ -1904,6 +1938,12 @@
-   } else if (name == "--deterministic_output") {
-     deterministic_output_ = true;
- 
-+  } else if (name == "--protobuf_in") {
-+    protobuf_in_path_ = value;
-+
-+  } else if (name == "--protobuf_out") {
-+    protobuf_out_path_ = value;
-+
-   } else if (name == "--error_format") {
-     if (value == "gcc") {
-       error_format_ = ERROR_FORMAT_GCC;
-@@ -2040,12 +2080,15 @@
-          "  -h, --help                  Show this text and exit.\n"
-          "  --encode=MESSAGE_TYPE       Read a text-format message of the "
-          "given type\n"
--         "                              from standard input and write it in "
--         "binary\n"
--         "                              to standard output.  The message type "
--         "must\n"
-+         "                              and write it in binary.  The message "
-+         "type must\n"
-          "                              be defined in PROTO_FILES or their "
-          "imports.\n"
-+         "                              The input/output protobuf files are "
-+         "specified\n"
-+         "                              using the --protobuf_in and "
-+         "--protobuf_out\n"
-+         "                              command line flags.\n"
-          "  --deterministic_output      When using --encode, ensure map fields "
-          "are\n"
-          "                              deterministically ordered. Note that"
-@@ -2053,22 +2096,40 @@
-          "                              canonical, and changes across builds"
-          "or releases of protoc.\n"
-          "  --decode=MESSAGE_TYPE       Read a binary message of the given "
--         "type from\n"
--         "                              standard input and write it in text "
--         "format\n"
--         "                              to standard output.  The message type "
--         "must\n"
--         "                              be defined in PROTO_FILES or their "
--         "imports.\n"
-+         "type and\n"
-+         "                              write it in text format.  The message "
-+         "type\n"
-+         "                              must be defined in PROTO_FILES or "
-+         "their imports.\n"
-+         "                              The input/output protobuf files are "
-+         "specified\n"
-+         "                              using the --protobuf_in and "
-+         "--protobuf_out\n"
-+         "                              command line flags.\n"
-          "  --decode_raw                Read an arbitrary protocol message "
--         "from\n"
--         "                              standard input and write the raw "
--         "tag/value\n"
--         "                              pairs in text format to standard "
--         "output.  No\n"
-+         "and write\n"
-+         "                              the raw tag/value pairs in text format."
-+         "  No\n"
-          "                              PROTO_FILES should be given when using "
-          "this\n"
--         "                              flag.\n"
-+         "                              flag.  The input/output protobuf files "
-+         "are\n"
-+         "                              specified using the --protobuf_in and\n"
-+         "                              --protobuf_out command line flags.\n"
-+         "  --protobuf_in=FILE          Absolute path to the protobuf file "
-+         "from which\n"
-+         "                              input of encoding/decoding operation "
-+         "will be\n"
-+         "                              read.  If omitted, input will be read "
-+         "from\n"
-+         "                              standard input.\n"
-+         "  --protobuf_out=FILE         Absolute path to the protobuf file "
-+         "to which\n"
-+         "                              output of encoding/decoding operation "
-+         "will be\n"
-+         "                              written.  If omitted, output will be "
-+         "written to\n"
-+         "                              standard output.\n"
-          "  --descriptor_set_in=FILES   Specifies a delimited list of FILES\n"
-          "                              each containing a FileDescriptorSet "
-          "(a\n"
-@@ -2416,7 +2477,9 @@
-   return true;
- }
- 
--bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool) {
-+bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool,
-+                                          int in_fd,
-+                                          int out_fd) {
-   // Look up the type.
-   const Descriptor* type = pool->FindMessageTypeByName(codec_type_);
-   if (type == NULL) {
-@@ -2428,15 +2491,15 @@
-   std::unique_ptr<Message> message(dynamic_factory.GetPrototype(type)->New());
- 
-   if (mode_ == MODE_ENCODE) {
--    SetFdToTextMode(STDIN_FILENO);
--    SetFdToBinaryMode(STDOUT_FILENO);
-+    SetFdToTextMode(in_fd);
-+    SetFdToBinaryMode(out_fd);
-   } else {
--    SetFdToBinaryMode(STDIN_FILENO);
--    SetFdToTextMode(STDOUT_FILENO);
-+    SetFdToBinaryMode(in_fd);
-+    SetFdToTextMode(out_fd);
-   }
- 
--  io::FileInputStream in(STDIN_FILENO);
--  io::FileOutputStream out(STDOUT_FILENO);
-+  io::FileInputStream in(in_fd);
-+  io::FileOutputStream out(out_fd);
- 
-   if (mode_ == MODE_ENCODE) {
-     // Input is text.
---- /src/google/protobuf/compiler/command_line_interface.h
-+++ /src/google/protobuf/compiler/command_line_interface.h
-@@ -296,7 +296,9 @@
-       GeneratorContext* generator_context, std::string* error);
- 
-   // Implements --encode and --decode.
--  bool EncodeOrDecode(const DescriptorPool* pool);
-+  bool EncodeOrDecode(const DescriptorPool* pool,
-+                      int in_fd,
-+                      int out_fd);
- 
-   // Implements the --descriptor_set_out option.
-   bool WriteDescriptorSet(
-@@ -428,6 +430,13 @@
-   // parsed FileDescriptorSets to be used for loading protos.  Otherwise, empty.
-   std::vector<std::string> descriptor_set_in_names_;
- 
-+  // When using --encode / --decode / --decode_raw absolute path to the output
-+  // file. (Empty string indicates write to STDOUT).
-+  std::string protobuf_out_path_;
-+  // When using --encode / --decode / --decode_raw, absolute path to the input
-+  // file. (Empty string indicates read from STDIN).
-+  std::string protobuf_in_path_;
-+
-   // If --descriptor_set_out was given, this is the filename to which the
-   // FileDescriptorSet should be written.  Otherwise, empty.
-   std::string descriptor_set_out_name_;
---- /src/google/protobuf/compiler/command_line_interface_unittest.cc
-+++ /src/google/protobuf/compiler/command_line_interface_unittest.cc
-@@ -97,7 +97,7 @@
-   virtual void SetUp();
-   virtual void TearDown();
- 
--  // Runs the CommandLineInterface with the given command line.  The
-+  // Run the CommandLineInterface with the given command line.  The
-   // command is automatically split on spaces, and the string "$tmpdir"
-   // is replaced with TestTempDir().
-   void Run(const std::string& command);
-@@ -2638,6 +2638,17 @@
-               std::string::npos);
-   }
- 
-+  void ExpectBinaryFilesMatch(const string &expected_file,
-+                              const string &actual_file) {
-+    string expected_output, actual_output;
-+    ASSERT_TRUE(File::ReadFileToString(expected_file, &expected_output));
-+    ASSERT_TRUE(File::ReadFileToString(actual_file, &actual_output));
-+
-+    // Don't use EXPECT_EQ because we don't want to print raw binary data to
-+    // stdout on failure.
-+    EXPECT_TRUE(expected_output == actual_output);
-+  }
-+
-  private:
-   void WriteUnittestProtoDescriptorSet() {
-     unittest_proto_descriptor_set_filename_ =
-@@ -2761,6 +2772,19 @@
-       "Can only use --deterministic_output with --encode.\n");
- }
- 
-+TEST_P(EncodeDecodeTest, RedirectInputOutput) {
-+  string out_file = TestTempDir() + "/golden_message_out.pbf";
-+  EXPECT_TRUE(
-+      Run(TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto") +
-+          " --encode=protobuf_unittest.TestAllTypes" +
-+          " --protobuf_in=" + TestUtil::GetTestDataPath(
-+              "net/proto2/internal/"
-+              "testdata/text_format_unittest_data_oneof_implemented.txt") +
-+          " --protobuf_out=" + out_file));
-+  ExpectBinaryFilesMatch(out_file, TestUtil::GetTestDataPath(
-+      "net/proto2/internal/testdata/golden_message_oneof_implemented"));
-+}
-+
- INSTANTIATE_TEST_SUITE_P(FileDescriptorSetSource, EncodeDecodeTest,
-                          testing::Values(PROTO_PATH, DESCRIPTOR_SET_IN));
- }  // anonymous namespace

diff --git a/dev-libs/protobuf/protobuf-3.14.0.ebuild b/dev-libs/protobuf/protobuf-3.14.0.ebuild
deleted file mode 100644
index ef5249f79de..00000000000
--- a/dev-libs/protobuf/protobuf-3.14.0.ebuild
+++ /dev/null
@@ -1,131 +0,0 @@
-# Copyright 2008-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-inherit autotools elisp-common flag-o-matic multilib-minimal toolchain-funcs
-
-if [[ "${PV}" == "9999" ]]; then
-	inherit git-r3
-
-	EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf"
-	EGIT_SUBMODULES=()
-fi
-
-DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing structured data"
-HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
-if [[ "${PV}" == "9999" ]]; then
-	SRC_URI=""
-else
-	SRC_URI="https://github.com/protocolbuffers/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-fi
-
-LICENSE="BSD"
-SLOT="0/25"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
-IUSE="emacs examples static-libs test zlib"
-RESTRICT="!test? ( test )"
-
-BDEPEND="emacs? ( app-editors/emacs:* )"
-DEPEND="test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
-	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
-RDEPEND="emacs? ( app-editors/emacs:* )
-	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
-
-PATCHES=(
-	"${FILESDIR}/${PN}-3.13.0-disable_no-warning-test.patch"
-	"${FILESDIR}/${PN}-3.13.0-system_libraries.patch"
-	"${FILESDIR}/${PN}-3.14.0-protoc_input_output_files.patch"
-)
-
-DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
-
-src_prepare() {
-	default
-
-	# https://github.com/protocolbuffers/protobuf/issues/7413
-	sed -e "/^AC_PROG_CXX_FOR_BUILD$/d" -i configure.ac || die
-
-	# https://github.com/protocolbuffers/protobuf/issues/8082
-	sed -e "/^TEST_F(IoTest, LargeOutput) {$/,/^}$/d" -i src/google/protobuf/io/zero_copy_stream_unittest.cc || die
-
-	eautoreconf
-}
-
-src_configure() {
-	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
-
-	if tc-ld-is-gold; then
-		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
-		tc-ld-disable-gold
-	fi
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local options=(
-		$(use_enable static-libs static)
-		$(use_with zlib)
-	)
-
-	if tc-is-cross-compiler; then
-		# Build system uses protoc when building, so protoc copy runnable on host is needed.
-		mkdir -p "${WORKDIR}/build" || die
-		pushd "${WORKDIR}/build" > /dev/null || die
-		ECONF_SOURCE="${S}" econf_build "${options[@]}"
-		options+=(--with-protoc="$(pwd)/src/protoc")
-		popd > /dev/null || die
-	fi
-
-	ECONF_SOURCE="${S}" econf "${options[@]}"
-}
-
-src_compile() {
-	multilib-minimal_src_compile
-
-	if use emacs; then
-		elisp-compile editors/protobuf-mode.el
-	fi
-}
-
-multilib_src_compile() {
-	if tc-is-cross-compiler; then
-		emake -C "${WORKDIR}/build/src" protoc
-	fi
-
-	default
-}
-
-multilib_src_test() {
-	emake check
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name "*.la" -delete || die
-
-	insinto /usr/share/vim/vimfiles/syntax
-	doins editors/proto.vim
-	insinto /usr/share/vim/vimfiles/ftdetect
-	doins "${FILESDIR}/proto.vim"
-
-	if use emacs; then
-		elisp-install ${PN} editors/protobuf-mode.el*
-		elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
-	fi
-
-	if use examples; then
-		DOCS+=(examples)
-		docompress -x /usr/share/doc/${PF}/examples
-	fi
-
-	einstalldocs
-}
-
-pkg_postinst() {
-	use emacs && elisp-site-regen
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2021-06-06 17:04 Mike Gilbert
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Gilbert @ 2021-06-06 17:04 UTC (permalink / raw
  To: gentoo-commits

commit:     cda914d6219792457ad3039a816e064cb7171a25
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Jun  6 00:00:00 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Jun  6 17:04:42 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cda914d6

dev-libs/protobuf: Version bumps (3.17.*).

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 dev-libs/protobuf/Manifest                         |   3 +
 .../protobuf-3.17.0-disable_no-warning-test.patch  |  19 ++++
 .../files/protobuf-3.17.0-system_libraries.patch   | 121 +++++++++++++++++++++
 ...protobuf-9999.ebuild => protobuf-3.17.0.ebuild} |  30 ++++-
 ...protobuf-9999.ebuild => protobuf-3.17.1.ebuild} |  30 ++++-
 ...protobuf-9999.ebuild => protobuf-3.17.2.ebuild} |  30 ++++-
 dev-libs/protobuf/protobuf-9999.ebuild             |   6 +-
 7 files changed, 224 insertions(+), 15 deletions(-)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index a4051caa640..3b64d73a457 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -8,3 +8,6 @@ DIST protobuf-3.15.6.tar.gz 5284018 BLAKE2B 5895f618e233edd5744253821036857aa23f
 DIST protobuf-3.15.7.tar.gz 5284817 BLAKE2B 43821bb283a0c1f87930593046a5c55f6efae3f644337289fd438c0612a9b7ef9531b61e48940b74dc5d20253ee1b6a805b902284a442dec2efe8c79f82c5aad SHA512 2b18ccba1ff8a0623c52abed0e0674bc6cfa2cd10d49764031a47e68f654f54083f4a4f9e3a94d833a6808426904ee642f173641063e79cb41a61fc348d603ac
 DIST protobuf-3.15.8.tar.gz 5285277 BLAKE2B 798fc011ac03cdc2406acf5845c667d8482082044bdace06c2c1d02b5b1b69c1b1f30e29774180dc1801a1d21d62e2ce50325105859564a1e36d3fe478e64d8b SHA512 56fc6df2dae14eee0fb67dd4204fc1ec54a18d994a69c9e42c7888d0cd50d269d1c5e1445d74f0fa705850d4ac86a22d86781e09769a716e5c6f829b15b05592
 DIST protobuf-3.16.0.tar.gz 5299781 BLAKE2B 9ace02a6038c31b7393671fb2ccd6a4866a3f8b7d87d2bc8371f49d65b9180f10792ca2430a83449dfa7d785a1244dac23c20756414c9d1e7c7e871a8038b123 SHA512 0191e5a6a23d03f691e883e259f6d06a0ac8eef427455bc7d1cc70b6f0ed260e4ad8f360c836fd4bdc95ec0ca314c887cbf7acbcda60e03cdfe69e4cd275bff5
+DIST protobuf-3.17.0.tar.gz 5185780 BLAKE2B a168619df72cdf097c7ddfd50aca96a2101bf73e7c1c842c020e6ee08a853db8674a86ca999b7706da3dd21d4d3d2159241c93232efc693701962f3a54a382e9 SHA512 36ed2de641849ce01531ff1207f62a0748f811519c40622a119a17a1e709864382de81481fb58f374a025948971c48416e7e6de9c00512a78633c7a8a3aa3a36
+DIST protobuf-3.17.1.tar.gz 5192666 BLAKE2B 7f912db7e0835aaa42628fcf564a5666e2cbfa021bb35638a5eec53c3c457f1e747225dea54f732b7239a1520febca9bc20c824b1938f100796caa3ac2133bc1 SHA512 5a18aa3c1dab040dc6d22310a8503241081106acf7ca89079d7b416533d7c2cdd47719dc9023e6bc26969f0f1c796550260a04034a403c69752f6a3a7a651bb8
+DIST protobuf-3.17.2.tar.gz 5192779 BLAKE2B 97f9561848e70b8d26ebcc7fc4fa8da51c4b8267efbe1d2d386c2785308e7ba7edc05f1b3863c274dc8838866d58b58509606d72c51a22b956d1d528584c4c95 SHA512 b3e7ad50ed772668df70a3a20ad1af13a5e82f23b109e4fecd34e6a74947bed300963c9f084907fbfafe28fc18365cde7df1975e2ff9538d2f5a3d2b458bca98

diff --git a/dev-libs/protobuf/files/protobuf-3.17.0-disable_no-warning-test.patch b/dev-libs/protobuf/files/protobuf-3.17.0-disable_no-warning-test.patch
new file mode 100644
index 00000000000..eb1598c945f
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.17.0-disable_no-warning-test.patch
@@ -0,0 +1,19 @@
+Disable no-warning-test which is compiled with -Werror option and whose only purpose is checking if compilation results in any warnings.
+
+--- /src/Makefile.am
++++ /src/Makefile.am
+@@ -713,7 +713,7 @@
+ GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
+ check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
+                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
+-                 no-warning-test $(GZCHECKPROGRAMS)
++                 $(GZCHECKPROGRAMS)
+ protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+                       $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
+                       $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
+@@ -900,4 +900,4 @@
+ 
+ TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
+         google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS)     \
+-        protobuf-lite-arena-test no-warning-test
++        protobuf-lite-arena-test

diff --git a/dev-libs/protobuf/files/protobuf-3.17.0-system_libraries.patch b/dev-libs/protobuf/files/protobuf-3.17.0-system_libraries.patch
new file mode 100644
index 00000000000..3d5069dd147
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-3.17.0-system_libraries.patch
@@ -0,0 +1,121 @@
+--- /Makefile.am
++++ /Makefile.am
+@@ -11,28 +11,10 @@
+ # Always include third_party directories in distributions.
+ DIST_SUBDIRS = src conformance benchmarks third_party/googletest
+ 
+-# Build gmock before we build protobuf tests.  We don't add gmock to SUBDIRS
+-# because then "make check" would also build and run all of gmock's own tests,
+-# which takes a lot of time and is generally not useful to us.  Also, we don't
+-# want "make install" to recurse into gmock since we don't want to overwrite
+-# the installed version of gmock if there is one.
+ check-local:
+-	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
+-	@cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
+-	@cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
+ 
+-# We would like to clean gmock when "make clean" is invoked.  But we have to
+-# be careful because clean-local is also invoked during "make distclean", but
+-# "make distclean" already recurses into gmock because it's listed among the
+-# DIST_SUBDIRS.  distclean will delete gmock/Makefile, so if we then try to
+-# cd to the directory again and "make clean" it will fail.  So, check that the
+-# Makefile exists before recursing.
+ clean-local:
+-	@if test -e third_party/googletest/Makefile; then \
+-	  echo "Making clean in googletest"; \
+-	  cd third_party/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; \
+-	fi; \
+-	if test -e conformance/Makefile; then \
++	@if test -e conformance/Makefile; then \
+ 	  echo "Making clean in conformance"; \
+ 	  cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \
+ 	fi; \
+--- /configure.ac
++++ /configure.ac
+@@ -236,12 +236,5 @@
+ fi
+ AC_SUBST([LIBLOG_LIBS])
+ 
+-# HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
+-#   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
+-#   too.
+-export CFLAGS
+-export CXXFLAGS
+-AC_CONFIG_SUBDIRS([third_party/googletest])
+-
+ AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
+ AC_OUTPUT
+--- /src/Makefile.am
++++ /src/Makefile.am
+@@ -707,19 +707,11 @@
+   google/protobuf/testing/file.cc                              \
+   google/protobuf/testing/file.h
+ 
+-GOOGLETEST_BUILD_DIR=../third_party/googletest/googletest
+-GOOGLEMOCK_BUILD_DIR=../third_party/googletest/googlemock
+-GOOGLETEST_SRC_DIR=$(srcdir)/../third_party/googletest/googletest
+-GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
+ check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
+                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
+                  $(GZCHECKPROGRAMS)
+ protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \
+-                         -I$(GOOGLEMOCK_SRC_DIR)/include
++                      -lgtest -lgmock -lgmock_main
+ # Disable optimization for tests unless the user explicitly asked for it,
+ # since test_util.cc takes forever to compile with optimization (with GCC).
+ # See configure.ac for more info.
+@@ -811,12 +803,8 @@
+ # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
+ protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
+                       libprotoc.la                                   \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
+-                                         -I$(GOOGLETEST_SRC_DIR)/include \
+-                                         -DPROTOBUF_TEST_NO_DESCRIPTORS
++                      -lgtest -lgmock -lgmock_main
++protobuf_lazy_descriptor_test_CPPFLAGS = -DPROTOBUF_TEST_NO_DESCRIPTORS
+ protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lazy_descriptor_test_SOURCES =                        \
+   google/protobuf/compiler/cpp/cpp_unittest.cc                 \
+@@ -837,11 +825,7 @@
+ # full runtime and we want to make sure this test builds without full
+ # runtime.
+ protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la     \
+-                           $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
+-                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
+-                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \
+-                             -I$(GOOGLETEST_SRC_DIR)/include
++                           -lgtest -lgmock -lgmock_main
+ protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lite_test_SOURCES =                                           \
+   google/protobuf/lite_unittest.cc                                     \
+@@ -853,11 +837,7 @@
+ # gtest when building the test internally our memory sanitizer doesn't detect
+ # memory leaks (don't know why).
+ protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
+-                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
+-                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
+-protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include  \
+-                                    -I$(GOOGLETEST_SRC_DIR)/include
++                      -lgtest -lgmock -lgmock_main
+ protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
+ protobuf_lite_arena_test_SOURCES =       \
+   google/protobuf/lite_arena_unittest.cc \
+@@ -867,8 +847,7 @@
+ 
+ # Test plugin binary.
+ test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
+-                    $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la
+-test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include
++                    -lgtest
+ test_plugin_SOURCES =                                          \
+   google/protobuf/compiler/mock_code_generator.cc              \
+   google/protobuf/testing/file.cc                              \

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-3.17.0.ebuild
similarity index 66%
copy from dev-libs/protobuf/protobuf-9999.ebuild
copy to dev-libs/protobuf/protobuf-3.17.0.ebuild
index 48b75b4e2cb..6391fd499f3 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-3.17.0.ebuild
@@ -22,7 +22,7 @@ fi
 
 LICENSE="BSD"
 SLOT="0/28"
-KEYWORDS=""
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
 IUSE="emacs examples static-libs test zlib"
 RESTRICT="!test? ( test )"
 
@@ -33,20 +33,42 @@ RDEPEND="emacs? ( app-editors/emacs:* )
 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
 
 PATCHES=(
-	"${FILESDIR}/${PN}-3.15.0-disable_no-warning-test.patch"
-	"${FILESDIR}/${PN}-3.15.0-system_libraries.patch"
-	"${FILESDIR}/${PN}-3.15.0-protoc_input_output_files.patch"
+	"${FILESDIR}/${PN}-3.17.0-disable_no-warning-test.patch"
+	"${FILESDIR}/${PN}-3.17.0-system_libraries.patch"
+	"${FILESDIR}/${PN}-3.16.0-protoc_input_output_files.patch"
 )
 
 DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
 
 src_prepare() {
 	default
+
+	# https://github.com/protocolbuffers/protobuf/issues/7413
+	sed -e "/^AC_PROG_CXX_FOR_BUILD$/d" -i configure.ac || die
+
+	# https://github.com/protocolbuffers/protobuf/issues/8082
+	sed -e "/^TEST_F(IoTest, LargeOutput) {$/,/^}$/d" -i src/google/protobuf/io/zero_copy_stream_unittest.cc || die
+
+	# https://github.com/protocolbuffers/protobuf/issues/8459
+	sed \
+		-e "/^TEST(ArenaTest, BlockSizeSmallerThanAllocation) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" \
+		-e "/^TEST(ArenaTest, SpaceAllocated_and_Used) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" \
+		-i src/google/protobuf/arena_unittest.cc || die
+
+	# https://github.com/protocolbuffers/protobuf/issues/8460
+	sed -e "/^TEST(AnyTest, TestPackFromSerializationExceedsSizeLimit) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" -i src/google/protobuf/any_test.cc || die
+
 	eautoreconf
 }
 
 src_configure() {
 	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
+
+	if tc-ld-is-gold; then
+		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+		tc-ld-disable-gold
+	fi
+
 	multilib-minimal_src_configure
 }
 

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-3.17.1.ebuild
similarity index 66%
copy from dev-libs/protobuf/protobuf-9999.ebuild
copy to dev-libs/protobuf/protobuf-3.17.1.ebuild
index 48b75b4e2cb..6391fd499f3 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-3.17.1.ebuild
@@ -22,7 +22,7 @@ fi
 
 LICENSE="BSD"
 SLOT="0/28"
-KEYWORDS=""
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
 IUSE="emacs examples static-libs test zlib"
 RESTRICT="!test? ( test )"
 
@@ -33,20 +33,42 @@ RDEPEND="emacs? ( app-editors/emacs:* )
 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
 
 PATCHES=(
-	"${FILESDIR}/${PN}-3.15.0-disable_no-warning-test.patch"
-	"${FILESDIR}/${PN}-3.15.0-system_libraries.patch"
-	"${FILESDIR}/${PN}-3.15.0-protoc_input_output_files.patch"
+	"${FILESDIR}/${PN}-3.17.0-disable_no-warning-test.patch"
+	"${FILESDIR}/${PN}-3.17.0-system_libraries.patch"
+	"${FILESDIR}/${PN}-3.16.0-protoc_input_output_files.patch"
 )
 
 DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
 
 src_prepare() {
 	default
+
+	# https://github.com/protocolbuffers/protobuf/issues/7413
+	sed -e "/^AC_PROG_CXX_FOR_BUILD$/d" -i configure.ac || die
+
+	# https://github.com/protocolbuffers/protobuf/issues/8082
+	sed -e "/^TEST_F(IoTest, LargeOutput) {$/,/^}$/d" -i src/google/protobuf/io/zero_copy_stream_unittest.cc || die
+
+	# https://github.com/protocolbuffers/protobuf/issues/8459
+	sed \
+		-e "/^TEST(ArenaTest, BlockSizeSmallerThanAllocation) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" \
+		-e "/^TEST(ArenaTest, SpaceAllocated_and_Used) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" \
+		-i src/google/protobuf/arena_unittest.cc || die
+
+	# https://github.com/protocolbuffers/protobuf/issues/8460
+	sed -e "/^TEST(AnyTest, TestPackFromSerializationExceedsSizeLimit) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" -i src/google/protobuf/any_test.cc || die
+
 	eautoreconf
 }
 
 src_configure() {
 	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
+
+	if tc-ld-is-gold; then
+		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+		tc-ld-disable-gold
+	fi
+
 	multilib-minimal_src_configure
 }
 

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-3.17.2.ebuild
similarity index 66%
copy from dev-libs/protobuf/protobuf-9999.ebuild
copy to dev-libs/protobuf/protobuf-3.17.2.ebuild
index 48b75b4e2cb..6391fd499f3 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-3.17.2.ebuild
@@ -22,7 +22,7 @@ fi
 
 LICENSE="BSD"
 SLOT="0/28"
-KEYWORDS=""
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
 IUSE="emacs examples static-libs test zlib"
 RESTRICT="!test? ( test )"
 
@@ -33,20 +33,42 @@ RDEPEND="emacs? ( app-editors/emacs:* )
 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
 
 PATCHES=(
-	"${FILESDIR}/${PN}-3.15.0-disable_no-warning-test.patch"
-	"${FILESDIR}/${PN}-3.15.0-system_libraries.patch"
-	"${FILESDIR}/${PN}-3.15.0-protoc_input_output_files.patch"
+	"${FILESDIR}/${PN}-3.17.0-disable_no-warning-test.patch"
+	"${FILESDIR}/${PN}-3.17.0-system_libraries.patch"
+	"${FILESDIR}/${PN}-3.16.0-protoc_input_output_files.patch"
 )
 
 DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
 
 src_prepare() {
 	default
+
+	# https://github.com/protocolbuffers/protobuf/issues/7413
+	sed -e "/^AC_PROG_CXX_FOR_BUILD$/d" -i configure.ac || die
+
+	# https://github.com/protocolbuffers/protobuf/issues/8082
+	sed -e "/^TEST_F(IoTest, LargeOutput) {$/,/^}$/d" -i src/google/protobuf/io/zero_copy_stream_unittest.cc || die
+
+	# https://github.com/protocolbuffers/protobuf/issues/8459
+	sed \
+		-e "/^TEST(ArenaTest, BlockSizeSmallerThanAllocation) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" \
+		-e "/^TEST(ArenaTest, SpaceAllocated_and_Used) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" \
+		-i src/google/protobuf/arena_unittest.cc || die
+
+	# https://github.com/protocolbuffers/protobuf/issues/8460
+	sed -e "/^TEST(AnyTest, TestPackFromSerializationExceedsSizeLimit) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" -i src/google/protobuf/any_test.cc || die
+
 	eautoreconf
 }
 
 src_configure() {
 	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
+
+	if tc-ld-is-gold; then
+		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+		tc-ld-disable-gold
+	fi
+
 	multilib-minimal_src_configure
 }
 

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-9999.ebuild
index 48b75b4e2cb..6a5eecd502c 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-9999.ebuild
@@ -33,9 +33,9 @@ RDEPEND="emacs? ( app-editors/emacs:* )
 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
 
 PATCHES=(
-	"${FILESDIR}/${PN}-3.15.0-disable_no-warning-test.patch"
-	"${FILESDIR}/${PN}-3.15.0-system_libraries.patch"
-	"${FILESDIR}/${PN}-3.15.0-protoc_input_output_files.patch"
+	"${FILESDIR}/${PN}-3.17.0-disable_no-warning-test.patch"
+	"${FILESDIR}/${PN}-3.17.0-system_libraries.patch"
+	"${FILESDIR}/${PN}-3.16.0-protoc_input_output_files.patch"
 )
 
 DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2021-11-18 22:22 Mike Gilbert
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Gilbert @ 2021-11-18 22:22 UTC (permalink / raw
  To: gentoo-commits

commit:     a3b762d0a79a116e0a956d402b4f15269e282ec7
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Nov 18 05:00:00 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Nov 18 22:22:08 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a3b762d0

dev-libs/protobuf: Delete old version (3.15.8).

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 dev-libs/protobuf/Manifest                         |   1 -
 ...protobuf-3.15.0-protoc_input_output_files.patch | 240 ---------------------
 .../files/protobuf-3.15.0-system_libraries.patch   | 121 -----------
 dev-libs/protobuf/protobuf-3.15.8.ebuild           | 140 ------------
 4 files changed, 502 deletions(-)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index e4219af26c33..e5d6443b5d31 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -1,4 +1,3 @@
-DIST protobuf-3.15.8.tar.gz 5285277 BLAKE2B 798fc011ac03cdc2406acf5845c667d8482082044bdace06c2c1d02b5b1b69c1b1f30e29774180dc1801a1d21d62e2ce50325105859564a1e36d3fe478e64d8b SHA512 56fc6df2dae14eee0fb67dd4204fc1ec54a18d994a69c9e42c7888d0cd50d269d1c5e1445d74f0fa705850d4ac86a22d86781e09769a716e5c6f829b15b05592
 DIST protobuf-3.16.0.tar.gz 5299781 BLAKE2B 9ace02a6038c31b7393671fb2ccd6a4866a3f8b7d87d2bc8371f49d65b9180f10792ca2430a83449dfa7d785a1244dac23c20756414c9d1e7c7e871a8038b123 SHA512 0191e5a6a23d03f691e883e259f6d06a0ac8eef427455bc7d1cc70b6f0ed260e4ad8f360c836fd4bdc95ec0ca314c887cbf7acbcda60e03cdfe69e4cd275bff5
 DIST protobuf-3.17.0.tar.gz 5185780 BLAKE2B a168619df72cdf097c7ddfd50aca96a2101bf73e7c1c842c020e6ee08a853db8674a86ca999b7706da3dd21d4d3d2159241c93232efc693701962f3a54a382e9 SHA512 36ed2de641849ce01531ff1207f62a0748f811519c40622a119a17a1e709864382de81481fb58f374a025948971c48416e7e6de9c00512a78633c7a8a3aa3a36
 DIST protobuf-3.17.1.tar.gz 5192666 BLAKE2B 7f912db7e0835aaa42628fcf564a5666e2cbfa021bb35638a5eec53c3c457f1e747225dea54f732b7239a1520febca9bc20c824b1938f100796caa3ac2133bc1 SHA512 5a18aa3c1dab040dc6d22310a8503241081106acf7ca89079d7b416533d7c2cdd47719dc9023e6bc26969f0f1c796550260a04034a403c69752f6a3a7a651bb8

diff --git a/dev-libs/protobuf/files/protobuf-3.15.0-protoc_input_output_files.patch b/dev-libs/protobuf/files/protobuf-3.15.0-protoc_input_output_files.patch
deleted file mode 100644
index 8e9733fc4644..000000000000
--- a/dev-libs/protobuf/files/protobuf-3.15.0-protoc_input_output_files.patch
+++ /dev/null
@@ -1,240 +0,0 @@
-https://github.com/protocolbuffers/protobuf/pull/235
-
---- /src/google/protobuf/compiler/command_line_interface.cc
-+++ /src/google/protobuf/compiler/command_line_interface.cc
-@@ -1109,6 +1109,28 @@
-   }
- 
-   if (mode_ == MODE_ENCODE || mode_ == MODE_DECODE) {
-+    bool success = false;
-+    int in_fd = STDIN_FILENO;
-+    int out_fd = STDOUT_FILENO;
-+
-+    if (!protobuf_in_path_.empty()) {
-+      in_fd = open(protobuf_in_path_.c_str(), O_RDONLY);
-+      if (in_fd == -1) {
-+        std::cerr << protobuf_in_path_ << ": error: failed to open file." << std::endl;
-+        return 1;
-+      }
-+    }
-+    if (!protobuf_out_path_.empty()) {
-+      out_fd = open(protobuf_out_path_.c_str(),
-+                    O_WRONLY | O_CREAT | O_TRUNC,
-+                    0644);
-+      if (out_fd == -1) {
-+        std::cerr << protobuf_out_path_ << ": error: failed to open file." << std::endl;
-+        close(in_fd);
-+        return 1;
-+      }
-+    }
-+
-     if (codec_type_.empty()) {
-       // HACK:  Define an EmptyMessage type to use for decoding.
-       DescriptorPool pool;
-@@ -1117,13 +1139,20 @@
-       file.add_message_type()->set_name("EmptyMessage");
-       GOOGLE_CHECK(pool.BuildFile(file) != NULL);
-       codec_type_ = "EmptyMessage";
--      if (!EncodeOrDecode(&pool)) {
--        return 1;
--      }
-+      success = EncodeOrDecode(&pool, in_fd, out_fd);
-     } else {
--      if (!EncodeOrDecode(descriptor_pool.get())) {
--        return 1;
--      }
-+      success = EncodeOrDecode(descriptor_pool.get(), in_fd, out_fd);
-+    }
-+
-+    if (in_fd != STDIN_FILENO) {
-+      close(in_fd);
-+    }
-+    if (out_fd != STDOUT_FILENO) {
-+      close(out_fd);
-+    }
-+
-+    if (!success) {
-+      return 1;
-     }
-   }
- 
-@@ -1161,6 +1190,11 @@
-   for (int i = 0; i < proto_path_.size(); i++) {
-     source_tree->MapPath(proto_path_[i].first, proto_path_[i].second);
-   }
-+  if (mode_ == MODE_COMPILE &&
-+      (!protobuf_in_path_.empty() || !protobuf_out_path_.empty())) {
-+    std::cerr << "--protobuf_in and --protobuf_out are only valid with "
-+         << "decode operations. Ignoring.";
-+  }
- 
-   // Map input files to virtual paths if possible.
-   if (!MakeInputsBeProtoPathRelative(source_tree, fallback_database)) {
-@@ -1892,6 +1926,12 @@
-   } else if (name == "--deterministic_output") {
-     deterministic_output_ = true;
- 
-+  } else if (name == "--protobuf_in") {
-+    protobuf_in_path_ = value;
-+
-+  } else if (name == "--protobuf_out") {
-+    protobuf_out_path_ = value;
-+
-   } else if (name == "--error_format") {
-     if (value == "gcc") {
-       error_format_ = ERROR_FORMAT_GCC;
-@@ -2019,22 +2059,38 @@
-   --version                   Show version info and exit.
-   -h, --help                  Show this text and exit.
-   --encode=MESSAGE_TYPE       Read a text-format message of the given type
--                              from standard input and write it in binary
--                              to standard output.  The message type must
-+                              from input protobuf file and write it in binary
-+                              to output protobuf file.  The message type must
-                               be defined in PROTO_FILES or their imports.
-+                              The input/output protobuf files are specified
-+                              using the --protobuf_in and --protobuf_out
-+                              command line flags.
-   --deterministic_output      When using --encode, ensure map fields are
-                               deterministically ordered. Note that this order
-                               is not canonical, and changes across builds or
-                               releases of protoc.
-   --decode=MESSAGE_TYPE       Read a binary message of the given type from
--                              standard input and write it in text format
--                              to standard output.  The message type must
-+                              input protobuf file and write it in text format
-+                              to output protobuf file.  The message type must
-                               be defined in PROTO_FILES or their imports.
-+                              The input/output protobuf files are specified
-+                              using the --protobuf_in and --protobuf_out
-+                              command line flags.
-   --decode_raw                Read an arbitrary protocol message from
--                              standard input and write the raw tag/value
--                              pairs in text format to standard output.  No
-+                              input protobuf file and write the raw tag/value
-+                              pairs in text format to output protobuf file.  No
-                               PROTO_FILES should be given when using this
--                              flag.
-+                              flag.  The input/output protobuf files are
-+                              specified using the --protobuf_in and
-+                              --protobuf_out command line flags.
-+  --protobuf_in=FILE          Absolute path to the protobuf file from which
-+                              input of encoding/decoding operation will be
-+                              read.  If omitted, input will be read from
-+                              standard input.
-+  --protobuf_out=FILE         Absolute path to the protobuf file to which
-+                              output of encoding/decoding operation will be
-+                              written.  If omitted, output will be written to
-+                              standard output.
-   --descriptor_set_in=FILES   Specifies a delimited list of FILES
-                               each containing a FileDescriptorSet (a
-                               protocol buffer defined in descriptor.proto).
-@@ -2341,7 +2397,9 @@
-   return true;
- }
- 
--bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool) {
-+bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool,
-+                                          int in_fd,
-+                                          int out_fd) {
-   // Look up the type.
-   const Descriptor* type = pool->FindMessageTypeByName(codec_type_);
-   if (type == NULL) {
-@@ -2353,15 +2411,15 @@
-   std::unique_ptr<Message> message(dynamic_factory.GetPrototype(type)->New());
- 
-   if (mode_ == MODE_ENCODE) {
--    SetFdToTextMode(STDIN_FILENO);
--    SetFdToBinaryMode(STDOUT_FILENO);
-+    SetFdToTextMode(in_fd);
-+    SetFdToBinaryMode(out_fd);
-   } else {
--    SetFdToBinaryMode(STDIN_FILENO);
--    SetFdToTextMode(STDOUT_FILENO);
-+    SetFdToBinaryMode(in_fd);
-+    SetFdToTextMode(out_fd);
-   }
- 
--  io::FileInputStream in(STDIN_FILENO);
--  io::FileOutputStream out(STDOUT_FILENO);
-+  io::FileInputStream in(in_fd);
-+  io::FileOutputStream out(out_fd);
- 
-   if (mode_ == MODE_ENCODE) {
-     // Input is text.
---- /src/google/protobuf/compiler/command_line_interface.h
-+++ /src/google/protobuf/compiler/command_line_interface.h
-@@ -296,7 +296,9 @@
-       GeneratorContext* generator_context, std::string* error);
- 
-   // Implements --encode and --decode.
--  bool EncodeOrDecode(const DescriptorPool* pool);
-+  bool EncodeOrDecode(const DescriptorPool* pool,
-+                      int in_fd,
-+                      int out_fd);
- 
-   // Implements the --descriptor_set_out option.
-   bool WriteDescriptorSet(
-@@ -428,6 +430,13 @@
-   // parsed FileDescriptorSets to be used for loading protos.  Otherwise, empty.
-   std::vector<std::string> descriptor_set_in_names_;
- 
-+  // When using --encode / --decode / --decode_raw absolute path to the output
-+  // file. (Empty string indicates write to STDOUT).
-+  std::string protobuf_out_path_;
-+  // When using --encode / --decode / --decode_raw, absolute path to the input
-+  // file. (Empty string indicates read from STDIN).
-+  std::string protobuf_in_path_;
-+
-   // If --descriptor_set_out was given, this is the filename to which the
-   // FileDescriptorSet should be written.  Otherwise, empty.
-   std::string descriptor_set_out_name_;
---- /src/google/protobuf/compiler/command_line_interface_unittest.cc
-+++ /src/google/protobuf/compiler/command_line_interface_unittest.cc
-@@ -97,7 +97,7 @@
-   virtual void SetUp();
-   virtual void TearDown();
- 
--  // Runs the CommandLineInterface with the given command line.  The
-+  // Run the CommandLineInterface with the given command line.  The
-   // command is automatically split on spaces, and the string "$tmpdir"
-   // is replaced with TestTempDir().
-   void Run(const std::string& command);
-@@ -2596,6 +2596,17 @@
-               std::string::npos);
-   }
- 
-+  void ExpectBinaryFilesMatch(const string &expected_file,
-+                              const string &actual_file) {
-+    string expected_output, actual_output;
-+    ASSERT_TRUE(File::ReadFileToString(expected_file, &expected_output));
-+    ASSERT_TRUE(File::ReadFileToString(actual_file, &actual_output));
-+
-+    // Don't use EXPECT_EQ because we don't want to print raw binary data to
-+    // stdout on failure.
-+    EXPECT_TRUE(expected_output == actual_output);
-+  }
-+
-  private:
-   void WriteUnittestProtoDescriptorSet() {
-     unittest_proto_descriptor_set_filename_ =
-@@ -2719,6 +2730,19 @@
-       "Can only use --deterministic_output with --encode.\n");
- }
- 
-+TEST_P(EncodeDecodeTest, RedirectInputOutput) {
-+  string out_file = TestTempDir() + "/golden_message_out.pbf";
-+  EXPECT_TRUE(
-+      Run(TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto") +
-+          " --encode=protobuf_unittest.TestAllTypes" +
-+          " --protobuf_in=" + TestUtil::GetTestDataPath(
-+              "net/proto2/internal/"
-+              "testdata/text_format_unittest_data_oneof_implemented.txt") +
-+          " --protobuf_out=" + out_file));
-+  ExpectBinaryFilesMatch(out_file, TestUtil::GetTestDataPath(
-+      "net/proto2/internal/testdata/golden_message_oneof_implemented"));
-+}
-+
- INSTANTIATE_TEST_SUITE_P(FileDescriptorSetSource, EncodeDecodeTest,
-                          testing::Values(PROTO_PATH, DESCRIPTOR_SET_IN));
- }  // anonymous namespace

diff --git a/dev-libs/protobuf/files/protobuf-3.15.0-system_libraries.patch b/dev-libs/protobuf/files/protobuf-3.15.0-system_libraries.patch
deleted file mode 100644
index 9a75a6665f0c..000000000000
--- a/dev-libs/protobuf/files/protobuf-3.15.0-system_libraries.patch
+++ /dev/null
@@ -1,121 +0,0 @@
---- /Makefile.am
-+++ /Makefile.am
-@@ -11,28 +11,10 @@
- # Always include third_party directories in distributions.
- DIST_SUBDIRS = src conformance benchmarks third_party/googletest
- 
--# Build gmock before we build protobuf tests.  We don't add gmock to SUBDIRS
--# because then "make check" would also build and run all of gmock's own tests,
--# which takes a lot of time and is generally not useful to us.  Also, we don't
--# want "make install" to recurse into gmock since we don't want to overwrite
--# the installed version of gmock if there is one.
- check-local:
--	@echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
--	@cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
--	@cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
- 
--# We would like to clean gmock when "make clean" is invoked.  But we have to
--# be careful because clean-local is also invoked during "make distclean", but
--# "make distclean" already recurses into gmock because it's listed among the
--# DIST_SUBDIRS.  distclean will delete gmock/Makefile, so if we then try to
--# cd to the directory again and "make clean" it will fail.  So, check that the
--# Makefile exists before recursing.
- clean-local:
--	@if test -e third_party/googletest/Makefile; then \
--	  echo "Making clean in googletest"; \
--	  cd third_party/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; \
--	fi; \
--	if test -e conformance/Makefile; then \
-+	@if test -e conformance/Makefile; then \
- 	  echo "Making clean in conformance"; \
- 	  cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \
- 	fi; \
---- /configure.ac
-+++ /configure.ac
-@@ -223,12 +223,5 @@
- esac
- AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1])
- 
--# HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
--#   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
--#   too.
--export CFLAGS
--export CXXFLAGS
--AC_CONFIG_SUBDIRS([third_party/googletest])
--
- AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc])
- AC_OUTPUT
---- /src/Makefile.am
-+++ /src/Makefile.am
-@@ -703,19 +703,11 @@
-   google/protobuf/testing/file.cc                              \
-   google/protobuf/testing/file.h
- 
--GOOGLETEST_BUILD_DIR=../third_party/googletest/googletest
--GOOGLEMOCK_BUILD_DIR=../third_party/googletest/googlemock
--GOOGLETEST_SRC_DIR=$(srcdir)/../third_party/googletest/googletest
--GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
- check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
-                  protobuf-lite-test test_plugin protobuf-lite-arena-test \
-                  $(GZCHECKPROGRAMS)
- protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
--                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
--protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \
--                         -I$(GOOGLEMOCK_SRC_DIR)/include
-+                      -lgtest -lgmock -lgmock_main
- # Disable optimization for tests unless the user explicitly asked for it,
- # since test_util.cc takes forever to compile with optimization (with GCC).
- # See configure.ac for more info.
-@@ -807,12 +799,8 @@
- # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
- protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
-                       libprotoc.la                                   \
--                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
--protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
--                                         -I$(GOOGLETEST_SRC_DIR)/include \
--                                         -DPROTOBUF_TEST_NO_DESCRIPTORS
-+                      -lgtest -lgmock -lgmock_main
-+protobuf_lazy_descriptor_test_CPPFLAGS = -DPROTOBUF_TEST_NO_DESCRIPTORS
- protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lazy_descriptor_test_SOURCES =                        \
-   google/protobuf/compiler/cpp/cpp_unittest.cc                 \
-@@ -833,11 +821,7 @@
- # full runtime and we want to make sure this test builds without full
- # runtime.
- protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la     \
--                           $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
--                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
--                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
--protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \
--                             -I$(GOOGLETEST_SRC_DIR)/include
-+                           -lgtest -lgmock -lgmock_main
- protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lite_test_SOURCES =                                           \
-   google/protobuf/lite_unittest.cc                                     \
-@@ -849,11 +833,7 @@
- # gtest when building the test internally our memory sanitizer doesn't detect
- # memory leaks (don't know why).
- protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
--                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
--                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
--protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include  \
--                                    -I$(GOOGLETEST_SRC_DIR)/include
-+                      -lgtest -lgmock -lgmock_main
- protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
- protobuf_lite_arena_test_SOURCES =       \
-   google/protobuf/lite_arena_unittest.cc \
-@@ -863,8 +843,7 @@
- 
- # Test plugin binary.
- test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
--                    $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la
--test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include
-+                    -lgtest
- test_plugin_SOURCES =                                          \
-   google/protobuf/compiler/mock_code_generator.cc              \
-   google/protobuf/testing/file.cc                              \

diff --git a/dev-libs/protobuf/protobuf-3.15.8.ebuild b/dev-libs/protobuf/protobuf-3.15.8.ebuild
deleted file mode 100644
index 751620427fff..000000000000
--- a/dev-libs/protobuf/protobuf-3.15.8.ebuild
+++ /dev/null
@@ -1,140 +0,0 @@
-# Copyright 2008-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-inherit autotools elisp-common flag-o-matic multilib-minimal toolchain-funcs
-
-if [[ "${PV}" == "9999" ]]; then
-	inherit git-r3
-
-	EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf"
-	EGIT_SUBMODULES=()
-fi
-
-DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing structured data"
-HOMEPAGE="https://developers.google.com/protocol-buffers/ https://github.com/protocolbuffers/protobuf"
-if [[ "${PV}" == "9999" ]]; then
-	SRC_URI=""
-else
-	SRC_URI="https://github.com/protocolbuffers/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-fi
-
-LICENSE="BSD"
-SLOT="0/26"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
-IUSE="emacs examples static-libs test zlib"
-RESTRICT="!test? ( test )"
-
-BDEPEND="emacs? ( app-editors/emacs:* )"
-DEPEND="test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
-	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
-RDEPEND="emacs? ( app-editors/emacs:* )
-	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
-
-PATCHES=(
-	"${FILESDIR}/${PN}-3.15.0-disable_no-warning-test.patch"
-	"${FILESDIR}/${PN}-3.15.0-system_libraries.patch"
-	"${FILESDIR}/${PN}-3.15.0-protoc_input_output_files.patch"
-)
-
-DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
-
-src_prepare() {
-	default
-
-	# https://github.com/protocolbuffers/protobuf/issues/7413
-	sed -e "/^AC_PROG_CXX_FOR_BUILD$/d" -i configure.ac || die
-
-	# https://github.com/protocolbuffers/protobuf/issues/8082
-	sed -e "/^TEST_F(IoTest, LargeOutput) {$/,/^}$/d" -i src/google/protobuf/io/zero_copy_stream_unittest.cc || die
-
-	# https://github.com/protocolbuffers/protobuf/issues/8459
-	sed \
-		-e "/^TEST(ArenaTest, BlockSizeSmallerThanAllocation) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" \
-		-e "/^TEST(ArenaTest, SpaceAllocated_and_Used) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" \
-		-i src/google/protobuf/arena_unittest.cc || die
-
-	# https://github.com/protocolbuffers/protobuf/issues/8460
-	sed -e "/^TEST(AnyTest, TestPackFromSerializationExceedsSizeLimit) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" -i src/google/protobuf/any_test.cc || die
-
-	eautoreconf
-}
-
-src_configure() {
-	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
-
-	if tc-ld-is-gold; then
-		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
-		tc-ld-disable-gold
-	fi
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local options=(
-		$(use_enable static-libs static)
-		$(use_with zlib)
-	)
-
-	if tc-is-cross-compiler; then
-		# Build system uses protoc when building, so protoc copy runnable on host is needed.
-		mkdir -p "${WORKDIR}/build" || die
-		pushd "${WORKDIR}/build" > /dev/null || die
-		ECONF_SOURCE="${S}" econf_build "${options[@]}"
-		options+=(--with-protoc="$(pwd)/src/protoc")
-		popd > /dev/null || die
-	fi
-
-	ECONF_SOURCE="${S}" econf "${options[@]}"
-}
-
-src_compile() {
-	multilib-minimal_src_compile
-
-	if use emacs; then
-		elisp-compile editors/protobuf-mode.el
-	fi
-}
-
-multilib_src_compile() {
-	if tc-is-cross-compiler; then
-		emake -C "${WORKDIR}/build/src" protoc
-	fi
-
-	default
-}
-
-multilib_src_test() {
-	emake check
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name "*.la" -delete || die
-
-	insinto /usr/share/vim/vimfiles/syntax
-	doins editors/proto.vim
-	insinto /usr/share/vim/vimfiles/ftdetect
-	doins "${FILESDIR}/proto.vim"
-
-	if use emacs; then
-		elisp-install ${PN} editors/protobuf-mode.el*
-		elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
-	fi
-
-	if use examples; then
-		DOCS+=(examples)
-		docompress -x /usr/share/doc/${PF}/examples
-	fi
-
-	einstalldocs
-}
-
-pkg_postinst() {
-	use emacs && elisp-site-regen
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2023-06-27 20:14 Andreas Sturmlechner
  0 siblings, 0 replies; 17+ messages in thread
From: Andreas Sturmlechner @ 2023-06-27 20:14 UTC (permalink / raw
  To: gentoo-commits

commit:     2bf32183a2b79e19eb860b8e39dd2e8ac226113e
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 27 20:00:38 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Jun 27 20:14:36 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2bf32183

dev-libs/protobuf: drop unmaintained 9999

Multiple patches are broken, not synced with last release version bump,
autotools build system is dead.

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...protobuf-3.20.1-protoc_input_output_files.patch | 240 ---------------------
 dev-libs/protobuf/protobuf-9999.ebuild             | 148 -------------
 2 files changed, 388 deletions(-)

diff --git a/dev-libs/protobuf/files/protobuf-3.20.1-protoc_input_output_files.patch b/dev-libs/protobuf/files/protobuf-3.20.1-protoc_input_output_files.patch
deleted file mode 100644
index 39a68650a74a..000000000000
--- a/dev-libs/protobuf/files/protobuf-3.20.1-protoc_input_output_files.patch
+++ /dev/null
@@ -1,240 +0,0 @@
-https://github.com/protocolbuffers/protobuf/pull/235
-
---- a/src/google/protobuf/compiler/command_line_interface.cc
-+++ b/src/google/protobuf/compiler/command_line_interface.cc
-@@ -1110,6 +1110,28 @@
-   }
-
-   if (mode_ == MODE_ENCODE || mode_ == MODE_DECODE) {
-+    bool success = false;
-+    int in_fd = STDIN_FILENO;
-+    int out_fd = STDOUT_FILENO;
-+
-+    if (!protobuf_in_path_.empty()) {
-+      in_fd = open(protobuf_in_path_.c_str(), O_RDONLY);
-+      if (in_fd == -1) {
-+        std::cerr << protobuf_in_path_ << ": error: failed to open file." << std::endl;
-+        return 1;
-+      }
-+    }
-+    if (!protobuf_out_path_.empty()) {
-+      out_fd = open(protobuf_out_path_.c_str(),
-+                    O_WRONLY | O_CREAT | O_TRUNC,
-+                    0644);
-+      if (out_fd == -1) {
-+        std::cerr << protobuf_out_path_ << ": error: failed to open file." << std::endl;
-+        close(in_fd);
-+        return 1;
-+      }
-+    }
-+
-     if (codec_type_.empty()) {
-       // HACK:  Define an EmptyMessage type to use for decoding.
-       DescriptorPool pool;
-@@ -1118,13 +1140,20 @@
-       file.add_message_type()->set_name("EmptyMessage");
-       GOOGLE_CHECK(pool.BuildFile(file) != NULL);
-       codec_type_ = "EmptyMessage";
--      if (!EncodeOrDecode(&pool)) {
--        return 1;
--      }
-+      success = EncodeOrDecode(&pool, in_fd, out_fd);
-     } else {
--      if (!EncodeOrDecode(descriptor_pool.get())) {
--        return 1;
--      }
-+      success = EncodeOrDecode(descriptor_pool.get(), in_fd, out_fd);
-+    }
-+
-+    if (in_fd != STDIN_FILENO) {
-+      close(in_fd);
-+    }
-+    if (out_fd != STDOUT_FILENO) {
-+      close(out_fd);
-+    }
-+
-+    if (!success) {
-+      return 1;
-     }
-   }
-
-@@ -1163,6 +1192,11 @@
-   for (int i = 0; i < proto_path_.size(); i++) {
-     source_tree->MapPath(proto_path_[i].first, proto_path_[i].second);
-   }
-+  if (mode_ == MODE_COMPILE &&
-+      (!protobuf_in_path_.empty() || !protobuf_out_path_.empty())) {
-+    std::cerr << "--protobuf_in and --protobuf_out are only valid with "
-+         << "decode operations. Ignoring.";
-+  }
-
-   // Map input files to virtual paths if possible.
-   if (!MakeInputsBeProtoPathRelative(source_tree, fallback_database)) {
-@@ -1885,6 +1919,12 @@
-   } else if (name == "--deterministic_output") {
-     deterministic_output_ = true;
-
-+  } else if (name == "--protobuf_in") {
-+    protobuf_in_path_ = value;
-+
-+  } else if (name == "--protobuf_out") {
-+    protobuf_out_path_ = value;
-+
-   } else if (name == "--error_format") {
-     if (value == "gcc") {
-       error_format_ = ERROR_FORMAT_GCC;
-@@ -2018,22 +2058,38 @@
-   --version                   Show version info and exit.
-   -h, --help                  Show this text and exit.
-   --encode=MESSAGE_TYPE       Read a text-format message of the given type
--                              from standard input and write it in binary
--                              to standard output.  The message type must
-+                              from input protobuf file and write it in binary
-+                              to output protobuf file.  The message type must
-                               be defined in PROTO_FILES or their imports.
-+                              The input/output protobuf files are specified
-+                              using the --protobuf_in and --protobuf_out
-+                              command line flags.
-   --deterministic_output      When using --encode, ensure map fields are
-                               deterministically ordered. Note that this order
-                               is not canonical, and changes across builds or
-                               releases of protoc.
-   --decode=MESSAGE_TYPE       Read a binary message of the given type from
--                              standard input and write it in text format
--                              to standard output.  The message type must
-+                              input protobuf file and write it in text format
-+                              to output protobuf file.  The message type must
-                               be defined in PROTO_FILES or their imports.
-+                              The input/output protobuf files are specified
-+                              using the --protobuf_in and --protobuf_out
-+                              command line flags.
-   --decode_raw                Read an arbitrary protocol message from
--                              standard input and write the raw tag/value
--                              pairs in text format to standard output.  No
-+                              input protobuf file and write the raw tag/value
-+                              pairs in text format to output protobuf file.  No
-                               PROTO_FILES should be given when using this
--                              flag.
-+                              flag.  The input/output protobuf files are
-+                              specified using the --protobuf_in and
-+                              --protobuf_out command line flags.
-+  --protobuf_in=FILE          Absolute path to the protobuf file from which
-+                              input of encoding/decoding operation will be
-+                              read.  If omitted, input will be read from
-+                              standard input.
-+  --protobuf_out=FILE         Absolute path to the protobuf file to which
-+                              output of encoding/decoding operation will be
-+                              written.  If omitted, output will be written to
-+                              standard output.
-   --descriptor_set_in=FILES   Specifies a delimited list of FILES
-                               each containing a FileDescriptorSet (a
-                               protocol buffer defined in descriptor.proto).
-@@ -2344,7 +2400,9 @@
-   return true;
- }
-
--bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool) {
-+bool CommandLineInterface::EncodeOrDecode(const DescriptorPool* pool,
-+                                          int in_fd,
-+                                          int out_fd) {
-   // Look up the type.
-   const Descriptor* type = pool->FindMessageTypeByName(codec_type_);
-   if (type == NULL) {
-@@ -2356,15 +2414,15 @@
-   std::unique_ptr<Message> message(dynamic_factory.GetPrototype(type)->New());
-
-   if (mode_ == MODE_ENCODE) {
--    SetFdToTextMode(STDIN_FILENO);
--    SetFdToBinaryMode(STDOUT_FILENO);
-+    SetFdToTextMode(in_fd);
-+    SetFdToBinaryMode(out_fd);
-   } else {
--    SetFdToBinaryMode(STDIN_FILENO);
--    SetFdToTextMode(STDOUT_FILENO);
-+    SetFdToBinaryMode(in_fd);
-+    SetFdToTextMode(out_fd);
-   }
-
--  io::FileInputStream in(STDIN_FILENO);
--  io::FileOutputStream out(STDOUT_FILENO);
-+  io::FileInputStream in(in_fd);
-+  io::FileOutputStream out(out_fd);
-
-   if (mode_ == MODE_ENCODE) {
-     // Input is text.
---- a/src/google/protobuf/compiler/command_line_interface.h
-+++ b/src/google/protobuf/compiler/command_line_interface.h
-@@ -292,7 +292,9 @@
-       GeneratorContext* generator_context, std::string* error);
-
-   // Implements --encode and --decode.
--  bool EncodeOrDecode(const DescriptorPool* pool);
-+  bool EncodeOrDecode(const DescriptorPool* pool,
-+                      int in_fd,
-+                      int out_fd);
-
-   // Implements the --descriptor_set_out option.
-   bool WriteDescriptorSet(
-@@ -427,6 +429,13 @@
-   // parsed FileDescriptorSets to be used for loading protos.  Otherwise, empty.
-   std::vector<std::string> descriptor_set_in_names_;
-
-+  // When using --encode / --decode / --decode_raw absolute path to the output
-+  // file. (Empty string indicates write to STDOUT).
-+  std::string protobuf_out_path_;
-+  // When using --encode / --decode / --decode_raw, absolute path to the input
-+  // file. (Empty string indicates read from STDIN).
-+  std::string protobuf_in_path_;
-+
-   // If --descriptor_set_out was given, this is the filename to which the
-   // FileDescriptorSet should be written.  Otherwise, empty.
-   std::string descriptor_set_out_name_;
---- a/src/google/protobuf/compiler/command_line_interface_unittest.cc
-+++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc
-@@ -99,7 +99,7 @@
-   virtual void SetUp();
-   virtual void TearDown();
-
--  // Runs the CommandLineInterface with the given command line.  The
-+  // Run the CommandLineInterface with the given command line.  The
-   // command is automatically split on spaces, and the string "$tmpdir"
-   // is replaced with TestTempDir().
-   void Run(const std::string& command);
-@@ -2626,6 +2626,17 @@
-               std::string::npos);
-   }
-
-+  void ExpectBinaryFilesMatch(const std::string &expected_file,
-+                              const std::string &actual_file) {
-+    std::string expected_output, actual_output;
-+    ASSERT_TRUE(File::ReadFileToString(expected_file, &expected_output));
-+    ASSERT_TRUE(File::ReadFileToString(actual_file, &actual_output));
-+
-+    // Don't use EXPECT_EQ because we don't want to print raw binary data to
-+    // stdout on failure.
-+    EXPECT_TRUE(expected_output == actual_output);
-+  }
-+
-  private:
-   void WriteUnittestProtoDescriptorSet() {
-     unittest_proto_descriptor_set_filename_ =
-@@ -2749,6 +2760,19 @@
-       "Can only use --deterministic_output with --encode.\n");
- }
-
-+TEST_P(EncodeDecodeTest, RedirectInputOutput) {
-+  std::string out_file = TestTempDir() + "/golden_message_out.pbf";
-+  EXPECT_TRUE(
-+      Run(TestUtil::MaybeTranslatePath("net/proto2/internal/unittest.proto") +
-+          " --encode=protobuf_unittest.TestAllTypes" +
-+          " --protobuf_in=" + TestUtil::GetTestDataPath(
-+              "net/proto2/internal/"
-+              "testdata/text_format_unittest_data_oneof_implemented.txt") +
-+          " --protobuf_out=" + out_file));
-+  ExpectBinaryFilesMatch(out_file, TestUtil::GetTestDataPath(
-+      "net/proto2/internal/testdata/golden_message_oneof_implemented"));
-+}
-+
- INSTANTIATE_TEST_SUITE_P(FileDescriptorSetSource, EncodeDecodeTest,
-                          testing::Values(PROTO_PATH, DESCRIPTOR_SET_IN));
- }  // anonymous namespace

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-9999.ebuild
deleted file mode 100644
index 9f84c789877f..000000000000
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ /dev/null
@@ -1,148 +0,0 @@
-# Copyright 2008-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit autotools elisp-common flag-o-matic multilib-minimal toolchain-funcs
-
-if [[ "${PV}" == *9999 ]]; then
-	inherit git-r3
-
-	EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git"
-	EGIT_SUBMODULES=()
-else
-	SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
-fi
-
-DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing structured data"
-HOMEPAGE="
-	https://developers.google.com/protocol-buffers/
-"
-
-LICENSE="BSD"
-SLOT="0/32"
-IUSE="emacs examples static-libs test zlib"
-RESTRICT="!test? ( test )"
-
-BDEPEND="emacs? ( app-editors/emacs:* )"
-DEPEND="test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
-	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
-RDEPEND="emacs? ( app-editors/emacs:* )
-	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
-
-PATCHES=(
-	"${FILESDIR}/${PN}-3.19.0-disable_no-warning-test.patch"
-	"${FILESDIR}/${PN}-3.19.0-system_libraries.patch"
-	"${FILESDIR}/${PN}-3.20.1-protoc_input_output_files.patch"
-)
-
-DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)
-
-src_prepare() {
-	default
-
-	# https://github.com/protocolbuffers/protobuf/issues/7413
-	sed -e "/^AC_PROG_CXX_FOR_BUILD$/d" -i configure.ac || die
-
-	# https://github.com/protocolbuffers/protobuf/issues/8082
-	sed -e "/^TEST_F(IoTest, LargeOutput) {$/,/^}$/d" -i src/google/protobuf/io/zero_copy_stream_unittest.cc || die
-
-	# https://github.com/protocolbuffers/protobuf/issues/8459
-	sed \
-		-e "/^TEST(ArenaTest, BlockSizeSmallerThanAllocation) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" \
-		-e "/^TEST(ArenaTest, SpaceAllocated_and_Used) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" \
-		-i src/google/protobuf/arena_unittest.cc || die
-
-	# https://github.com/protocolbuffers/protobuf/issues/8460
-	sed -e "/^TEST(AnyTest, TestPackFromSerializationExceedsSizeLimit) {$/a\\  if (sizeof(void*) == 4) {\n    GTEST_SKIP();\n  }" -i src/google/protobuf/any_test.cc || die
-
-	# https://github.com/protocolbuffers/protobuf/issues/9433
-	sed -e "/^[[:space:]]*static_assert(alignof(U) <= 8, \"\");$/d" -i src/google/protobuf/descriptor.cc || die
-
-	eautoreconf
-}
-
-src_configure() {
-	append-cppflags -DGOOGLE_PROTOBUF_NO_RTTI
-
-	if tc-ld-is-gold; then
-		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
-		tc-ld-disable-gold
-	fi
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local options=(
-		$(use_enable static-libs static)
-		$(use_with zlib)
-	)
-
-	if tc-is-cross-compiler; then
-		# Build system uses protoc when building, so protoc copy runnable on host is needed.
-		mkdir -p "${WORKDIR}/build" || die
-		pushd "${WORKDIR}/build" > /dev/null || die
-		ECONF_SOURCE="${S}" econf_build "${options[@]}"
-		options+=(--with-protoc="$(pwd)/src/protoc")
-		popd > /dev/null || die
-	fi
-
-	ECONF_SOURCE="${S}" econf "${options[@]}"
-}
-
-src_compile() {
-	multilib-minimal_src_compile
-
-	if use emacs; then
-		elisp-compile editors/protobuf-mode.el
-	fi
-}
-
-multilib_src_compile() {
-	if tc-is-cross-compiler; then
-		emake -C "${WORKDIR}/build/src" protoc
-	fi
-
-	default
-}
-
-multilib_src_test() {
-	emake check
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name "*.la" -delete || die
-
-	if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}" ]]; then
-		eerror "No matching library found with SLOT variable, currently set: ${SLOT}\n" \
-			"Expected value: ${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}"
-		die "Please update SLOT variable"
-	fi
-
-	insinto /usr/share/vim/vimfiles/syntax
-	doins editors/proto.vim
-	insinto /usr/share/vim/vimfiles/ftdetect
-	doins "${FILESDIR}/proto.vim"
-
-	if use emacs; then
-		elisp-install ${PN} editors/protobuf-mode.el*
-		elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
-	fi
-
-	if use examples; then
-		DOCS+=(examples)
-		docompress -x /usr/share/doc/${PF}/examples
-	fi
-
-	einstalldocs
-}
-
-pkg_postinst() {
-	use emacs && elisp-site-regen
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2024-02-03 19:35 Jason Zaman
  0 siblings, 0 replies; 17+ messages in thread
From: Jason Zaman @ 2024-02-03 19:35 UTC (permalink / raw
  To: gentoo-commits

commit:     ff18a544a0a2ab7413c4ab395b7253f5ca2ceab9
Author:     wangjiezhe <wangjiezhe <AT> gmail <DOT> com>
AuthorDate: Fri Jan 19 10:27:06 2024 +0000
Commit:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Sat Feb  3 19:32:45 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff18a544

dev-libs/protobuf: add 22.5

dependency tree:
- tensorflow-2.13.1
  - net-libs/grpc-1.55.1
    - dev-libs/protobuf-22.5
    - dev-cpp/abseil-cpp-20230125.2

Signed-off-by: wangjiezhe <wangjiezhe <AT> gmail.com>
Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>

 dev-libs/protobuf/Manifest                         |   1 +
 ...e-ABI-for-static-and-shared-libraries-on-.patch |  71 +++++++++++++
 ...issing-PROTOBUF_EXPORT-for-public-symbols.patch |  32 ++++++
 dev-libs/protobuf/protobuf-22.5.ebuild             | 117 +++++++++++++++++++++
 4 files changed, 221 insertions(+)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index 20e1338a9868..8695f23be04a 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -1,3 +1,4 @@
 DIST protobuf-21.12.tar.gz 5141166 BLAKE2B 33500612d103afb817062486a741e8e5503f82c42c70054d47d1899e6bb79f3fdde2666cad5b8eff6e1bc539c3b0cdf9f2b125ce7e5d3a459a69e84d67ab535e SHA512 2dc8f552388438268d8b9f7a9e84c6abf1736be3d5031438c789c317410c9f4b5cedd25bf7da6d67b3ba32ca890869f9ddaab2284d6ac0e734a5b135ffbb1346
 DIST protobuf-21.9.tar.gz 5110670 BLAKE2B a4f5b7f58e1c5904ca990b100a72992f6f56177b28773f8de8c99e4158391d33cfb8aa8575915887fc9ae4294faf81d4ff6b470bc07b394bfd5885a09ba0fafe SHA512 6954b42d21921e630173b7848c056ab95635627d8eddec960f3db2ddda13eedde00520a9b350722e76e2998649eb8ebe10758e1db938b6a91e38ff3295b1b7c1
+DIST protobuf-22.5.tar.gz 4924661 BLAKE2B d69c73f4ebfddf45fd94b4f5f898faf00256fe674f2cbc0443c60a88d7a0f47fb96f2f6262879927c6da88095b4ea3ee7fd4c471c100bf42a2bae9edf48c07f1 SHA512 058ab2fec5b11007972e6043071056d1944c3b6fe1d31246cddba8eb57686e3b5280f6ad3d58e78940ca63005e74a8de3c72237f9f7c5066548c5a2513ddc584
 DIST protobuf-23.3.tar.gz 5043803 BLAKE2B ee2edee230969555c9ef95069c7b1d6c23c3d1f8ea1b2249fb3e9f6fcf63312c6e10e9da65b80629fb08d5fb08d05a19bb9c752c25b892c1e3fd6f18b9279eb3 SHA512 646af367dbc61b42e322cf0b335f360e428b272e2b1f5361b2f17c18d3dc9dddd615e1279436028b1a42275a0beadda37c2c934fc27d6c892131cc8d526d8b3b

diff --git a/dev-libs/protobuf/files/protobuf-22.5-Use-the-same-ABI-for-static-and-shared-libraries-on-.patch b/dev-libs/protobuf/files/protobuf-22.5-Use-the-same-ABI-for-static-and-shared-libraries-on-.patch
new file mode 100644
index 000000000000..4bbed7ecbaf5
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-22.5-Use-the-same-ABI-for-static-and-shared-libraries-on-.patch
@@ -0,0 +1,71 @@
+From 4329fde9cf3fab7d1b3a9abe0fbeee1ad8a8b111 Mon Sep 17 00:00:00 2001
+From: "Romain Geissler @ Amadeus" <romain.geissler@amadeus.com>
+Date: Tue, 6 Jun 2023 10:49:55 -0700
+Subject: [PATCH] Use the same ABI for static and shared libraries on
+ non-Windows platforms (#12983)
+
+Hi,
+
+It seems that until last year, the logic behind `PROTOBUF_USE_DLLS` was for Windows (MSCV) only. It was changed to all platforms here in https://github.com/protocolbuffers/protobuf/commit/5a0887fc6529596eff5c0f72febc602a9d494cc2
+
+Last month, the generated pkg config files were updated to reflect the protobuf build-time value of `PROTOBUF_USE_DLLS` as it was indeed noted that it changes the ABI. This was done in https://github.com/protocolbuffers/protobuf/pull/12700 In the commit message it is mentionned that most likely we shall rather have a stable ABI.
+
+Finally in https://github.com/protocolbuffers/protobuf/issues/12746 which at some point mentions https://issuetracker.google.com/issues/283987730#comment7 where a Google employee hits the linker issue:
+```
+undefined reference to `google::protobuf::internal::ThreadSafeArena::thread_cache_'
+```
+which denotes a mix of some .o or libs built `PROTOBUF_USE_DLLS` defined and some others build with `PROTOBUF_USE_DLLS` undefined, resulting in ABI incompatibilities.
+
+I also hit this issue while trying to include protobuf in a corporate environment using it's own proprietary build system in which it is expected that .a and .so use a compatible ABI.
+
+From my own understanding, ideally we should always use `thread_local` variables, but experience has shown that:
+ - old iOS (iOS < 9) didn't seem to accept `thread_local`, leading to the `GOOGLE_PROTOBUF_NO_THREADLOCAL` macro later renamed `PROTOBUF_NO_THREADLOCAL` which allowed to disable this, but it is not set anywhere in the protobuf code base. Also I doubt you still want to support such old iOS now, so maybe you should consider removing all `PROTOBUF_NO_THREADLOCAL` related code paths (this pull request doesn't do this).
+  - MSVC's DLL interface doesn't seem to accept exporting thread local variables (at least from what I understood, I know absolutely nothing about the Windows ecosystem), yet we can "hide" a thread local variable in a static function using a thread local variable. However in that case the access to TLS variable is not inlined, leading to worse performances, this hack shall be done only for Windows (actually when using MSVC) *AND* we build a shared library.
+  - In all other cases, a classical `thread_local` shall be used, no matter if we build a static or a shared library. In particular on Linux which I guess is the target Google cares the more about for its own production. This pull request achieves this.
+
+Am I right in my conclusion ?
+
+Closes #12983
+
+COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12983 from Romain-Geissler-1A:stable-abi-use-dll-non-windows dc23ff50f67cf0c8e45900a78700d1fc3e8bec39
+PiperOrigin-RevId: 538230923
+---
+ src/google/protobuf/arena.cc            |  2 +-
+ src/google/protobuf/reflection_mode.cc  |  2 +-
+ src/google/protobuf/reflection_mode.h   | 10 ++++++----
+ src/google/protobuf/thread_safe_arena.h |  6 +++---
+ 4 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/src/google/protobuf/arena.cc b/src/google/protobuf/arena.cc
+index 51afdbdaf..6577a3669 100644
+--- a/src/google/protobuf/arena.cc
++++ b/src/google/protobuf/arena.cc
+@@ -519,7 +519,7 @@ ThreadSafeArena::ThreadCache& ThreadSafeArena::thread_cache() {
+       new internal::ThreadLocalStorage<ThreadCache>();
+   return *thread_cache_->Get();
+ }
+-#elif defined(PROTOBUF_USE_DLLS)
++#elif defined(PROTOBUF_USE_DLLS) && defined(_MSC_VER)
+ ThreadSafeArena::ThreadCache& ThreadSafeArena::thread_cache() {
+   static PROTOBUF_THREAD_LOCAL ThreadCache thread_cache;
+   return thread_cache;
+diff --git a/src/google/protobuf/thread_safe_arena.h b/src/google/protobuf/thread_safe_arena.h
+index e6e3b7fae..f53993a85 100644
+--- a/src/google/protobuf/thread_safe_arena.h
++++ b/src/google/protobuf/thread_safe_arena.h
+@@ -260,9 +260,9 @@ class PROTOBUF_EXPORT ThreadSafeArena {
+   // iOS does not support __thread keyword so we use a custom thread local
+   // storage class we implemented.
+   static ThreadCache& thread_cache();
+-#elif defined(PROTOBUF_USE_DLLS)
+-  // Thread local variables cannot be exposed through DLL interface but we can
+-  // wrap them in static functions.
++#elif defined(PROTOBUF_USE_DLLS) && defined(_MSC_VER)
++  // Thread local variables cannot be exposed through MSVC DLL interface but we
++  // can wrap them in static functions.
+   static ThreadCache& thread_cache();
+ #else
+   PROTOBUF_CONSTINIT static PROTOBUF_THREAD_LOCAL ThreadCache thread_cache_;
+-- 
+2.43.0
+

diff --git a/dev-libs/protobuf/files/protobuf-22.5-fix-missing-PROTOBUF_EXPORT-for-public-symbols.patch b/dev-libs/protobuf/files/protobuf-22.5-fix-missing-PROTOBUF_EXPORT-for-public-symbols.patch
new file mode 100644
index 000000000000..fcf39e1e3e8f
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-22.5-fix-missing-PROTOBUF_EXPORT-for-public-symbols.patch
@@ -0,0 +1,32 @@
+From fc1c5512e524e0c00a276aa9a38b2cdb8fdf45c7 Mon Sep 17 00:00:00 2001
+From: Protobuf Team Bot <protobuf-github-bot@google.com>
+Date: Thu, 1 Jun 2023 09:14:48 -0700
+Subject: [PATCH] fix: missing `PROTOBUF_EXPORT` for public symbols
+
+PiperOrigin-RevId: 537042088
+---
+ src/google/protobuf/io/strtod.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/google/protobuf/io/strtod.h b/src/google/protobuf/io/strtod.h
+index 851c8e621..b368e4d87 100644
+--- a/src/google/protobuf/io/strtod.h
++++ b/src/google/protobuf/io/strtod.h
+@@ -60,12 +60,12 @@ PROTOBUF_EXPORT std::string SimpleFtoa(float value);
+ 
+ // A locale-independent version of the standard strtod(), which always
+ // uses a dot as the decimal separator.
+-double NoLocaleStrtod(const char* str, char** endptr);
++PROTOBUF_EXPORT double NoLocaleStrtod(const char* str, char** endptr);
+ 
+ // Casts a double value to a float value. If the value is outside of the
+ // representable range of float, it will be converted to positive or negative
+ // infinity.
+-float SafeDoubleToFloat(double value);
++PROTOBUF_EXPORT float SafeDoubleToFloat(double value);
+ 
+ }  // namespace io
+ }  // namespace protobuf
+-- 
+2.43.0
+

diff --git a/dev-libs/protobuf/protobuf-22.5.ebuild b/dev-libs/protobuf/protobuf-22.5.ebuild
new file mode 100644
index 000000000000..dc99040c5f31
--- /dev/null
+++ b/dev-libs/protobuf/protobuf-22.5.ebuild
@@ -0,0 +1,117 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib elisp-common flag-o-matic toolchain-funcs
+
+if [[ "${PV}" == *9999 ]]; then
+	inherit git-r3
+
+	EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git"
+	EGIT_SUBMODULES=()
+else
+	SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+fi
+
+DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing structured data"
+HOMEPAGE="https://protobuf.dev/"
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1-2).0"
+IUSE="emacs examples test zlib"
+RESTRICT="!test? ( test )"
+
+BDEPEND="emacs? ( app-editors/emacs:* )"
+DEPEND="
+	>=dev-cpp/abseil-cpp-20230125:=[${MULTILIB_USEDEP}]
+	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
+	test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+	>=dev-cpp/abseil-cpp-20230125:=[${MULTILIB_USEDEP}]
+	emacs? ( app-editors/emacs:* )
+	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
+"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-23.3-disable-32-bit-tests.patch"
+	"${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
+	"${FILESDIR}/${P}-fix-missing-PROTOBUF_EXPORT-for-public-symbols.patch"
+	"${FILESDIR}/${P}-Use-the-same-ABI-for-static-and-shared-libraries-on-.patch"
+)
+
+DOCS=( CONTRIBUTORS.txt README.md )
+
+src_prepare() {
+	eapply_user
+	append-cxxflags -std=c++17
+	cmake_src_prepare
+}
+
+src_configure() {
+	if tc-ld-is-gold; then
+		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+		tc-ld-disable-gold
+	fi
+
+	cmake-multilib_src_configure
+}
+
+multilib_src_configure() {
+	local mycmakeargs=(
+		-DCMAKE_CXX_STANDARD=17
+		-Dprotobuf_DISABLE_RTTI=ON
+		-Dprotobuf_BUILD_EXAMPLES=$(usex examples)
+		-Dprotobuf_WITH_ZLIB=$(usex zlib)
+		-Dprotobuf_BUILD_TESTS=$(usex test)
+		-Dprotobuf_ABSL_PROVIDER=package
+	)
+	use test && mycmakeargs+=(-Dprotobuf_USE_EXTERNAL_GTEST=ON)
+
+	cmake_src_configure
+}
+
+src_compile() {
+	cmake-multilib_src_compile
+
+	if use emacs; then
+		elisp-compile editors/protobuf-mode.el
+	fi
+}
+
+multilib_src_install_all() {
+	find "${ED}" -name "*.la" -delete || die
+
+	if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}" ]]; then
+		eerror "No matching library found with SLOT variable, currently set: ${SLOT}\n" \
+			"Expected value: ${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}"
+		die "Please update SLOT variable"
+	fi
+
+	insinto /usr/share/vim/vimfiles/syntax
+	doins editors/proto.vim
+	insinto /usr/share/vim/vimfiles/ftdetect
+	doins "${FILESDIR}/proto.vim"
+
+	if use emacs; then
+		elisp-install ${PN} editors/protobuf-mode.el*
+		elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
+	fi
+
+	if use examples; then
+		DOCS+=(examples)
+		docompress -x /usr/share/doc/${PF}/examples
+	fi
+
+	einstalldocs
+}
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+}


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2024-05-27 16:04 Joonas Niilola
  0 siblings, 0 replies; 17+ messages in thread
From: Joonas Niilola @ 2024-05-27 16:04 UTC (permalink / raw
  To: gentoo-commits

commit:     1324b66184a067dccbd068191012fd79e38a9ad5
Author:     Aliaksei Urbanski <aliaksei.urbanski <AT> gmail <DOT> com>
AuthorDate: Wed Apr 10 10:07:04 2024 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Mon May 27 16:04:56 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1324b661

dev-libs/protobuf: add 26.1

Release:
  - https://github.com/protocolbuffers/protobuf/releases/tag/v26.1

Bug: https://bugs.gentoo.org/915325
Signed-off-by: Aliaksei Urbanski <aliaksei.urbanski <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/36192
Closes: https://bugs.gentoo.org/932848
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 dev-libs/protobuf/Manifest                         |   1 +
 .../files/protobuf-26.1-disable-32-bit-tests.patch |  37 +++++++
 dev-libs/protobuf/protobuf-26.1.ebuild             | 108 +++++++++++++++++++++
 3 files changed, 146 insertions(+)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index 8695f23be04a..491e8fa19f28 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -2,3 +2,4 @@ DIST protobuf-21.12.tar.gz 5141166 BLAKE2B 33500612d103afb817062486a741e8e5503f8
 DIST protobuf-21.9.tar.gz 5110670 BLAKE2B a4f5b7f58e1c5904ca990b100a72992f6f56177b28773f8de8c99e4158391d33cfb8aa8575915887fc9ae4294faf81d4ff6b470bc07b394bfd5885a09ba0fafe SHA512 6954b42d21921e630173b7848c056ab95635627d8eddec960f3db2ddda13eedde00520a9b350722e76e2998649eb8ebe10758e1db938b6a91e38ff3295b1b7c1
 DIST protobuf-22.5.tar.gz 4924661 BLAKE2B d69c73f4ebfddf45fd94b4f5f898faf00256fe674f2cbc0443c60a88d7a0f47fb96f2f6262879927c6da88095b4ea3ee7fd4c471c100bf42a2bae9edf48c07f1 SHA512 058ab2fec5b11007972e6043071056d1944c3b6fe1d31246cddba8eb57686e3b5280f6ad3d58e78940ca63005e74a8de3c72237f9f7c5066548c5a2513ddc584
 DIST protobuf-23.3.tar.gz 5043803 BLAKE2B ee2edee230969555c9ef95069c7b1d6c23c3d1f8ea1b2249fb3e9f6fcf63312c6e10e9da65b80629fb08d5fb08d05a19bb9c752c25b892c1e3fd6f18b9279eb3 SHA512 646af367dbc61b42e322cf0b335f360e428b272e2b1f5361b2f17c18d3dc9dddd615e1279436028b1a42275a0beadda37c2c934fc27d6c892131cc8d526d8b3b
+DIST protobuf-26.1.tar.gz 5957903 BLAKE2B 1a7faab2f56aa0995801a80f73a812c7fc38a00af0bf25bdd5eecf7aec27a86a575ea2fb8484787d19c9ac6e46007c9864e79464f529c446f31af732981feed1 SHA512 0363ac09f92d8e040491425d444c8dca0b9b430e02d2dff6e2b28a0c2b2bea0d33a47f50bc9e2e2d4e8e22b65a02009a20c0066fb89c75df93a7b703dda42ed4

diff --git a/dev-libs/protobuf/files/protobuf-26.1-disable-32-bit-tests.patch b/dev-libs/protobuf/files/protobuf-26.1-disable-32-bit-tests.patch
new file mode 100644
index 000000000000..dfbda168d58e
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-26.1-disable-32-bit-tests.patch
@@ -0,0 +1,37 @@
+https://github.com/protocolbuffers/protobuf/issues/8460
+--- a/src/google/protobuf/any_test.cc
++++ b/src/google/protobuf/any_test.cc
+@@ -40,9 +40,8 @@ TEST(AnyTest, TestPackAndUnpack) {
+ }
+ 
+ TEST(AnyTest, TestPackFromSerializationExceedsSizeLimit) {
+-#if defined(_MSC_VER) && defined(_M_IX86)
+-  GTEST_SKIP() << "This toolchain can't allocate that much memory.";
+-#endif
++  // Filter out this test on 32-bit architectures.
++  if(sizeof(void*) < 8) return;
+   protobuf_unittest::TestAny submessage;
+   submessage.mutable_text()->resize(INT_MAX, 'a');
+   protobuf_unittest::TestAny message;
+
+https://github.com/protocolbuffers/protobuf/issues/8459
+--- a/src/google/protobuf/arena_unittest.cc
++++ b/src/google/protobuf/arena_unittest.cc
+@@ -1373,6 +1373,8 @@ TEST(ArenaTest, MessageLiteOnArena) {
+ uint64_t Align8(uint64_t n) { return (n + 7) & -8; }
+ 
+ TEST(ArenaTest, SpaceAllocated_and_Used) {
++  // Filter out this test on 32-bit architectures.
++  if(sizeof(void*) < 8) return;
+   Arena arena_1;
+   EXPECT_EQ(0, arena_1.SpaceAllocated());
+   EXPECT_EQ(0, arena_1.SpaceUsed());
+@@ -1453,6 +1455,8 @@ TEST(ArenaTest, Alignment) {
+ }
+ 
+ TEST(ArenaTest, BlockSizeSmallerThanAllocation) {
++  // Filter out this test on 32-bit architectures.
++  if(sizeof(void*) < 8) return;
+   for (size_t i = 0; i <= 8; ++i) {
+     ArenaOptions opt;
+     opt.start_block_size = opt.max_block_size = i;

diff --git a/dev-libs/protobuf/protobuf-26.1.ebuild b/dev-libs/protobuf/protobuf-26.1.ebuild
new file mode 100644
index 000000000000..8b99e882da51
--- /dev/null
+++ b/dev-libs/protobuf/protobuf-26.1.ebuild
@@ -0,0 +1,108 @@
+# Copyright 2008-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib elisp-common toolchain-funcs
+
+if [[ "${PV}" == *9999 ]]; then
+	inherit git-r3
+
+	EGIT_REPO_URI="https://github.com/protocolbuffers/protobuf.git"
+	EGIT_SUBMODULES=()
+else
+	SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+fi
+
+DESCRIPTION="Google's Protocol Buffers - Extensible mechanism for serializing structured data"
+HOMEPAGE="https://protobuf.dev/"
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1-2).0"
+IUSE="emacs examples test zlib"
+RESTRICT="!test? ( test )"
+
+BDEPEND="emacs? ( app-editors/emacs:* )"
+DEPEND="
+	>=dev-cpp/abseil-cpp-20230125.3:=[${MULTILIB_USEDEP},test?]
+	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
+	test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+	>=dev-cpp/abseil-cpp-20230125.3:=[${MULTILIB_USEDEP}]
+	emacs? ( app-editors/emacs:* )
+	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
+"
+
+PATCHES=(
+	"${FILESDIR}/${P}-disable-32-bit-tests.patch"
+	"${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
+)
+
+DOCS=( CONTRIBUTORS.txt README.md )
+
+src_configure() {
+	if tc-ld-is-gold; then
+		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
+		tc-ld-disable-gold
+	fi
+
+	cmake-multilib_src_configure
+}
+
+multilib_src_configure() {
+	local mycmakeargs=(
+		-Dprotobuf_DISABLE_RTTI=ON
+		-Dprotobuf_BUILD_EXAMPLES=$(usex examples)
+		-Dprotobuf_WITH_ZLIB=$(usex zlib)
+		-Dprotobuf_BUILD_TESTS=$(usex test)
+		-Dprotobuf_ABSL_PROVIDER=package
+	)
+	use test && mycmakeargs+=(-Dprotobuf_USE_EXTERNAL_GTEST=ON)
+
+	cmake_src_configure
+}
+
+src_compile() {
+	cmake-multilib_src_compile
+
+	if use emacs; then
+		elisp-compile editors/protobuf-mode.el
+	fi
+}
+
+multilib_src_install_all() {
+	find "${ED}" -name "*.la" -delete || die
+
+	if [[ ! -f "${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}" ]]; then
+		eerror "No matching library found with SLOT variable, currently set: ${SLOT}\n" \
+			"Expected value: ${ED}/usr/$(get_libdir)/libprotobuf.so.${SLOT#*/}"
+		die "Please update SLOT variable"
+	fi
+
+	insinto /usr/share/vim/vimfiles/syntax
+	doins editors/proto.vim
+	insinto /usr/share/vim/vimfiles/ftdetect
+	doins "${FILESDIR}/proto.vim"
+
+	if use emacs; then
+		elisp-install ${PN} editors/protobuf-mode.el*
+		elisp-site-file-install "${FILESDIR}/70${PN}-gentoo.el"
+	fi
+
+	if use examples; then
+		DOCS+=(examples)
+		docompress -x /usr/share/doc/${PF}/examples
+	fi
+
+	einstalldocs
+}
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+}


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2024-06-14  8:18 Sam James
  0 siblings, 0 replies; 17+ messages in thread
From: Sam James @ 2024-06-14  8:18 UTC (permalink / raw
  To: gentoo-commits

commit:     410197e34e6a385937b0d00898916d6dd11d0e73
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 14 08:18:18 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 14 08:18:18 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=410197e3

dev-libs/protobuf: backport template instantiation fix

Closes: https://bugs.gentoo.org/917046
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...buf-23.3-messages_lite-template-instances.patch | 66 ++++++++++++++++++++++
 ...obuf-23.3-r3.ebuild => protobuf-23.3-r4.ebuild} |  1 +
 2 files changed, 67 insertions(+)

diff --git a/dev-libs/protobuf/files/protobuf-23.3-messages_lite-template-instances.patch b/dev-libs/protobuf/files/protobuf-23.3-messages_lite-template-instances.patch
new file mode 100644
index 000000000000..3869ad95993c
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-23.3-messages_lite-template-instances.patch
@@ -0,0 +1,66 @@
+https://bugs.gentoo.org/917046
+https://github.com/protocolbuffers/protobuf/commit/e6f8b9d1026996f6463d4f014d7760256b757227
+
+From e6f8b9d1026996f6463d4f014d7760256b757227 Mon Sep 17 00:00:00 2001
+From: Protobuf Team Bot <protobuf-github-bot@google.com>
+Date: Wed, 8 Nov 2023 09:20:10 -0800
+Subject: [PATCH] message_lite.h: Use PROTOBUF_EXPORT_TEMPLATE_DECLARE with
+ extern template
+
+Export extern templates in message_lite.h to avoid missing symbols when
+linking protobuf-lite.so.
+
+PiperOrigin-RevId: 580556084
+--- a/src/google/protobuf/message_lite.h
++++ b/src/google/protobuf/message_lite.h
+@@ -616,22 +616,22 @@ namespace internal {
+ template <bool alias>
+ bool MergeFromImpl(absl::string_view input, MessageLite* msg,
+                    MessageLite::ParseFlags parse_flags);
+-extern template bool MergeFromImpl<false>(absl::string_view input,
+-                                          MessageLite* msg,
+-                                          MessageLite::ParseFlags parse_flags);
+-extern template bool MergeFromImpl<true>(absl::string_view input,
+-                                         MessageLite* msg,
+-                                         MessageLite::ParseFlags parse_flags);
++extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<false>(
++    absl::string_view input, MessageLite* msg,
++    MessageLite::ParseFlags parse_flags);
++extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<true>(
++    absl::string_view input, MessageLite* msg,
++    MessageLite::ParseFlags parse_flags);
+ 
+ template <bool alias>
+ bool MergeFromImpl(io::ZeroCopyInputStream* input, MessageLite* msg,
+                    MessageLite::ParseFlags parse_flags);
+-extern template bool MergeFromImpl<false>(io::ZeroCopyInputStream* input,
+-                                          MessageLite* msg,
+-                                          MessageLite::ParseFlags parse_flags);
+-extern template bool MergeFromImpl<true>(io::ZeroCopyInputStream* input,
+-                                         MessageLite* msg,
+-                                         MessageLite::ParseFlags parse_flags);
++extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<false>(
++    io::ZeroCopyInputStream* input, MessageLite* msg,
++    MessageLite::ParseFlags parse_flags);
++extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<true>(
++    io::ZeroCopyInputStream* input, MessageLite* msg,
++    MessageLite::ParseFlags parse_flags);
+ 
+ struct BoundedZCIS {
+   io::ZeroCopyInputStream* zcis;
+@@ -641,10 +641,10 @@ struct BoundedZCIS {
+ template <bool alias>
+ bool MergeFromImpl(BoundedZCIS input, MessageLite* msg,
+                    MessageLite::ParseFlags parse_flags);
+-extern template bool MergeFromImpl<false>(BoundedZCIS input, MessageLite* msg,
+-                                          MessageLite::ParseFlags parse_flags);
+-extern template bool MergeFromImpl<true>(BoundedZCIS input, MessageLite* msg,
+-                                         MessageLite::ParseFlags parse_flags);
++extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<false>(
++    BoundedZCIS input, MessageLite* msg, MessageLite::ParseFlags parse_flags);
++extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<true>(
++    BoundedZCIS input, MessageLite* msg, MessageLite::ParseFlags parse_flags);
+ 
+ template <typename T>
+ struct SourceWrapper;
+

diff --git a/dev-libs/protobuf/protobuf-23.3-r3.ebuild b/dev-libs/protobuf/protobuf-23.3-r4.ebuild
similarity index 97%
rename from dev-libs/protobuf/protobuf-23.3-r3.ebuild
rename to dev-libs/protobuf/protobuf-23.3-r4.ebuild
index 6ef5f8f482f1..f44655dc1c74 100644
--- a/dev-libs/protobuf/protobuf-23.3-r3.ebuild
+++ b/dev-libs/protobuf/protobuf-23.3-r4.ebuild
@@ -40,6 +40,7 @@ RDEPEND="
 PATCHES=(
 	"${FILESDIR}/${PN}-23.3-disable-32-bit-tests.patch"
 	"${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
+	"${FILESDIR}/${PN}-23.3-messages_lite-template-instances.patch"
 )
 
 DOCS=( CONTRIBUTORS.txt README.md )


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/
@ 2024-09-05  2:12 Sam James
  0 siblings, 0 replies; 17+ messages in thread
From: Sam James @ 2024-09-05  2:12 UTC (permalink / raw
  To: gentoo-commits

commit:     d8a00c14ed868a2023443d16cb4cb3f148bdb302
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Thu Aug  8 12:14:40 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Sep  5 02:10:40 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8a00c14

dev-libs/protobuf: add 28.0, 27.4, 25.4

Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/protobuf/Manifest                         |  3 ++
 dev-libs/protobuf/files/FindJsonCpp.cmake          | 40 +++++++++++++++++++
 .../protobuf/files/protobuf-27.4-findJsonCpp.patch | 33 ++++++++++++++++
 .../files/protobuf-28.0-disable-test_upb-lto.patch | 23 +++++++++++
 .../{protobuf-9999.ebuild => protobuf-25.4.ebuild} | 44 ++++++++++++---------
 .../{protobuf-9999.ebuild => protobuf-27.4.ebuild} | 46 ++++++++++++----------
 .../{protobuf-9999.ebuild => protobuf-28.0.ebuild} | 46 ++++++++++++----------
 dev-libs/protobuf/protobuf-9999.ebuild             | 46 ++++++++++++----------
 8 files changed, 202 insertions(+), 79 deletions(-)

diff --git a/dev-libs/protobuf/Manifest b/dev-libs/protobuf/Manifest
index af1849aaafc2..00ff3f3c1399 100644
--- a/dev-libs/protobuf/Manifest
+++ b/dev-libs/protobuf/Manifest
@@ -5,5 +5,8 @@ DIST protobuf-23.3.tar.gz 5043803 BLAKE2B ee2edee230969555c9ef95069c7b1d6c23c3d1
 DIST protobuf-23.4.tar.gz 5043507 BLAKE2B bf6a50771eb977ef92b779a32fd909693faae6394254c73e3c9b2729bce643f8cbfb5a1bd18b30abf3003b9fbfd24c074cea4085a6ccf14fdb6a3aeac9efcb89 SHA512 b93a4e0339ecbe085796de5b6c61feae35229d40db9019c043090bcaa483a1cce78a99487c5638482c68832fcede5579a0e5ec731221a88359b80db9bb6dc566
 DIST protobuf-24.4.tar.gz 5180235 BLAKE2B 1c7e9035d9f3810886baaea7d679414c882463c79828c99dd8895a9549638c1ca17f9ab3b38d461019f3e1412d9cb9584b995b1da99866eb6fdbb8bdeb063e6f SHA512 52b6ab5587d03cbd1f35cf3cdc388e1710fa50f3031559ac53cf754965407ded7602cdead56080444ab695588112cc3391a1d7fdd5e565d90d0af7ad08706315
 DIST protobuf-25.3.tar.gz 5878962 BLAKE2B 9268f9bd993a1cfd6d3937a2ad56ba4cfe3d84923756513841cbf13039d4a07acb260468745cb1294f30334cb34b45c6fde272f5c40d9de63ac6a4ce5c263077 SHA512 1f73e237c919082e5423ae9e2ea8813dccf672c059051d1531fe89ffaa45872d3cf3052b8c3af26f674296ec17d7dc861c67b8f0834ed80261ce4a6a14ed7115
+DIST protobuf-25.4.tar.gz 5878444 BLAKE2B 9b40985bda31a84dd3ab7a1d18f746d5f88660d9e036a20234cbc85e79322005d2ffd4e60d72c55a8b5f624d7cc50522771f0804f203f2eabca7b0b8ace0545e SHA512 1b3ba1a1575bcc9d52ddce93d466912863d600dfbb40f64845b8e66c8000047d05508b8f1baba8d5eef42a7ff90eb778f7c8a553c9ec2778fd3a9a18122c67ab
 DIST protobuf-26.1.tar.gz 5957903 BLAKE2B 1a7faab2f56aa0995801a80f73a812c7fc38a00af0bf25bdd5eecf7aec27a86a575ea2fb8484787d19c9ac6e46007c9864e79464f529c446f31af732981feed1 SHA512 0363ac09f92d8e040491425d444c8dca0b9b430e02d2dff6e2b28a0c2b2bea0d33a47f50bc9e2e2d4e8e22b65a02009a20c0066fb89c75df93a7b703dda42ed4
 DIST protobuf-27.2.tar.gz 6282174 BLAKE2B 86d12e9f87e8e1c2961ad517115c8689a8dd984722513816d8d626e59a76f5e7a698a90cbf6007daacf66c6053c9ff28108ff113579a442ce61cd221178bda44 SHA512 664c66b62cf1ed0c65d9b910d8e67d4d5d471113697f1b8edf1573cd5c0fc8e850ac53ce984e48e6c6b9cbbefa12f8530058384e7388e65a59c1e46d03772397
+DIST protobuf-27.4.tar.gz 9156456 BLAKE2B 004427f4923e523bf77298600bf91a8fe4ca8be4bd6da5b7efcfe9186a032155e525426f83f683e1bed1e799ed1e62d250053386c1463cbd0c062bd05da786d0 SHA512 d076ce7e075096d0dba7ee2314b12e3223c4239c019e25670636a0ef812ddf0ce3f1fd9b9fe8517319db87b14bbdb2653cc4e06023f90032dfedb014457b2863
+DIST protobuf-28.0.tar.gz 9259114 BLAKE2B 328e09ebffb296d838557ea72a4fc4da8e0ad5f1edfccebcc8ee7c9e0e74d06e5e6dbad741fd89f6a4502c1cb246a973fd60c035ccdbf89700b7baff49e2a65e SHA512 8745f625ac781f3bbefe9494cbf570143d38aecc1521edef7a52ffb403b8be24df2c71f4f2410b5a5b78a0f3e8a38a7d19be2cf916b1b9125349d2da18262cd1

diff --git a/dev-libs/protobuf/files/FindJsonCpp.cmake b/dev-libs/protobuf/files/FindJsonCpp.cmake
new file mode 100644
index 000000000000..8fff5336ce46
--- /dev/null
+++ b/dev-libs/protobuf/files/FindJsonCpp.cmake
@@ -0,0 +1,40 @@
+find_path(JsonCpp_INCLUDE_DIR "json/json.h"
+  PATH_SUFFIXES "jsoncpp"
+  DOC "jsoncpp include directory")
+mark_as_advanced(JsonCpp_INCLUDE_DIR)
+
+find_library(JsonCpp_LIBRARY
+  NAMES jsoncpp
+  DOC "jsoncpp library")
+mark_as_advanced(JsonCpp_LIBRARY)
+
+if (JsonCpp_INCLUDE_DIR AND EXISTS "${JsonCpp_INCLUDE_DIR}/json/version.h")
+  file(STRINGS "${JsonCpp_INCLUDE_DIR}/json/version.h" _JsonCpp_version_lines
+    REGEX "JSONCPP_VERSION_[A-Z]+")
+  string(REGEX REPLACE ".*# *define +JSONCPP_VERSION_MAJOR +([0-9]+).*" "\\1" _JsonCpp_version_major "${_JsonCpp_version_lines}")
+  string(REGEX REPLACE ".*# *define +JSONCPP_VERSION_MINOR +([0-9]+).*" "\\1" _JsonCpp_version_minor "${_JsonCpp_version_lines}")
+  string(REGEX REPLACE ".*# *define +JSONCPP_VERSION_PATCH +([0-9]+).*" "\\1" _JsonCpp_version_patch "${_JsonCpp_version_lines}")
+  set(JsonCpp_VERSION "${_JsonCpp_version_major}.${_JsonCpp_version_minor}.${_JsonCpp_version_patch}")
+  unset(_JsonCpp_version_major)
+  unset(_JsonCpp_version_minor)
+  unset(_JsonCpp_version_patch)
+  unset(_JsonCpp_version_lines)
+endif ()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(JsonCpp
+  REQUIRED_VARS JsonCpp_LIBRARY JsonCpp_INCLUDE_DIR
+  VERSION_VAR JsonCpp_VERSION)
+
+if (JsonCpp_FOUND)
+  set(JsonCpp_INCLUDE_DIRS "${JsonCpp_INCLUDE_DIR}")
+  set(JsonCpp_LIBRARIES "${JsonCpp_LIBRARY}")
+
+  if (NOT TARGET JsonCpp::JsonCpp)
+    add_library(JsonCpp::JsonCpp SHARED IMPORTED)
+    set_target_properties(JsonCpp::JsonCpp PROPERTIES
+      IMPORTED_LOCATION "${JsonCpp_LIBRARY}"
+      IMPORTED_IMPLIB "${JsonCpp_LIBRARY}"
+      INTERFACE_INCLUDE_DIRECTORIES "${JsonCpp_INCLUDE_DIR}")
+  endif ()
+endif ()

diff --git a/dev-libs/protobuf/files/protobuf-27.4-findJsonCpp.patch b/dev-libs/protobuf/files/protobuf-27.4-findJsonCpp.patch
new file mode 100644
index 000000000000..6ce98f758ec8
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-27.4-findJsonCpp.patch
@@ -0,0 +1,33 @@
+From e3138533bf97e1133371944b28e65bae5e8ae95c Mon Sep 17 00:00:00 2001
+From: Paul Zander <negril.nx+gentoo@gmail.com>
+Date: Sat, 10 Aug 2024 13:43:28 +0200
+Subject: [PATCH] fix JsonCPP name
+
+Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
+---
+ cmake/conformance.cmake | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cmake/conformance.cmake b/cmake/conformance.cmake
+index c5d8c7c..2e059ea 100644
+--- a/cmake/conformance.cmake
++++ b/cmake/conformance.cmake
+@@ -9,7 +9,7 @@ if (protobuf_JSONCPP_PROVIDER STREQUAL "module")
+             "  cmake -Dprotobuf_BUILD_CONFORMANCE=OFF\n")
+   endif()
+ elseif(protobuf_JSONCPP_PROVIDER STREQUAL "package")
+-  find_package(jsoncpp REQUIRED)
++  find_package(JsonCpp REQUIRED)
+ endif()
+ 
+ file(MAKE_DIRECTORY ${protobuf_BINARY_DIR}/conformance)
+@@ -140,5 +140,5 @@ if(protobuf_JSONCPP_PROVIDER STREQUAL "module")
+     target_link_libraries(conformance_test_runner jsoncpp_static)
+   endif()
+ else()
+-  target_link_libraries(conformance_test_runner jsoncpp)
++  target_link_libraries(conformance_test_runner JsonCpp::JsonCpp)
+ endif()
+-- 
+2.46.0
+

diff --git a/dev-libs/protobuf/files/protobuf-28.0-disable-test_upb-lto.patch b/dev-libs/protobuf/files/protobuf-28.0-disable-test_upb-lto.patch
new file mode 100644
index 000000000000..0a9ed5e8e67c
--- /dev/null
+++ b/dev-libs/protobuf/files/protobuf-28.0-disable-test_upb-lto.patch
@@ -0,0 +1,23 @@
+From 14fe043db8162df9ddc2308437cace6434c67bd9 Mon Sep 17 00:00:00 2001
+From: Paul Zander <negril.nx+gentoo@gmail.com>
+Date: Fri, 30 Aug 2024 03:22:16 +0200
+Subject: [PATCH] disable test_upb
+
+Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
+
+diff --git a/cmake/tests.cmake b/cmake/tests.cmake
+index c8ae114..eac821c 100644
+--- a/cmake/tests.cmake
++++ b/cmake/tests.cmake
+@@ -175,7 +175,7 @@ add_test(NAME full-test
+   COMMAND tests ${protobuf_GTEST_ARGS}
+   WORKING_DIRECTORY ${protobuf_SOURCE_DIR})
+ 
+-if (protobuf_BUILD_LIBUPB)
++if (protobuf_BUILD_LIBUPB AND FALSE)
+   set(upb_test_proto_genfiles)
+   foreach(proto_file ${upb_test_protos_files} ${descriptor_proto_proto_srcs})
+     foreach(generator upb upbdefs upb_minitable)
+-- 
+2.46.0
+

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-25.4.ebuild
similarity index 76%
copy from dev-libs/protobuf/protobuf-9999.ebuild
copy to dev-libs/protobuf/protobuf-25.4.ebuild
index 9988631acc75..f79f633b0487 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-25.4.ebuild
@@ -3,9 +3,10 @@
 
 EAPI=8
 
-inherit cmake-multilib elisp-common toolchain-funcs multilib
+inherit cmake-multilib elisp-common multilib
 
-ABSEIL_BRANCH="lts_2023_08_02" # NOTE from https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+# NOTE from https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+ABSEIL_BRANCH="lts_2023_08_02"
 
 ABSEIL_MIN_VER="${ABSEIL_BRANCH//lts_}"
 ABSEIL_MIN_VER="${ABSEIL_MIN_VER//_/}"
@@ -17,8 +18,8 @@ if [[ "${PV}" == *9999 ]]; then
 
 	inherit git-r3
 else
-	SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+	SRC_URI="https://github.com/protocolbuffers/protobuf/releases/download/v${PV}/${P}.tar.gz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~x64-macos"
 	MY_SLOT=$(ver_cut 1-2)
 fi
 
@@ -27,7 +28,7 @@ HOMEPAGE="https://protobuf.dev/"
 
 LICENSE="BSD"
 SLOT="0/${MY_SLOT}.0"
-IUSE="conformance emacs examples +libprotoc libupb +protobuf +protoc test zlib"
+IUSE="conformance debug emacs examples +libprotoc libupb +protobuf +protoc test zlib"
 
 REQUIRED_USE="
 	|| (
@@ -48,7 +49,7 @@ BDEPEND="
 "
 
 COMMON_DEPEND="
-	dev-libs/jsoncpp
+	dev-libs/jsoncpp[${MULTILIB_USEDEP}]
 	>=dev-cpp/abseil-cpp-${ABSEIL_MIN_VER}:=[${MULTILIB_USEDEP}]
 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
 "
@@ -65,22 +66,16 @@ RDEPEND="
 PATCHES=(
 	"${FILESDIR}/${PN}-26.1-disable-32-bit-tests.patch"
 	"${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
+	"${FILESDIR}/${PN}-27.4-findJsonCpp.patch"
+	"${FILESDIR}/${PN}-28.0-disable-test_upb-lto.patch"
 )
 
 DOCS=( CONTRIBUTORS.txt README.md )
 
-# src_prepare() {
-# 	rm "${S}/third_party/utf8_range/" -rf || die
-# 	cmake_src_prepare
-# }
+src_prepare() {
+	cmake_src_prepare
 
-src_configure() {
-	if tc-ld-is-gold; then
-		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
-		tc-ld-disable-gold
-	fi
-
-	cmake-multilib_src_configure
+	cp "${FILESDIR}/FindJsonCpp.cmake" "${S}/cmake" || die
 }
 
 multilib_src_configure() {
@@ -104,7 +99,8 @@ multilib_src_configure() {
 		-Dprotobuf_TEST_XML_OUTDIR="$(usex test)"
 
 		-Dprotobuf_WITH_ZLIB="$(usex zlib)"
-		-Dprotobuf_VERBOSE="yes"
+		-Dprotobuf_VERBOSE="$(usex debug)"
+		-DCMAKE_MODULE_PATH="${S}/cmake"
 	)
 	use test && mycmakeargs+=( -Dprotobuf_USE_EXTERNAL_GTEST="yes" )
 
@@ -120,7 +116,17 @@ src_compile() {
 }
 
 src_test() {
-	local -x srcdir="${S}"/src
+	local -x srcdir="${S}/src"
+
+	local -x TEST_TMPDIR="${T%/}/TEST_TMPDIR_${ABI}"
+	mkdir -m 777 "${TEST_TMPDIR}" || die
+
+	setup_test_env() {
+		ln -sr "${S}/src" "${BUILD_DIR}/include" || die
+	}
+
+	multilib_foreach_abi setup_test_env
+
 	cmake-multilib_src_test
 }
 

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-27.4.ebuild
similarity index 75%
copy from dev-libs/protobuf/protobuf-9999.ebuild
copy to dev-libs/protobuf/protobuf-27.4.ebuild
index 9988631acc75..30ab416efd86 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-27.4.ebuild
@@ -3,9 +3,10 @@
 
 EAPI=8
 
-inherit cmake-multilib elisp-common toolchain-funcs multilib
+inherit cmake-multilib elisp-common multilib
 
-ABSEIL_BRANCH="lts_2023_08_02" # NOTE from https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+# NOTE from https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+ABSEIL_BRANCH="lts_2023_08_02"
 
 ABSEIL_MIN_VER="${ABSEIL_BRANCH//lts_}"
 ABSEIL_MIN_VER="${ABSEIL_MIN_VER//_/}"
@@ -17,8 +18,8 @@ if [[ "${PV}" == *9999 ]]; then
 
 	inherit git-r3
 else
-	SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+	SRC_URI="https://github.com/protocolbuffers/protobuf/releases/download/v${PV}/${P}.tar.gz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~x64-macos"
 	MY_SLOT=$(ver_cut 1-2)
 fi
 
@@ -27,7 +28,7 @@ HOMEPAGE="https://protobuf.dev/"
 
 LICENSE="BSD"
 SLOT="0/${MY_SLOT}.0"
-IUSE="conformance emacs examples +libprotoc libupb +protobuf +protoc test zlib"
+IUSE="conformance debug emacs examples +libprotoc libupb +protobuf +protoc test zlib"
 
 REQUIRED_USE="
 	|| (
@@ -48,14 +49,14 @@ BDEPEND="
 "
 
 COMMON_DEPEND="
-	dev-libs/jsoncpp
+	dev-libs/jsoncpp[${MULTILIB_USEDEP}]
 	>=dev-cpp/abseil-cpp-${ABSEIL_MIN_VER}:=[${MULTILIB_USEDEP}]
 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
 "
 
 DEPEND="
 	${COMMON_DEPEND}
-	test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
+	test? ( >=dev-cpp/gtest-1.11[${MULTILIB_USEDEP}] )
 "
 RDEPEND="
 	${COMMON_DEPEND}
@@ -65,22 +66,16 @@ RDEPEND="
 PATCHES=(
 	"${FILESDIR}/${PN}-26.1-disable-32-bit-tests.patch"
 	"${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
+	"${FILESDIR}/${PN}-27.4-findJsonCpp.patch"
+	"${FILESDIR}/${PN}-28.0-disable-test_upb-lto.patch"
 )
 
 DOCS=( CONTRIBUTORS.txt README.md )
 
-# src_prepare() {
-# 	rm "${S}/third_party/utf8_range/" -rf || die
-# 	cmake_src_prepare
-# }
+src_prepare() {
+	cmake_src_prepare
 
-src_configure() {
-	if tc-ld-is-gold; then
-		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
-		tc-ld-disable-gold
-	fi
-
-	cmake-multilib_src_configure
+	cp "${FILESDIR}/FindJsonCpp.cmake" "${S}/cmake" || die
 }
 
 multilib_src_configure() {
@@ -104,7 +99,8 @@ multilib_src_configure() {
 		-Dprotobuf_TEST_XML_OUTDIR="$(usex test)"
 
 		-Dprotobuf_WITH_ZLIB="$(usex zlib)"
-		-Dprotobuf_VERBOSE="yes"
+		-Dprotobuf_VERBOSE="$(usex debug)"
+		-DCMAKE_MODULE_PATH="${S}/cmake"
 	)
 	use test && mycmakeargs+=( -Dprotobuf_USE_EXTERNAL_GTEST="yes" )
 
@@ -120,7 +116,17 @@ src_compile() {
 }
 
 src_test() {
-	local -x srcdir="${S}"/src
+	local -x srcdir="${S}/src"
+
+	local -x TEST_TMPDIR="${T%/}/TEST_TMPDIR_${ABI}"
+	mkdir -m 777 "${TEST_TMPDIR}" || die
+
+	setup_test_env() {
+		ln -sr "${S}/src" "${BUILD_DIR}/include" || die
+	}
+
+	multilib_foreach_abi setup_test_env
+
 	cmake-multilib_src_test
 }
 

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-28.0.ebuild
similarity index 75%
copy from dev-libs/protobuf/protobuf-9999.ebuild
copy to dev-libs/protobuf/protobuf-28.0.ebuild
index 9988631acc75..30ab416efd86 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-28.0.ebuild
@@ -3,9 +3,10 @@
 
 EAPI=8
 
-inherit cmake-multilib elisp-common toolchain-funcs multilib
+inherit cmake-multilib elisp-common multilib
 
-ABSEIL_BRANCH="lts_2023_08_02" # NOTE from https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+# NOTE from https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+ABSEIL_BRANCH="lts_2023_08_02"
 
 ABSEIL_MIN_VER="${ABSEIL_BRANCH//lts_}"
 ABSEIL_MIN_VER="${ABSEIL_MIN_VER//_/}"
@@ -17,8 +18,8 @@ if [[ "${PV}" == *9999 ]]; then
 
 	inherit git-r3
 else
-	SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+	SRC_URI="https://github.com/protocolbuffers/protobuf/releases/download/v${PV}/${P}.tar.gz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~x64-macos"
 	MY_SLOT=$(ver_cut 1-2)
 fi
 
@@ -27,7 +28,7 @@ HOMEPAGE="https://protobuf.dev/"
 
 LICENSE="BSD"
 SLOT="0/${MY_SLOT}.0"
-IUSE="conformance emacs examples +libprotoc libupb +protobuf +protoc test zlib"
+IUSE="conformance debug emacs examples +libprotoc libupb +protobuf +protoc test zlib"
 
 REQUIRED_USE="
 	|| (
@@ -48,14 +49,14 @@ BDEPEND="
 "
 
 COMMON_DEPEND="
-	dev-libs/jsoncpp
+	dev-libs/jsoncpp[${MULTILIB_USEDEP}]
 	>=dev-cpp/abseil-cpp-${ABSEIL_MIN_VER}:=[${MULTILIB_USEDEP}]
 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
 "
 
 DEPEND="
 	${COMMON_DEPEND}
-	test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
+	test? ( >=dev-cpp/gtest-1.11[${MULTILIB_USEDEP}] )
 "
 RDEPEND="
 	${COMMON_DEPEND}
@@ -65,22 +66,16 @@ RDEPEND="
 PATCHES=(
 	"${FILESDIR}/${PN}-26.1-disable-32-bit-tests.patch"
 	"${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
+	"${FILESDIR}/${PN}-27.4-findJsonCpp.patch"
+	"${FILESDIR}/${PN}-28.0-disable-test_upb-lto.patch"
 )
 
 DOCS=( CONTRIBUTORS.txt README.md )
 
-# src_prepare() {
-# 	rm "${S}/third_party/utf8_range/" -rf || die
-# 	cmake_src_prepare
-# }
+src_prepare() {
+	cmake_src_prepare
 
-src_configure() {
-	if tc-ld-is-gold; then
-		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
-		tc-ld-disable-gold
-	fi
-
-	cmake-multilib_src_configure
+	cp "${FILESDIR}/FindJsonCpp.cmake" "${S}/cmake" || die
 }
 
 multilib_src_configure() {
@@ -104,7 +99,8 @@ multilib_src_configure() {
 		-Dprotobuf_TEST_XML_OUTDIR="$(usex test)"
 
 		-Dprotobuf_WITH_ZLIB="$(usex zlib)"
-		-Dprotobuf_VERBOSE="yes"
+		-Dprotobuf_VERBOSE="$(usex debug)"
+		-DCMAKE_MODULE_PATH="${S}/cmake"
 	)
 	use test && mycmakeargs+=( -Dprotobuf_USE_EXTERNAL_GTEST="yes" )
 
@@ -120,7 +116,17 @@ src_compile() {
 }
 
 src_test() {
-	local -x srcdir="${S}"/src
+	local -x srcdir="${S}/src"
+
+	local -x TEST_TMPDIR="${T%/}/TEST_TMPDIR_${ABI}"
+	mkdir -m 777 "${TEST_TMPDIR}" || die
+
+	setup_test_env() {
+		ln -sr "${S}/src" "${BUILD_DIR}/include" || die
+	}
+
+	multilib_foreach_abi setup_test_env
+
 	cmake-multilib_src_test
 }
 

diff --git a/dev-libs/protobuf/protobuf-9999.ebuild b/dev-libs/protobuf/protobuf-9999.ebuild
index 9988631acc75..30ab416efd86 100644
--- a/dev-libs/protobuf/protobuf-9999.ebuild
+++ b/dev-libs/protobuf/protobuf-9999.ebuild
@@ -3,9 +3,10 @@
 
 EAPI=8
 
-inherit cmake-multilib elisp-common toolchain-funcs multilib
+inherit cmake-multilib elisp-common multilib
 
-ABSEIL_BRANCH="lts_2023_08_02" # NOTE from https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+# NOTE from https://github.com/protocolbuffers/protobuf/blob/main/.gitmodules
+ABSEIL_BRANCH="lts_2023_08_02"
 
 ABSEIL_MIN_VER="${ABSEIL_BRANCH//lts_}"
 ABSEIL_MIN_VER="${ABSEIL_MIN_VER//_/}"
@@ -17,8 +18,8 @@ if [[ "${PV}" == *9999 ]]; then
 
 	inherit git-r3
 else
-	SRC_URI="https://github.com/protocolbuffers/protobuf/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+	SRC_URI="https://github.com/protocolbuffers/protobuf/releases/download/v${PV}/${P}.tar.gz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~x64-macos"
 	MY_SLOT=$(ver_cut 1-2)
 fi
 
@@ -27,7 +28,7 @@ HOMEPAGE="https://protobuf.dev/"
 
 LICENSE="BSD"
 SLOT="0/${MY_SLOT}.0"
-IUSE="conformance emacs examples +libprotoc libupb +protobuf +protoc test zlib"
+IUSE="conformance debug emacs examples +libprotoc libupb +protobuf +protoc test zlib"
 
 REQUIRED_USE="
 	|| (
@@ -48,14 +49,14 @@ BDEPEND="
 "
 
 COMMON_DEPEND="
-	dev-libs/jsoncpp
+	dev-libs/jsoncpp[${MULTILIB_USEDEP}]
 	>=dev-cpp/abseil-cpp-${ABSEIL_MIN_VER}:=[${MULTILIB_USEDEP}]
 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )
 "
 
 DEPEND="
 	${COMMON_DEPEND}
-	test? ( >=dev-cpp/gtest-1.9[${MULTILIB_USEDEP}] )
+	test? ( >=dev-cpp/gtest-1.11[${MULTILIB_USEDEP}] )
 "
 RDEPEND="
 	${COMMON_DEPEND}
@@ -65,22 +66,16 @@ RDEPEND="
 PATCHES=(
 	"${FILESDIR}/${PN}-26.1-disable-32-bit-tests.patch"
 	"${FILESDIR}/${PN}-23.3-static_assert-failure.patch"
+	"${FILESDIR}/${PN}-27.4-findJsonCpp.patch"
+	"${FILESDIR}/${PN}-28.0-disable-test_upb-lto.patch"
 )
 
 DOCS=( CONTRIBUTORS.txt README.md )
 
-# src_prepare() {
-# 	rm "${S}/third_party/utf8_range/" -rf || die
-# 	cmake_src_prepare
-# }
+src_prepare() {
+	cmake_src_prepare
 
-src_configure() {
-	if tc-ld-is-gold; then
-		# https://sourceware.org/bugzilla/show_bug.cgi?id=24527
-		tc-ld-disable-gold
-	fi
-
-	cmake-multilib_src_configure
+	cp "${FILESDIR}/FindJsonCpp.cmake" "${S}/cmake" || die
 }
 
 multilib_src_configure() {
@@ -104,7 +99,8 @@ multilib_src_configure() {
 		-Dprotobuf_TEST_XML_OUTDIR="$(usex test)"
 
 		-Dprotobuf_WITH_ZLIB="$(usex zlib)"
-		-Dprotobuf_VERBOSE="yes"
+		-Dprotobuf_VERBOSE="$(usex debug)"
+		-DCMAKE_MODULE_PATH="${S}/cmake"
 	)
 	use test && mycmakeargs+=( -Dprotobuf_USE_EXTERNAL_GTEST="yes" )
 
@@ -120,7 +116,17 @@ src_compile() {
 }
 
 src_test() {
-	local -x srcdir="${S}"/src
+	local -x srcdir="${S}/src"
+
+	local -x TEST_TMPDIR="${T%/}/TEST_TMPDIR_${ABI}"
+	mkdir -m 777 "${TEST_TMPDIR}" || die
+
+	setup_test_env() {
+		ln -sr "${S}/src" "${BUILD_DIR}/include" || die
+	}
+
+	multilib_foreach_abi setup_test_env
+
 	cmake-multilib_src_test
 }
 


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-09-05  2:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-04 13:53 [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/, dev-libs/protobuf/files/ Mike Gilbert
  -- strict thread matches above, loose matches on Subject: below --
2024-09-05  2:12 Sam James
2024-06-14  8:18 Sam James
2024-05-27 16:04 Joonas Niilola
2024-02-03 19:35 Jason Zaman
2023-06-27 20:14 Andreas Sturmlechner
2021-11-18 22:22 Mike Gilbert
2021-06-06 17:04 Mike Gilbert
2021-06-06 17:04 Mike Gilbert
2020-11-22 19:32 Mike Gilbert
2019-12-29 19:34 Mike Gilbert
2019-12-29 19:34 Mike Gilbert
2019-04-19 16:39 Mike Gilbert
2019-04-19 16:39 Mike Gilbert
2018-07-07  2:03 Mike Gilbert
2018-04-26 15:14 Mike Gilbert
2018-02-21 20:34 Mike Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox