summaryrefslogtreecommitdiff
path: root/net-libs/grpc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-06-16 05:02:38 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-06-16 05:02:38 +0100
commitf1bc537f089cc8477a9a18db597cb349e1b00e91 (patch)
treec48eb730c43e5f35729fabbe5cb4bfbe4a1bc794 /net-libs/grpc
parentcb3e8c6af7661fbcafdcacc7e0ecdfb610d098fa (diff)
gentoo resync : 16.06.2018
Diffstat (limited to 'net-libs/grpc')
-rw-r--r--net-libs/grpc/Manifest9
-rw-r--r--net-libs/grpc/files/0006-grpc-1.12.1-allow-system-openssl.patch65
-rw-r--r--net-libs/grpc/files/0007-grpc-1.12.1-allow-system-zlib.patch52
-rw-r--r--net-libs/grpc/files/0008-grpc-1.12.1-allow-system-cares.patch52
-rw-r--r--net-libs/grpc/files/0009-grpc-1.12.1-gcc8-fixes.patch53
-rw-r--r--net-libs/grpc/grpc-1.12.1.ebuild160
-rw-r--r--net-libs/grpc/metadata.xml11
7 files changed, 401 insertions, 1 deletions
diff --git a/net-libs/grpc/Manifest b/net-libs/grpc/Manifest
index 3c6ee14c5929..461abd93b3b6 100644
--- a/net-libs/grpc/Manifest
+++ b/net-libs/grpc/Manifest
@@ -3,6 +3,13 @@ AUX 0002-grpc-1.3.0-Fix-unsecure-.pc-files.patch 1227 BLAKE2B 2791f596cc2e9feb63
AUX 0003-grpc-1.3.0-Don-t-run-ldconfig.patch 1957 BLAKE2B 945ca98ffe0a55bd6e277d3c6d967014d77df8fdf7c708fa275e003df6fda5ce32206069a9a173c41f1d77d8eec38444190bdf15cdd5891142ec5d632bf9af8b SHA512 8e691f56cf6ac348d2516ffe022216fe92132c4266bdc55989238fca37ef3e4cb8c08f261ea41a3c4cd36b5e6dbd20122d75cff77a3924959b5e2e9302a494be
AUX 0004-grpc-1.11.0-fix-cpp-so-version.patch 3700 BLAKE2B 4d198daaff28d5a69b52594fb3d430e7013c15623e4becd1f0fe402a30d48da191b2920b650da5d84a09a16b136049b66678b5a6aad3963bb6bd2d4f2866b900 SHA512 484e535bcf3d18b780e0ae7b3ab82c23cac3d296af215876f73a07b869fad68e484a3de1a006cbdf4ee302582970b47c08aa4a0b34f59442509134316b6b3f82
AUX 0005-grpc-1.11.0-pkgconfig-libdir.patch 2295 BLAKE2B 9e9cfb9f150c30bf55a5443e387c9d0e8f3507fdaba56c2ab5cc318f51959e45bda8e0cee39487d8116b76c15da1a7ca9da1e02a5e29bdbc7edf85d508e5e857 SHA512 4648fceb8a6b8a364126ba20ef2cc2f5b4baddfb4f622de93f377714eff793e05062f5bb02b39e2699b00f3cce309fb23a9ea35a9fef3a1df4e3682bd707e8d5
+AUX 0006-grpc-1.12.1-allow-system-openssl.patch 2691 BLAKE2B 078ff854f90f5dea0b5866f387b6bb6f6582aba95bc262208229434a245a46a5082ad84290cf93901aa2bdee8169df3d4df52c667d5b670ae4df9a5898f1b31a SHA512 4979bb97325bb8f1179362bb3fcffffd922899dbc2eaa69630de4751ad54e0dc5e5f6b96c3a4aa1e267700bdf25d7a8e59fab3c7ae04d4cdd70e0173c1d9dca9
+AUX 0007-grpc-1.12.1-allow-system-zlib.patch 2069 BLAKE2B 60b70714eca54ba0befffd36409dc4cb3983393f478e54dc1922bf7acbbe8122a2a7b76003842952a9d693a04adf84d1f6b7243a7034d181a0084620fdfec587 SHA512 22c4bcd909ad19989e72f8063b7b44f8f63d58119a19a92661734ba2bf0c4150b2e870fae45c4bf8c6411e1ca32e8bf713536c3f60d98763210231a0ac4fedde
+AUX 0008-grpc-1.12.1-allow-system-cares.patch 2049 BLAKE2B 4f7e352f3efca21cbc918bf0a8510589c1f9a3b0ede344c83223cebfced42a65e5e3f2c5bebd1cf88d96dbc4d7f738f94b4484cfd23d5ebb1ff74a3370584d75 SHA512 3efffca62048d89430720237c8b51e82b2d2f02c067849d3a6506013b9c4fbda92037a70e3ff66e117465653ecb2a1db0d00857b6325c768ee1d2b122a44d26a
+AUX 0009-grpc-1.12.1-gcc8-fixes.patch 2420 BLAKE2B 05a0e92f38e877bfc2160d44aec598a67247dbd064efd03cea660444ecb3afe3095e2b7c1c67b2e83423762ad1580636039e27004fe34c8ff0c3bdc9862a3c54 SHA512 dfdafec8efc8fc0f4bbcdcbb036fb7ee746c917c8dfe18338dbd20be40efe8e1b3fe77c6f66f0b050f6d078aaff81a78477980b63ad81288cae474af8c723420
DIST grpc-1.12.0.tar.gz 13692310 BLAKE2B 86b9063416140453718c51df4f238bb3d5ac8549ece065c95d3c461c069358badec5a9a77aef694cd11a09f53e060f9ea51f3b40d9a2424837605c4899a21c57 SHA512 68a8c261ea570790974769d6c0ca8138cf4242b79e9ff74a11b10d35a27f98ff24c03f3d05932ac46811c0ba7d1a094388ae8dbeb495fc8e723ad74695994d49
+DIST grpc-1.12.1.tar.gz 13692045 BLAKE2B d35706b553917d0f27e4474509f361ec7962b738031f11ca814d7ec33429f848b3b3356cae9a28b9a0cb376df5a6348d312c80ed4eeb51b81e68b317584a2e4a SHA512 9dd6d8c4b4e2713cf27ed55b1e97fdf5ed6d80f43b798b83f08e2f4646387dfd0696b21d4f44dbd99a061d388790dc15da49ac5afb0bb06116cfd6f07b7d6962
+DIST protobuf-3.5.2.tar.gz 4584659 BLAKE2B f582212169d802a5844574eb900c9f8cbb343b7e73f2074e5ff0bfc544ebd13f4bc2b78271fb70f4465d78fdc39972ed68339f453c0d3ffe98d8564fbf520544 SHA512 09d10cf0c07a0ba249428bbf20f5dbed840965fa06b3c09682f286a4dee9d84bb96f3b5b50e993d48ef1f20440531255ce7d0e60a648bf3fe536a5f2b0b74181
EBUILD grpc-1.12.0.ebuild 1532 BLAKE2B 1e41ce56b3a191269ba9bece06304399fe8abff72333545d204cf664af140372336111ec8ba5390b6a8e6d671d6e85be5f0845f7d6bbd33d08fab0e3baab254a SHA512 c7600d243d3f36567792fec8810538084b935a83523cb400c8cd26fa185fd48d65b165c9801943d96f3f4567aecbdeefe57f2e794e255a16b2bf39cf17355282
-MISC metadata.xml 327 BLAKE2B e99ce0019fedc9b171e83503cbc1fde434fdc24d9de08ab8b26487391a5ef93ff207a2196c0f9e08b7cffbf4770fc67f1fbaeb886e7f95a02cdc3a67432494d6 SHA512 e8fa242a316ef93660b3b7601e1a6c2bbf356a77f4c0f678c34e299c3cdc051b77a79167a47a81d2a7d2b3b85c9059c3918a02e3df1c63b07c3f3812de47bd63
+EBUILD grpc-1.12.1.ebuild 4150 BLAKE2B 211375c9194684d63812417e4701ce54588237d65350d2d8bc956b5106b352f9ba204ffb174d8e7e8609851b282c816a008aa792e28e067d98a30a31db8f8591 SHA512 8531b6975d0f95dcfd8f1231caa2b6135a1f1ede25ee0ec2156719b3f238adaf9a5301e5cc7832e9b7fe62cc668fc2beb84d28e55ba16a8c4f3d099cf98e25d8
+MISC metadata.xml 640 BLAKE2B 8a1e1cd4e74bd63b3a924a93e69a8c91a0aa712c3383147f7fb688e44d1a4975a402187f052708df0b6128141085973673d2dd1129995ce304c1d8634b88b1d5 SHA512 fce033f1d37fc5f89359256e81353f1a6aac2cf34ed6c9186cf7a2207dc535d0b71f6e8657b4275d229db1cf809c3b9751f78af808c92d1f74c9ad19642538e8
diff --git a/net-libs/grpc/files/0006-grpc-1.12.1-allow-system-openssl.patch b/net-libs/grpc/files/0006-grpc-1.12.1-allow-system-openssl.patch
new file mode 100644
index 000000000000..61fd830d64d4
--- /dev/null
+++ b/net-libs/grpc/files/0006-grpc-1.12.1-allow-system-openssl.patch
@@ -0,0 +1,65 @@
+From 30ce693621d61efb8596503a0da212077a8c4daa Mon Sep 17 00:00:00 2001
+From: Thomas Bechtold <tbechtold@suse.com>
+Date: Thu, 24 May 2018 17:12:13 +0200
+Subject: [PATCH] Allow building the python module with system openssl
+
+When building the python module and using the new
+GRPC_PYTHON_BUILD_SYSTEM_OPENSSL env variable, the third party
+boringssl code is not compiled. Instead, the openssl shared library
+installed on the system is used during runtime.
+This is useful for distributions who don't want to include code copies
+but use shared libraries instead.
+---
+ setup.py | 17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 99d1a1c504e..3a5ed56c641 100644
+--- a/setup.py
++++ b/setup.py
+@@ -35,7 +35,7 @@
+ PY3 = sys.version_info.major == 3
+ PYTHON_STEM = os.path.join('src', 'python', 'grpcio')
+ CORE_INCLUDE = ('include', '.',)
+-BORINGSSL_INCLUDE = (os.path.join('third_party', 'boringssl', 'include'),)
++SSL_INCLUDE = (os.path.join('third_party', 'boringssl', 'include'),)
+ ZLIB_INCLUDE = (os.path.join('third_party', 'zlib'),)
+ CARES_INCLUDE = (
+ os.path.join('third_party', 'cares'),
+@@ -84,6 +84,12 @@
+ # present, then it will still attempt to use Cython.
+ BUILD_WITH_CYTHON = os.environ.get('GRPC_PYTHON_BUILD_WITH_CYTHON', False)
+
++# Export this variable to use the system installation of openssl. You need to
++# have the header files installed (in /usr/include/openssl) and during
++# runtime, the shared libary must be installed
++BUILD_WITH_SYSTEM_OPENSSL = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_OPENSSL',
++ False)
++
+ # Environment variable to determine whether or not to enable coverage analysis
+ # in Cython modules.
+ ENABLE_CYTHON_TRACING = os.environ.get(
+@@ -148,8 +154,13 @@
+ if "win32" in sys.platform:
+ CORE_C_FILES = filter(lambda x: 'third_party/cares' not in x, CORE_C_FILES)
+
++if BUILD_WITH_SYSTEM_OPENSSL:
++ CORE_C_FILES = filter(lambda x: 'third_party/boringssl' not in x, CORE_C_FILES)
++ CORE_C_FILES = filter(lambda x: 'src/boringssl' not in x, CORE_C_FILES)
++ SSL_INCLUDE = (os.path.join('/usr', 'include', 'openssl'),)
++
+ EXTENSION_INCLUDE_DIRECTORIES = (
+- (PYTHON_STEM,) + CORE_INCLUDE + BORINGSSL_INCLUDE + ZLIB_INCLUDE +
++ (PYTHON_STEM,) + CORE_INCLUDE + SSL_INCLUDE + ZLIB_INCLUDE +
+ CARES_INCLUDE + ADDRESS_SORTING_INCLUDE)
+
+ EXTENSION_LIBRARIES = ()
+@@ -159,6 +170,8 @@
+ EXTENSION_LIBRARIES += ('m',)
+ if "win32" in sys.platform:
+ EXTENSION_LIBRARIES += ('advapi32', 'ws2_32',)
++if BUILD_WITH_SYSTEM_OPENSSL:
++ EXTENSION_LIBRARIES += ('ssl', 'crypto',)
+
+ DEFINE_MACROS = (
+ ('OPENSSL_NO_ASM', 1), ('_WIN32_WINNT', 0x600),
diff --git a/net-libs/grpc/files/0007-grpc-1.12.1-allow-system-zlib.patch b/net-libs/grpc/files/0007-grpc-1.12.1-allow-system-zlib.patch
new file mode 100644
index 000000000000..6964642b119d
--- /dev/null
+++ b/net-libs/grpc/files/0007-grpc-1.12.1-allow-system-zlib.patch
@@ -0,0 +1,52 @@
+From 3823d9048102bce79e165584c62a1a5b91810aeb Mon Sep 17 00:00:00 2001
+From: Thomas Bechtold <tbechtold@suse.com>
+Date: Fri, 25 May 2018 06:52:23 +0200
+Subject: [PATCH] Allow building the python module with system zlib
+
+When building the python module and using the new
+GRPC_PYTHON_BUILD_SYSTEM_ZLIB env variable, the third party zlib code
+is not compiled. Instead, the zlib shared library installed on the
+system is used during runtime.
+This is useful for distributions who don't want to include code copies
+but use shared libraries instead.
+---
+ setup.py | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/setup.py b/setup.py
+index 3a5ed56c641..483d3ac1682 100644
+--- a/setup.py
++++ b/setup.py
+@@ -90,6 +90,12 @@
+ BUILD_WITH_SYSTEM_OPENSSL = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_OPENSSL',
+ False)
+
++# Export this variable to use the system installation of zlib. You need to
++# have the header files installed (in /usr/include/) and during
++# runtime, the shared libary must be installed
++BUILD_WITH_SYSTEM_ZLIB = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_ZLIB',
++ False)
++
+ # Environment variable to determine whether or not to enable coverage analysis
+ # in Cython modules.
+ ENABLE_CYTHON_TRACING = os.environ.get(
+@@ -159,6 +165,10 @@
+ CORE_C_FILES = filter(lambda x: 'src/boringssl' not in x, CORE_C_FILES)
+ SSL_INCLUDE = (os.path.join('/usr', 'include', 'openssl'),)
+
++if BUILD_WITH_SYSTEM_ZLIB:
++ CORE_C_FILES = filter(lambda x: 'third_party/zlib' not in x, CORE_C_FILES)
++ ZLIB_INCLUDE = (os.path.join('/usr', 'include'),)
++
+ EXTENSION_INCLUDE_DIRECTORIES = (
+ (PYTHON_STEM,) + CORE_INCLUDE + SSL_INCLUDE + ZLIB_INCLUDE +
+ CARES_INCLUDE + ADDRESS_SORTING_INCLUDE)
+@@ -172,6 +182,8 @@
+ EXTENSION_LIBRARIES += ('advapi32', 'ws2_32',)
+ if BUILD_WITH_SYSTEM_OPENSSL:
+ EXTENSION_LIBRARIES += ('ssl', 'crypto',)
++if BUILD_WITH_SYSTEM_ZLIB:
++ EXTENSION_LIBRARIES += ('z',)
+
+ DEFINE_MACROS = (
+ ('OPENSSL_NO_ASM', 1), ('_WIN32_WINNT', 0x600),
diff --git a/net-libs/grpc/files/0008-grpc-1.12.1-allow-system-cares.patch b/net-libs/grpc/files/0008-grpc-1.12.1-allow-system-cares.patch
new file mode 100644
index 000000000000..c2e20f3994f4
--- /dev/null
+++ b/net-libs/grpc/files/0008-grpc-1.12.1-allow-system-cares.patch
@@ -0,0 +1,52 @@
+From 78a6e04ec1efc2dc839f0329dcff732940e27fd9 Mon Sep 17 00:00:00 2001
+From: Thomas Bechtold <tbechtold@suse.com>
+Date: Fri, 25 May 2018 07:08:05 +0200
+Subject: [PATCH] Allow building the python module with system cares
+
+When building the python module and using the new
+GRPC_PYTHON_BUILD_SYSTEM_CARES env variable, the third party cares code
+is not compiled. Instead, the cares shared library installed on the
+system is used during runtime.
+This is useful for distributions who don't want to include code copies
+but use shared libraries instead.
+---
+ setup.py | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/setup.py b/setup.py
+index 483d3ac1682..43c25aafeb9 100644
+--- a/setup.py
++++ b/setup.py
+@@ -96,6 +96,12 @@
+ BUILD_WITH_SYSTEM_ZLIB = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_ZLIB',
+ False)
+
++# Export this variable to use the system installation of cares. You need to
++# have the header files installed (in /usr/include/) and during
++# runtime, the shared libary must be installed
++BUILD_WITH_SYSTEM_CARES = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_CARES',
++ False)
++
+ # Environment variable to determine whether or not to enable coverage analysis
+ # in Cython modules.
+ ENABLE_CYTHON_TRACING = os.environ.get(
+@@ -169,6 +175,10 @@
+ CORE_C_FILES = filter(lambda x: 'third_party/zlib' not in x, CORE_C_FILES)
+ ZLIB_INCLUDE = (os.path.join('/usr', 'include'),)
+
++if BUILD_WITH_SYSTEM_CARES:
++ CORE_C_FILES = filter(lambda x: 'third_party/cares' not in x, CORE_C_FILES)
++ CARES_INCLUDE = (os.path.join('/usr', 'include'),)
++
+ EXTENSION_INCLUDE_DIRECTORIES = (
+ (PYTHON_STEM,) + CORE_INCLUDE + SSL_INCLUDE + ZLIB_INCLUDE +
+ CARES_INCLUDE + ADDRESS_SORTING_INCLUDE)
+@@ -184,6 +194,8 @@
+ EXTENSION_LIBRARIES += ('ssl', 'crypto',)
+ if BUILD_WITH_SYSTEM_ZLIB:
+ EXTENSION_LIBRARIES += ('z',)
++if BUILD_WITH_SYSTEM_CARES:
++ EXTENSION_LIBRARIES += ('cares',)
+
+ DEFINE_MACROS = (
+ ('OPENSSL_NO_ASM', 1), ('_WIN32_WINNT', 0x600),
diff --git a/net-libs/grpc/files/0009-grpc-1.12.1-gcc8-fixes.patch b/net-libs/grpc/files/0009-grpc-1.12.1-gcc8-fixes.patch
new file mode 100644
index 000000000000..a9168f165e19
--- /dev/null
+++ b/net-libs/grpc/files/0009-grpc-1.12.1-gcc8-fixes.patch
@@ -0,0 +1,53 @@
+--- a/tmp/alts_transport_security.cc.ORIG 2018-04-13 20:08:11.000000000 +0200
++++ b/src/core/tsi/alts_transport_security.cc 2018-05-20 16:54:49.995787548 +0200
+@@ -45,7 +45,7 @@
+ }
+
+ void grpc_tsi_alts_init() {
+- memset(&g_alts_resource, 0, sizeof(alts_shared_resource));
++ memset((void*)&g_alts_resource, 0, sizeof(alts_shared_resource));
+ gpr_mu_init(&g_alts_resource.mu);
+ gpr_cv_init(&g_alts_resource.cv);
+ }
+--- a/tmp/client_channel.cc.ORIG 2018-04-13 20:08:11.000000000 +0200
++++ b/src/core/ext/filters/client_channel/client_channel.cc 2018-05-20 17:07:20.604746186 +0200
+@@ -416,7 +416,7 @@
+ grpc_uri* uri = grpc_uri_parse(server_uri, true);
+ GPR_ASSERT(uri->path[0] != '\0');
+ service_config_parsing_state parsing_state;
+- memset(&parsing_state, 0, sizeof(parsing_state));
++ memset((void*)&parsing_state, 0, sizeof(parsing_state));
+ parsing_state.server_name =
+ uri->path[0] == '/' ? uri->path + 1 : uri->path;
+ service_config->ParseGlobalParams(parse_retry_throttle_params,
+--- a/tmp/channel.cc.ORIG 2018-04-13 20:08:11.000000000 +0200
++++ b/src/core/lib/surface/channel.cc 2018-05-20 16:58:01.632776988 +0200
+@@ -103,7 +103,7 @@
+ return channel;
+ }
+
+- memset(channel, 0, sizeof(*channel));
++ memset((void*)channel, 0, sizeof(*channel));
+ channel->target = target;
+ channel->is_client = grpc_channel_stack_type_is_client(channel_stack_type);
+ size_t channel_tracer_max_nodes = 0; // default to off
+@@ -280,7 +280,7 @@
+ }
+
+ grpc_call_create_args args;
+- memset(&args, 0, sizeof(args));
++ memset((void*)&args, 0, sizeof(args));
+ args.channel = channel;
+ args.parent = parent_call;
+ args.propagation_mask = propagation_mask;
+--- a/tmp/flow_control.cc.ORIG 2018-04-13 20:08:11.000000000 +0200
++++ b/src/core/ext/transport/chttp2/transport/flow_control.cc 2018-05-20 17:09:47.055738116 +0200
+@@ -187,7 +187,7 @@
+ uint32_t TransportFlowControl::MaybeSendUpdate(bool writing_anyway) {
+ FlowControlTrace trace("t updt sent", this, nullptr);
+ const uint32_t target_announced_window =
+- static_cast<const uint32_t>(target_window());
++ static_cast<uint32_t>(target_window());
+ if ((writing_anyway || announced_window_ <= target_announced_window / 2) &&
+ announced_window_ != target_announced_window) {
+ const uint32_t announce = static_cast<uint32_t> GPR_CLAMP(
diff --git a/net-libs/grpc/grpc-1.12.1.ebuild b/net-libs/grpc/grpc-1.12.1.ebuild
new file mode 100644
index 000000000000..e57c672f4837
--- /dev/null
+++ b/net-libs/grpc/grpc-1.12.1.ebuild
@@ -0,0 +1,160 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+DISTUTILS_OPTIONAL=1
+
+inherit distutils-r1 flag-o-matic toolchain-funcs
+
+# should match pinned git submodule version of third_party/protobuf
+# look it up here https://github.com/grpc/grpc/tree/v"${PV}"/third_party
+PROTOBUF_VERSION="3.5.2"
+
+DESCRIPTION="Modern open source high performance RPC framework"
+HOMEPAGE="http://www.grpc.io"
+SRC_URI="
+ https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ tools? ( https://github.com/google/protobuf/archive/v${PROTOBUF_VERSION}.tar.gz -> protobuf-${PROTOBUF_VERSION}.tar.gz )
+"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples doc python systemtap tools"
+
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ tools? ( python )
+"
+
+DEPEND="
+ >=dev-libs/openssl-1.0.2:0=[-bindist]
+ >=dev-libs/protobuf-3.5:=
+ dev-util/google-perftools
+ net-dns/c-ares:=
+ sys-libs/zlib:=
+ python? ( ${PYTHON_DEPS}
+ dev-python/coverage[${PYTHON_USEDEP}]
+ dev-python/cython[${PYTHON_USEDEP}]
+ >=dev-python/protobuf-python-3.5.1:=[${PYTHON_USEDEP}]
+ dev-python/six[${PYTHON_USEDEP}]
+ dev-python/wheel[${PYTHON_USEDEP}]
+ virtual/python-enum34[${PYTHON_USEDEP}]
+ virtual/python-futures[${PYTHON_USEDEP}]
+ doc? (
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
+ )
+ )
+ systemtap? ( dev-util/systemtap )
+"
+
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/0001-grpc-1.11.0-Fix-cross-compiling.patch"
+ "${FILESDIR}/0002-grpc-1.3.0-Fix-unsecure-.pc-files.patch"
+ "${FILESDIR}/0003-grpc-1.3.0-Don-t-run-ldconfig.patch"
+ "${FILESDIR}/0004-grpc-1.11.0-fix-cpp-so-version.patch"
+ "${FILESDIR}/0005-grpc-1.11.0-pkgconfig-libdir.patch"
+ "${FILESDIR}/0006-grpc-1.12.1-allow-system-openssl.patch"
+ "${FILESDIR}/0007-grpc-1.12.1-allow-system-zlib.patch"
+ "${FILESDIR}/0008-grpc-1.12.1-allow-system-cares.patch"
+ "${FILESDIR}/0009-grpc-1.12.1-gcc8-fixes.patch"
+)
+
+src_prepare() {
+ sed -i 's@$(prefix)/lib@$(prefix)/$(INSTALL_LIBDIR)@g' Makefile || die "fix libdir"
+ default
+ use python && distutils-r1_src_prepare
+}
+
+python_prepare() {
+ if use tools; then
+ rm -r third_party/protobuf || die "removing empty protobuf dir failed"
+ ln -s "${S}"/../protobuf-"${PROTOBUF_VERSION}" third_party/protobuf || die
+ pushd tools/distrib/python/grpcio_tools >/dev/null || die
+ # absolute symlinks will fail because out-of-source build
+ # ./src -> ${S}/src
+ ln -s ../../../../src ./ || die
+ # ./third_party -> ${S}/third_party
+ ln -s ../../../../third_party ./ || die
+ # ./grpc_root -> ${S}
+ ln -s ../../../../ ./grpc_root || die
+ popd >/dev/null || die
+ fi
+}
+
+src_compile() {
+ tc-export CC CXX PKG_CONFIG
+ emake \
+ V=1 \
+ prefix=/usr \
+ INSTALL_LIBDIR="$(get_libdir)" \
+ AR="$(tc-getAR)" \
+ AROPTS="rcs" \
+ CFLAGS="${CFLAGS}" \
+ LD="${CC}" \
+ LDXX="${CXX}" \
+ STRIP=true \
+ HOST_CC="$(tc-getBUILD_CC)" \
+ HOST_CXX="$(tc-getBUILD_CXX)" \
+ HOST_LD="$(tc-getBUILD_CC)" \
+ HOST_LDXX="$(tc-getBUILD_CXX)" \
+ HOST_AR="$(tc-getBUILD_AR)" \
+ HAS_SYSTEMTAP="$(usex systemtap true false)"
+
+ use python && distutils-r1_src_compile
+}
+
+python_compile() {
+ export GRPC_PYTHON_BUILD_SYSTEM_CARES=1
+ export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
+ export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1
+ export GRPC_PYTHON_BUILD_WITH_CYTHON=1
+ distutils-r1_python_compile
+
+ if use tools; then
+ pushd tools/distrib/python/grpcio_tools >/dev/null || die
+ distutils-r1_python_compile
+ popd >/dev/null || die
+ fi
+}
+
+python_compile_all() {
+ if use doc; then
+ esetup.py doc
+ mv doc/build doc/html || die
+ fi
+}
+
+src_install() {
+ emake \
+ prefix="${D}"/usr \
+ INSTALL_LIBDIR="$(get_libdir)" \
+ STRIP=true \
+ install
+
+ if use examples; then
+ docinto examples
+ dodoc -r examples/.
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+
+ use doc && local DOCS=( AUTHORS README.md doc/. )
+ einstalldocs
+
+ use python && distutils-r1_src_install
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ if use tools; then
+ pushd tools/distrib/python/grpcio_tools >/dev/null || die
+ distutils-r1_python_install
+ popd >/dev/null || die
+ fi
+}
diff --git a/net-libs/grpc/metadata.xml b/net-libs/grpc/metadata.xml
index 13bfd9fea3dc..ccdf17cc01ec 100644
--- a/net-libs/grpc/metadata.xml
+++ b/net-libs/grpc/metadata.xml
@@ -4,7 +4,18 @@
<maintainer type="person">
<email>perfinion@gentoo.org</email>
</maintainer>
+ <maintainer type="person">
+ <email>ya@sysdump.net</email>
+ <name>Georgy Yakovlev</name>
+ </maintainer>
<longdescription lang="en">
A high performance, open-source universal RPC framework
</longdescription>
+ <use>
+ <flag name="systemtap">Enable SystemTAP/DTrace tracing</flag>
+ <flag name="tools">Install gRPC python tools</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">grpc/grpc</remote-id>
+ </upstream>
</pkgmetadata>