Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/grpc/
Date: Sun, 15 Jul 2018 22:21:05
Message-Id: 1531692804.614b5aaad4f6d6c22ed92b1f99dc83d012f103ae.gyakovlev@gentoo
1 commit: 614b5aaad4f6d6c22ed92b1f99dc83d012f103ae
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 15 22:06:22 2018 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 15 22:13:24 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=614b5aaa
7
8 net-libs/grpc: revbmp 1.12.1, fix huge SOURCES.txt
9
10 Bug: https://bugs.gentoo.org/661244
11 Reported-by: Remy Blank <remy <AT> c-space.org>
12 Package-Manager: Portage-2.3.42, Repoman-2.3.9
13
14 net-libs/grpc/grpc-1.12.1-r1.ebuild | 162 ++++++++++++++++++++++++++++++++++++
15 1 file changed, 162 insertions(+)
16
17 diff --git a/net-libs/grpc/grpc-1.12.1-r1.ebuild b/net-libs/grpc/grpc-1.12.1-r1.ebuild
18 new file mode 100644
19 index 00000000000..6c9403c7626
20 --- /dev/null
21 +++ b/net-libs/grpc/grpc-1.12.1-r1.ebuild
22 @@ -0,0 +1,162 @@
23 +# Copyright 1999-2018 Gentoo Foundation
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=6
27 +
28 +PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
29 +DISTUTILS_OPTIONAL=1
30 +
31 +inherit distutils-r1 flag-o-matic toolchain-funcs
32 +
33 +# should match pinned git submodule version of third_party/protobuf
34 +# look it up here https://github.com/grpc/grpc/tree/v"${PV}"/third_party
35 +PROTOBUF_VERSION="3.5.2"
36 +
37 +DESCRIPTION="Modern open source high performance RPC framework"
38 +HOMEPAGE="http://www.grpc.io"
39 +SRC_URI="
40 + https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
41 + tools? ( https://github.com/google/protobuf/archive/v${PROTOBUF_VERSION}.tar.gz -> protobuf-${PROTOBUF_VERSION}.tar.gz )
42 +"
43 +
44 +LICENSE="Apache-2.0"
45 +SLOT="0"
46 +KEYWORDS="~amd64 ~x86"
47 +IUSE="examples doc python systemtap tools"
48 +
49 +REQUIRED_USE="
50 + python? ( ${PYTHON_REQUIRED_USE} )
51 + tools? ( python )
52 +"
53 +
54 +DEPEND="
55 + >=dev-libs/openssl-1.0.2:0=[-bindist]
56 + >=dev-libs/protobuf-3.5:=
57 + dev-util/google-perftools
58 + net-dns/c-ares:=
59 + sys-libs/zlib:=
60 + python? ( ${PYTHON_DEPS}
61 + dev-python/coverage[${PYTHON_USEDEP}]
62 + dev-python/cython[${PYTHON_USEDEP}]
63 + >=dev-python/protobuf-python-3.5.1:=[${PYTHON_USEDEP}]
64 + dev-python/six[${PYTHON_USEDEP}]
65 + dev-python/wheel[${PYTHON_USEDEP}]
66 + virtual/python-enum34[${PYTHON_USEDEP}]
67 + virtual/python-futures[${PYTHON_USEDEP}]
68 + doc? (
69 + dev-python/sphinx[${PYTHON_USEDEP}]
70 + dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
71 + )
72 + )
73 + systemtap? ( dev-util/systemtap )
74 +"
75 +
76 +RDEPEND="${DEPEND}"
77 +
78 +PATCHES=(
79 + "${FILESDIR}/0001-grpc-1.11.0-Fix-cross-compiling.patch"
80 + "${FILESDIR}/0002-grpc-1.3.0-Fix-unsecure-.pc-files.patch"
81 + "${FILESDIR}/0003-grpc-1.3.0-Don-t-run-ldconfig.patch"
82 + "${FILESDIR}/0004-grpc-1.11.0-fix-cpp-so-version.patch"
83 + "${FILESDIR}/0005-grpc-1.11.0-pkgconfig-libdir.patch"
84 + "${FILESDIR}/0006-grpc-1.12.1-allow-system-openssl.patch"
85 + "${FILESDIR}/0007-grpc-1.12.1-allow-system-zlib.patch"
86 + "${FILESDIR}/0008-grpc-1.12.1-allow-system-cares.patch"
87 + "${FILESDIR}/0009-grpc-1.12.1-gcc8-fixes.patch"
88 +)
89 +
90 +src_prepare() {
91 + sed -i 's@$(prefix)/lib@$(prefix)/$(INSTALL_LIBDIR)@g' Makefile || die "fix libdir"
92 + default
93 + use python && distutils-r1_src_prepare
94 +}
95 +
96 +python_prepare() {
97 + if use tools; then
98 + rm -r third_party/protobuf || die "removing empty protobuf dir failed"
99 + ln -s "${S}"/../protobuf-"${PROTOBUF_VERSION}" third_party/protobuf || die
100 + pushd tools/distrib/python/grpcio_tools >/dev/null || die
101 + # absolute symlinks will fail because out-of-source build
102 + # ./src -> ${S}/src
103 + ln -s ../../../../src ./ || die
104 + # ./third_party -> ${S}/third_party
105 + ln -s ../../../../third_party ./ || die
106 + # ./grpc_root -> ${S}
107 + ln -s ../../../../ ./grpc_root || die
108 + # https://bugs.gentoo.org/661244
109 + echo "prune grpc_root/tools/distrib/python/grpcio_tools" >> MANIFEST.in
110 + popd >/dev/null || die
111 + fi
112 +}
113 +
114 +src_compile() {
115 + tc-export CC CXX PKG_CONFIG
116 + emake \
117 + V=1 \
118 + prefix=/usr \
119 + INSTALL_LIBDIR="$(get_libdir)" \
120 + AR="$(tc-getAR)" \
121 + AROPTS="rcs" \
122 + CFLAGS="${CFLAGS}" \
123 + LD="${CC}" \
124 + LDXX="${CXX}" \
125 + STRIP=true \
126 + HOST_CC="$(tc-getBUILD_CC)" \
127 + HOST_CXX="$(tc-getBUILD_CXX)" \
128 + HOST_LD="$(tc-getBUILD_CC)" \
129 + HOST_LDXX="$(tc-getBUILD_CXX)" \
130 + HOST_AR="$(tc-getBUILD_AR)" \
131 + HAS_SYSTEMTAP="$(usex systemtap true false)"
132 +
133 + use python && distutils-r1_src_compile
134 +}
135 +
136 +python_compile() {
137 + export GRPC_PYTHON_BUILD_SYSTEM_CARES=1
138 + export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
139 + export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1
140 + export GRPC_PYTHON_BUILD_WITH_CYTHON=1
141 + distutils-r1_python_compile
142 +
143 + if use tools; then
144 + pushd tools/distrib/python/grpcio_tools >/dev/null || die
145 + distutils-r1_python_compile
146 + popd >/dev/null || die
147 + fi
148 +}
149 +
150 +python_compile_all() {
151 + if use doc; then
152 + esetup.py doc
153 + mv doc/build doc/html || die
154 + fi
155 +}
156 +
157 +src_install() {
158 + emake \
159 + prefix="${D}"/usr \
160 + INSTALL_LIBDIR="$(get_libdir)" \
161 + STRIP=true \
162 + install
163 +
164 + if use examples; then
165 + docinto examples
166 + dodoc -r examples/.
167 + docompress -x /usr/share/doc/${PF}/examples
168 + fi
169 +
170 + use doc && local DOCS=( AUTHORS README.md doc/. )
171 + einstalldocs
172 +
173 + use python && distutils-r1_src_install
174 +}
175 +
176 +python_install() {
177 + distutils-r1_python_install
178 +
179 + if use tools; then
180 + pushd tools/distrib/python/grpcio_tools >/dev/null || die
181 + distutils-r1_python_install
182 + popd >/dev/null || die
183 + fi
184 +}