summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen, Chih-Chia <pigfoot@gmail.com>2018-06-05 22:01:10 +0800
committerChen, Chih-Chia <pigfoot@gmail.com>2018-06-05 22:01:10 +0800
commit7fd2ec4ba78e5b1c572a3e4c2be3e159d762af02 (patch)
tree76abf105a5ae51c8e535f71694c6022fabc7bcd7
parent[app-admin/metricbeat] add for fields.yaml (diff)
downloadpigfoot-7fd2ec4ba78e5b1c572a3e4c2be3e159d762af02.tar.gz
pigfoot-7fd2ec4ba78e5b1c572a3e4c2be3e159d762af02.tar.bz2
pigfoot-7fd2ec4ba78e5b1c572a3e4c2be3e159d762af02.zip
Add net-libs/grpc (libressl)
-rw-r--r--net-libs/grpc/Manifest1
-rw-r--r--net-libs/grpc/files/0001-grpc-1.11.0-Fix-cross-compiling.patch58
-rw-r--r--net-libs/grpc/files/0002-grpc-1.3.0-Fix-unsecure-.pc-files.patch38
-rw-r--r--net-libs/grpc/files/0003-grpc-1.3.0-Don-t-run-ldconfig.patch53
-rw-r--r--net-libs/grpc/files/0004-grpc-1.11.0-fix-cpp-so-version.patch49
-rw-r--r--net-libs/grpc/files/0005-grpc-1.11.0-pkgconfig-libdir.patch17
-rw-r--r--net-libs/grpc/files/0006-grpc-1.12.0-fix-libressl.patch42
-rw-r--r--net-libs/grpc/grpc-1.12.0.ebuild68
8 files changed, 326 insertions, 0 deletions
diff --git a/net-libs/grpc/Manifest b/net-libs/grpc/Manifest
new file mode 100644
index 0000000..99b7d82
--- /dev/null
+++ b/net-libs/grpc/Manifest
@@ -0,0 +1 @@
+DIST grpc-1.12.0.tar.gz 13692310 BLAKE2B 86b9063416140453718c51df4f238bb3d5ac8549ece065c95d3c461c069358badec5a9a77aef694cd11a09f53e060f9ea51f3b40d9a2424837605c4899a21c57 SHA512 68a8c261ea570790974769d6c0ca8138cf4242b79e9ff74a11b10d35a27f98ff24c03f3d05932ac46811c0ba7d1a094388ae8dbeb495fc8e723ad74695994d49
diff --git a/net-libs/grpc/files/0001-grpc-1.11.0-Fix-cross-compiling.patch b/net-libs/grpc/files/0001-grpc-1.11.0-Fix-cross-compiling.patch
new file mode 100644
index 0000000..6c47677
--- /dev/null
+++ b/net-libs/grpc/files/0001-grpc-1.11.0-Fix-cross-compiling.patch
@@ -0,0 +1,58 @@
+From b9e631dad111f725c1a4e8b69ff1960397a5cc22 Mon Sep 17 00:00:00 2001
+From: Chirantan Ekbote <chirantan@google.com>
+Date: Mon, 10 Jul 2017 13:19:35 -0700
+Subject: [PATCH 2/5] grpc-1.3.0: Fix cross-compiling
+
+Cross-compiling was severely broken in the Makefile. Fix it.
+
+Sent upstream as https://github.com/grpc/grpc/pull/11476.
+---
+ Makefile | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 95de4f6530..4f0680e1d2 100644
+--- a/Makefile
++++ b/Makefile
+@@ -329,6 +329,7 @@ HOST_CC ?= $(CC)
+ HOST_CXX ?= $(CXX)
+ HOST_LD ?= $(LD)
+ HOST_LDXX ?= $(LDXX)
++HOST_AR ?= $(AR)
+
+ CFLAGS += -std=c99 -Wsign-conversion -Wconversion $(W_SHADOW) $(W_EXTRA_SEMI)
+ ifeq ($(HAS_CXX11),true)
+@@ -438,11 +439,12 @@ LDFLAGS += $(EXTRA_LDFLAGS)
+ DEFINES += $(EXTRA_DEFINES)
+ LDLIBS += $(EXTRA_LDLIBS)
+
+-HOST_CPPFLAGS = $(CPPFLAGS)
+-HOST_CFLAGS = $(CFLAGS)
+-HOST_CXXFLAGS = $(CXXFLAGS)
+-HOST_LDFLAGS = $(LDFLAGS)
+-HOST_LDLIBS = $(LDLIBS)
++HOST_CPPFLAGS = $(CPPFLAGS_NO_ARCH) -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -fPIC
++HOST_CFLAGS = -std=c99 -Wsign-conversion -Wconversion $(W_SHADOW) $(W_EXTRA_SEMI)
++HOST_CXXFLAGS = -std=c++11
++HOST_LDFLAGS = -g -fPIC -Llibs/$(CONFIG)
++HOST_LDLIBS = -lprotoc
++HOST_AROPTS = $(AROPTS)
+
+ # These are automatically computed variables.
+ # There shouldn't be any need to change anything from now on.
+@@ -6838,10 +6840,10 @@ $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a: protobuf_dep_error
+ else
+
+ $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a: $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP) $(PROTOBUF_DEP) $(LIBGRPC_PLUGIN_SUPPORT_OBJS)
+- $(E) "[AR] Creating $@"
++ $(E) "[HOSTAR] Creating $@"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a
+- $(Q) $(AR) $(AROPTS) $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a $(LIBGRPC_PLUGIN_SUPPORT_OBJS)
++ $(Q) $(HOST_AR) $(HOST_AROPTS) $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a $(LIBGRPC_PLUGIN_SUPPORT_OBJS)
+ ifeq ($(SYSTEM),Darwin)
+ $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a
+ endif
+--
+2.14.0.rc0.284.gd933b75aa4-goog
+
diff --git a/net-libs/grpc/files/0002-grpc-1.3.0-Fix-unsecure-.pc-files.patch b/net-libs/grpc/files/0002-grpc-1.3.0-Fix-unsecure-.pc-files.patch
new file mode 100644
index 0000000..e6bde13
--- /dev/null
+++ b/net-libs/grpc/files/0002-grpc-1.3.0-Fix-unsecure-.pc-files.patch
@@ -0,0 +1,38 @@
+From bc139f5b7ce6a2a6d7c67480a04e029955aec0ab Mon Sep 17 00:00:00 2001
+From: Chirantan Ekbote <chirantan@google.com>
+Date: Mon, 10 Jul 2017 13:21:27 -0700
+Subject: [PATCH 3/5] grpc-1.3.0: Fix unsecure .pc files
+
+The *_unsecure.pc files were still linking against the secure versions
+of the grpc libraries. Fix them to link against the unsecure versions.
+
+Sent upstream as https://github.com/grpc/grpc/pull/11448.
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 4f0680e1d2..86bd66a5e0 100644
+--- a/Makefile
++++ b/Makefile
+@@ -778,7 +778,7 @@ PC_DESCRIPTION = high performance general RPC framework without SSL
+ PC_CFLAGS =
+ PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC)
+ PC_LIBS_PRIVATE = $(PC_LIBS_GRPC)
+-PC_LIB = -lgrpc
++PC_LIB = -lgrpc_unsecure
+ GRPC_UNSECURE_PC_FILE := $(CORE_PC_TEMPLATE)
+
+ PROTOBUF_PKG_CONFIG = false
+@@ -849,7 +849,7 @@ PC_DESCRIPTION = C++ wrapper for gRPC without SSL
+ PC_CFLAGS =
+ PC_REQUIRES_PRIVATE = grpc_unsecure $(PC_REQUIRES_GRPCXX)
+ PC_LIBS_PRIVATE = $(PC_LIBS_GRPCXX)
+-PC_LIB = -lgrpc++
++PC_LIB = -lgrpc++_unsecure
+ GRPCXX_UNSECURE_PC_FILE := $(CPP_PC_TEMPLATE)
+
+ ifeq ($(MAKECMDGOALS),clean)
+--
+2.14.0.rc0.284.gd933b75aa4-goog
+
diff --git a/net-libs/grpc/files/0003-grpc-1.3.0-Don-t-run-ldconfig.patch b/net-libs/grpc/files/0003-grpc-1.3.0-Don-t-run-ldconfig.patch
new file mode 100644
index 0000000..d18063f
--- /dev/null
+++ b/net-libs/grpc/files/0003-grpc-1.3.0-Don-t-run-ldconfig.patch
@@ -0,0 +1,53 @@
+From 40f602c0beeb09197507d280b150174e09300d7f Mon Sep 17 00:00:00 2001
+From: Chirantan Ekbote <chirantan@google.com>
+Date: Mon, 10 Jul 2017 13:26:04 -0700
+Subject: [PATCH 5/5] grpc-1.3.0: Don't run ldconfig
+
+It doesn't make sense to run ldconfig for a staged install. Remove it.
+---
+ Makefile | 15 ---------------
+ 1 file changed, 15 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 86bd66a5e0..f4c2a5bcb9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -2582,11 +2582,6 @@ else ifneq ($(SYSTEM),Darwin)
+ $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/$(INSTALL_LIBDIR)/libgrpc_unsecure.so.3
+ $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/$(INSTALL_LIBDIR)/libgrpc_unsecure.so
+ endif
+-ifneq ($(SYSTEM),MINGW32)
+-ifneq ($(SYSTEM),Darwin)
+- $(Q) ldconfig || true
+-endif
+-endif
+
+
+ install-shared_cxx: shared_cxx strip-shared_cxx install-shared_c install-pkg-config_cxx
+@@ -2635,11 +2630,6 @@ else ifneq ($(SYSTEM),Darwin)
+ $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_unsecure.so.1
+ $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_unsecure.so
+ endif
+-ifneq ($(SYSTEM),MINGW32)
+-ifneq ($(SYSTEM),Darwin)
+- $(Q) ldconfig || true
+-endif
+-endif
+
+
+ install-shared_csharp: shared_csharp strip-shared_csharp
+@@ -2652,11 +2642,6 @@ else ifneq ($(SYSTEM),Darwin)
+ $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc_csharp_ext.so.1
+ $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc_csharp_ext.so
+ endif
+-ifneq ($(SYSTEM),MINGW32)
+-ifneq ($(SYSTEM),Darwin)
+- $(Q) ldconfig || true
+-endif
+-endif
+
+
+ install-plugins: $(PROTOC_PLUGINS)
+--
+2.14.0.rc0.284.gd933b75aa4-goog
+
diff --git a/net-libs/grpc/files/0004-grpc-1.11.0-fix-cpp-so-version.patch b/net-libs/grpc/files/0004-grpc-1.11.0-fix-cpp-so-version.patch
new file mode 100644
index 0000000..4655202
--- /dev/null
+++ b/net-libs/grpc/files/0004-grpc-1.11.0-fix-cpp-so-version.patch
@@ -0,0 +1,49 @@
+It creates the symlinks with the wrong versions
+
+--- a/Makefile.orig 2018-05-02 14:19:10.007775576 +0800
++++ b/Makefile 2018-05-02 14:20:59.414089065 +0800
+@@ -2928,7 +2928,7 @@
+ ifeq ($(SYSTEM),MINGW32)
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP)-dll.a $(prefix)/$(INSTALL_LIBDIR)/libgrpc++.a
+ else ifneq ($(SYSTEM),Darwin)
+- $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++.so.6
++ $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++.so.1
+ $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++.so
+ endif
+ $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
+@@ -2937,7 +2937,7 @@
+ ifeq ($(SYSTEM),MINGW32)
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP)-dll.a $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_cronet.a
+ else ifneq ($(SYSTEM),Darwin)
+- $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_cronet.so.6
++ $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_cronet.so.1
+ $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_cronet.so
+ endif
+ $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
+@@ -2946,7 +2946,7 @@
+ ifeq ($(SYSTEM),MINGW32)
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details$(SHARED_VERSION_CPP)-dll.a $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_error_details.a
+ else ifneq ($(SYSTEM),Darwin)
+- $(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_error_details.so.6
++ $(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_error_details.so.1
+ $(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_error_details.so
+ endif
+ $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
+@@ -2955,7 +2955,7 @@
+ ifeq ($(SYSTEM),MINGW32)
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP)-dll.a $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_reflection.a
+ else ifneq ($(SYSTEM),Darwin)
+- $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_reflection.so.6
++ $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_reflection.so.1
+ $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_reflection.so
+ endif
+ $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
+@@ -2964,7 +2964,7 @@
+ ifeq ($(SYSTEM),MINGW32)
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP)-dll.a $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_unsecure.a
+ else ifneq ($(SYSTEM),Darwin)
+- $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_unsecure.so.6
++ $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_unsecure.so.1
+ $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/$(INSTALL_LIBDIR)/libgrpc++_unsecure.so
+ endif
+ ifneq ($(SYSTEM),MINGW32)
diff --git a/net-libs/grpc/files/0005-grpc-1.11.0-pkgconfig-libdir.patch b/net-libs/grpc/files/0005-grpc-1.11.0-pkgconfig-libdir.patch
new file mode 100644
index 0000000..257bef8
--- /dev/null
+++ b/net-libs/grpc/files/0005-grpc-1.11.0-pkgconfig-libdir.patch
@@ -0,0 +1,17 @@
+--- a/Makefile 2018-05-28 17:59:34.631540261 +0800
++++ b/Makefile 2018-05-28 18:01:31.266936000 +0800
+@@ -460,11 +460,11 @@
+ CACHE_MK += HAS_PKG_CONFIG = true,
+ endif
+
+-CORE_PC_TEMPLATE = prefix=$(prefix),exec_prefix=\$${prefix},includedir=\$${prefix}/include,libdir=\$${exec_prefix}/lib,,Name: $(PC_NAME),Description: $(PC_DESCRIPTION),Version: $(CORE_VERSION),Cflags: -I\$${includedir} $(PC_CFLAGS),Requires.private: $(PC_REQUIRES_PRIVATE),Libs: -L\$${libdir} $(PC_LIB),Libs.private: $(PC_LIBS_PRIVATE)
++CORE_PC_TEMPLATE = prefix=$(prefix),exec_prefix=\$${prefix},includedir=\$${prefix}/include,libdir=\$${exec_prefix}/$(INSTALL_LIBDIR),,Name: $(PC_NAME),Description: $(PC_DESCRIPTION),Version: $(CORE_VERSION),Cflags: -I\$${includedir} $(PC_CFLAGS),Requires.private: $(PC_REQUIRES_PRIVATE),Libs: -L\$${libdir} $(PC_LIB),Libs.private: $(PC_LIBS_PRIVATE)
+
+-CPP_PC_TEMPLATE = prefix=$(prefix),exec_prefix=\$${prefix},includedir=\$${prefix}/include,libdir=\$${exec_prefix}/lib,,Name: $(PC_NAME),Description: $(PC_DESCRIPTION),Version: $(CPP_VERSION),Cflags: -I\$${includedir} $(PC_CFLAGS),Requires.private: $(PC_REQUIRES_PRIVATE),Libs: -L\$${libdir} $(PC_LIB),Libs.private: $(PC_LIBS_PRIVATE)
++CPP_PC_TEMPLATE = prefix=$(prefix),exec_prefix=\$${prefix},includedir=\$${prefix}/include,libdir=\$${exec_prefix}/$(INSTALL_LIBDIR),,Name: $(PC_NAME),Description: $(PC_DESCRIPTION),Version: $(CPP_VERSION),Cflags: -I\$${includedir} $(PC_CFLAGS),Requires.private: $(PC_REQUIRES_PRIVATE),Libs: -L\$${libdir} $(PC_LIB),Libs.private: $(PC_LIBS_PRIVATE)
+
+-CSHARP_PC_TEMPLATE = prefix=$(prefix),exec_prefix=\$${prefix},includedir=\$${prefix}/include,libdir=\$${exec_prefix}/lib,,Name: $(PC_NAME),Description: $(PC_DESCRIPTION),Version: $(CSHARP_VERSION),Cflags: -I\$${includedir} $(PC_CFLAGS),Requires.private: $(PC_REQUIRES_PRIVATE),Libs: -L\$${libdir} $(PC_LIB),Libs.private: $(PC_LIBS_PRIVATE)
++CSHARP_PC_TEMPLATE = prefix=$(prefix),exec_prefix=\$${prefix},includedir=\$${prefix}/include,libdir=\$${exec_prefix}/$(INSTALL_LIBDIR),,Name: $(PC_NAME),Description: $(PC_DESCRIPTION),Version: $(CSHARP_VERSION),Cflags: -I\$${includedir} $(PC_CFLAGS),Requires.private: $(PC_REQUIRES_PRIVATE),Libs: -L\$${libdir} $(PC_LIB),Libs.private: $(PC_LIBS_PRIVATE)
+
+ ifeq ($(SYSTEM),MINGW32)
+ EXECUTABLE_SUFFIX = .exe
diff --git a/net-libs/grpc/files/0006-grpc-1.12.0-fix-libressl.patch b/net-libs/grpc/files/0006-grpc-1.12.0-fix-libressl.patch
new file mode 100644
index 0000000..2aebdd3
--- /dev/null
+++ b/net-libs/grpc/files/0006-grpc-1.12.0-fix-libressl.patch
@@ -0,0 +1,42 @@
+--- a/src/core/lib/security/credentials/jwt/jwt_verifier.cc 2018-06-05 18:57:19.799620042 +0800
++++ b/src/core/lib/security/credentials/jwt/jwt_verifier.cc 2018-06-05 18:59:01.698618424 +0800
+@@ -466,7 +466,7 @@
+ return result;
+ }
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ // Provide compatibility across OpenSSL 1.02 and 1.1.
+ static int RSA_set0_key(RSA* r, BIGNUM* n, BIGNUM* e, BIGNUM* d) {
+@@ -493,7 +493,7 @@
+
+ return 1;
+ }
+-#endif // OPENSSL_VERSION_NUMBER < 0x10100000L
++#endif // OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ static EVP_PKEY* pkey_from_jwk(const grpc_json* json, const char* kty) {
+ const grpc_json* key_prop;
+--- a/src/core/tsi/alts/crypt/aes_gcm.cc 2018-06-05 19:28:32.374964917 +0800
++++ b/src/core/tsi/alts/crypt/aes_gcm.cc 2018-06-05 19:29:07.118032548 +0800
+@@ -185,7 +185,7 @@
+ const uint8_t* kdf_counter) {
+ unsigned char buf[EVP_MAX_MD_SIZE];
+ unsigned char ctr = 1;
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ HMAC_CTX hmac;
+ HMAC_CTX_init(&hmac);
+ if (!HMAC_Init_ex(&hmac, kdf_key, kKdfKeyLen, EVP_sha256(), nullptr) ||
+--- a/src/core/tsi/ssl_transport_security.cc 2018-06-05 19:52:50.683704915 +0800
+ tsi_ssl_client_handshaker_factory** factory) {
+@@ -1547,7 +1560,7 @@
+ options->cipher_suites);
+ if (result != TSI_OK) break;
+
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000
++#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
+ // X509_STORE_up_ref is only available since OpenSSL 1.1.
+ if (options->root_store != nullptr) {
+ X509_STORE_up_ref(options->root_store->store);
diff --git a/net-libs/grpc/grpc-1.12.0.ebuild b/net-libs/grpc/grpc-1.12.0.ebuild
new file mode 100644
index 0000000..a541867
--- /dev/null
+++ b/net-libs/grpc/grpc-1.12.0.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{5,6} )
+inherit python-r1 toolchain-funcs multilib flag-o-matic
+
+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"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="libressl"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ !libressl? ( >=dev-libs/openssl-1.0.2:0=[-bindist] )
+ libressl? ( dev-libs/libressl )
+ >=dev-libs/protobuf-3:=
+ net-dns/c-ares:=
+ sys-libs/zlib:="
+
+DEPEND="${RDEPEND}"
+
+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.0-fix-libressl.patch"
+)
+
+src_prepare() {
+ sed -i 's@$(prefix)/lib@$(prefix)/$(INSTALL_LIBDIR)@g' Makefile || die "fix libdir"
+ default
+}
+
+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)"
+}
+
+src_install() {
+ emake \
+ prefix="${D}"/usr \
+ INSTALL_LIBDIR="$(get_libdir)" \
+ STRIP=true \
+ install
+}