1 |
commit: c3028549bd420c751fed6e530e9f740445a9f7ba |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jul 15 22:03:36 2018 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 15 22:11:59 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3028549 |
7 |
|
8 |
net-libs/grpc: revbmp 1.13.0, 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.13.0-r1.ebuild | 173 ++++++++++++++++++++++++++++++++++++ |
15 |
1 file changed, 173 insertions(+) |
16 |
|
17 |
diff --git a/net-libs/grpc/grpc-1.13.0-r1.ebuild b/net-libs/grpc/grpc-1.13.0-r1.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000000..b3f51b4ee14 |
20 |
--- /dev/null |
21 |
+++ b/net-libs/grpc/grpc-1.13.0-r1.ebuild |
22 |
@@ -0,0 +1,173 @@ |
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 |
+# also should ~depend on same version of dev-libs/protobuf below |
36 |
+PROTOBUF_VERSION="3.5.2" |
37 |
+ |
38 |
+DESCRIPTION="Modern open source high performance RPC framework" |
39 |
+HOMEPAGE="http://www.grpc.io" |
40 |
+SRC_URI=" |
41 |
+ https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz |
42 |
+ tools? ( https://github.com/google/protobuf/archive/v${PROTOBUF_VERSION}.tar.gz -> protobuf-${PROTOBUF_VERSION}.tar.gz ) |
43 |
+" |
44 |
+ |
45 |
+LICENSE="Apache-2.0" |
46 |
+SLOT="0" |
47 |
+KEYWORDS="~amd64 ~x86" |
48 |
+IUSE="examples doc python systemtap static-libs tools" |
49 |
+ |
50 |
+REQUIRED_USE=" |
51 |
+ python? ( ${PYTHON_REQUIRED_USE} ) |
52 |
+ tools? ( python ) |
53 |
+" |
54 |
+ |
55 |
+RDEPEND=" |
56 |
+ >=dev-libs/openssl-1.0.2:0=[-bindist] |
57 |
+ >=dev-libs/protobuf-${PROTOBUF_VERSION}:= |
58 |
+ dev-util/google-perftools |
59 |
+ net-dns/c-ares:= |
60 |
+ sys-libs/zlib:= |
61 |
+ python? ( ${PYTHON_DEPS} |
62 |
+ dev-python/coverage[${PYTHON_USEDEP}] |
63 |
+ dev-python/cython[${PYTHON_USEDEP}] |
64 |
+ >=dev-python/protobuf-python-3.5.1:=[${PYTHON_USEDEP}] |
65 |
+ dev-python/six[${PYTHON_USEDEP}] |
66 |
+ dev-python/wheel[${PYTHON_USEDEP}] |
67 |
+ virtual/python-enum34[${PYTHON_USEDEP}] |
68 |
+ virtual/python-futures[${PYTHON_USEDEP}] |
69 |
+ ) |
70 |
+ systemtap? ( dev-util/systemtap ) |
71 |
+" |
72 |
+ |
73 |
+DEPEND="${RDEPEND} |
74 |
+ virtual/pkgconfig |
75 |
+ doc? ( |
76 |
+ python? ( |
77 |
+ dev-python/sphinx[${PYTHON_USEDEP}] |
78 |
+ dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}] |
79 |
+ ) |
80 |
+ ) |
81 |
+" |
82 |
+ |
83 |
+PATCHES=( |
84 |
+ "${FILESDIR}/0001-grpc-1.13.0-fix-host-ar-handling.patch" |
85 |
+ "${FILESDIR}/0002-grpc-1.3.0-Fix-unsecure-.pc-files.patch" |
86 |
+ "${FILESDIR}/0003-grpc-1.3.0-Don-t-run-ldconfig.patch" |
87 |
+ "${FILESDIR}/0004-grpc-1.11.0-fix-cpp-so-version.patch" |
88 |
+ "${FILESDIR}/0005-grpc-1.11.0-pkgconfig-libdir.patch" |
89 |
+ "${FILESDIR}/0009-grpc-1.12.1-gcc8-fixes.patch" |
90 |
+) |
91 |
+ |
92 |
+src_prepare() { |
93 |
+ sed -i 's@$(prefix)/lib@$(prefix)/$(INSTALL_LIBDIR)@g' Makefile || die "fix libdir" |
94 |
+ default |
95 |
+ use python && distutils-r1_src_prepare |
96 |
+} |
97 |
+ |
98 |
+python_prepare() { |
99 |
+ if use tools; then |
100 |
+ rm -r third_party/protobuf || die "removing empty protobuf dir failed" |
101 |
+ ln -s "${S}"/../protobuf-"${PROTOBUF_VERSION}" third_party/protobuf || die |
102 |
+ pushd tools/distrib/python/grpcio_tools >/dev/null || die |
103 |
+ # absolute symlinks will fail |
104 |
+ # ./src -> ${S}/src |
105 |
+ ln -s ../../../../src ./ || die |
106 |
+ # ./third_party -> ${S}/third_party |
107 |
+ ln -s ../../../../third_party ./ || die |
108 |
+ # ./grpc_root -> ${S} |
109 |
+ ln -s ../../../../ ./grpc_root || die |
110 |
+ # https://bugs.gentoo.org/661244 |
111 |
+ echo "prune grpc_root/tools/distrib/python/grpcio_tools" >> MANIFEST.in |
112 |
+ popd >/dev/null || die |
113 |
+ fi |
114 |
+} |
115 |
+ |
116 |
+src_compile() { |
117 |
+ tc-export CC CXX PKG_CONFIG |
118 |
+ |
119 |
+ emake \ |
120 |
+ V=1 \ |
121 |
+ prefix=/usr \ |
122 |
+ INSTALL_LIBDIR="$(get_libdir)" \ |
123 |
+ AR="$(tc-getAR)" \ |
124 |
+ AROPTS="rcs" \ |
125 |
+ CFLAGS="${CFLAGS}" \ |
126 |
+ CXXFLAGS="${CXXFLAGS}" \ |
127 |
+ LD="${CC}" \ |
128 |
+ LDXX="${CXX}" \ |
129 |
+ STRIP=/bin/true \ |
130 |
+ HOST_CC="$(tc-getBUILD_CC)" \ |
131 |
+ HOST_CXX="$(tc-getBUILD_CXX)" \ |
132 |
+ HOST_LD="$(tc-getBUILD_CC)" \ |
133 |
+ HOST_LDXX="$(tc-getBUILD_CXX)" \ |
134 |
+ HOST_AR="$(tc-getBUILD_AR)" \ |
135 |
+ HAS_SYSTEMTAP="$(usex systemtap true false)" |
136 |
+ |
137 |
+ use python && distutils-r1_src_compile |
138 |
+} |
139 |
+ |
140 |
+python_compile() { |
141 |
+ export GRPC_PYTHON_BUILD_SYSTEM_CARES=1 |
142 |
+ export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 |
143 |
+ export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 |
144 |
+ export GRPC_PYTHON_BUILD_WITH_CYTHON=1 |
145 |
+ distutils-r1_python_compile |
146 |
+ |
147 |
+ if use tools; then |
148 |
+ pushd tools/distrib/python/grpcio_tools >/dev/null || die |
149 |
+ distutils-r1_python_compile |
150 |
+ popd >/dev/null || die |
151 |
+ fi |
152 |
+} |
153 |
+ |
154 |
+python_compile_all() { |
155 |
+ if use doc; then |
156 |
+ esetup.py doc |
157 |
+ mv doc/build doc/html || die |
158 |
+ fi |
159 |
+} |
160 |
+ |
161 |
+src_install() { |
162 |
+ emake \ |
163 |
+ prefix="${D}"/usr \ |
164 |
+ INSTALL_LIBDIR="$(get_libdir)" \ |
165 |
+ STRIP=/bin/true \ |
166 |
+ install |
167 |
+ |
168 |
+ use static-libs || find "${ED}" -name '*.a' -delete |
169 |
+ |
170 |
+ if use examples; then |
171 |
+ find examples -name '.gitignore' -delete || die |
172 |
+ dodoc -r examples |
173 |
+ docompress -x /usr/share/doc/${PF}/examples |
174 |
+ fi |
175 |
+ |
176 |
+ if use doc; then |
177 |
+ find doc -name '.gitignore' -delete || die |
178 |
+ local DOCS=( AUTHORS README.md doc/. ) |
179 |
+ fi |
180 |
+ |
181 |
+ einstalldocs |
182 |
+ |
183 |
+ use python && distutils-r1_src_install |
184 |
+ |
185 |
+} |
186 |
+ |
187 |
+python_install() { |
188 |
+ distutils-r1_python_install |
189 |
+ |
190 |
+ if use tools; then |
191 |
+ pushd tools/distrib/python/grpcio_tools >/dev/null || die |
192 |
+ distutils-r1_python_install |
193 |
+ popd >/dev/null || die |
194 |
+ fi |
195 |
+} |