aboutsummaryrefslogtreecommitdiffstats
path: root/community/grpc/APKBUILD
blob: 92761f1ae5ceafe074608adb222be13f547f88ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Contributor: wener <wenermail@gmail.com>
# Maintainer: wener <wenermail@gmail.com>
pkgname=grpc
pkgver=1.36.0
pkgrel=0
pkgdesc="The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)"
url="https://grpc.io/"
arch="all !ppc64le !armv7 !armhf !s390x !mips64" # Fails to build on armhf/armv7/s390x/mips64
license="Apache-2.0"
depends="protobuf"
makedepends="autoconf automake libtool libstdc++ protobuf-dev c-ares-dev
	openssl-dev gtest-dev zlib-dev yaml-dev linux-headers cmake libexecinfo-dev"
subpackages="$pkgname-dev $pkgname-cli"
_googletest_rev=c9ccac7cb7345901884aabf5d1a786cfa6e2f397
_abseil_cpp_rev=6f9d96a1f41439ac172ee2ef7ccd8edf0e5d068c
_re2_rev=aecba11114cf1fac5497aeb844b6966106de3eb6
_benchmark_ver=1.5.1
source="$pkgname-$pkgver.tar.gz::https://github.com/grpc/grpc/archive/v$pkgver.tar.gz
		googletest-$_googletest_rev.tar.gz::https://github.com/google/googletest/archive/$_googletest_rev.tar.gz
		abseil-cpp-$_abseil_cpp_rev.tar.gz::https://github.com/abseil/abseil-cpp/archive/$_abseil_cpp_rev.tar.gz
		benchmark-$_benchmark_ver.tar.gz::https://github.com/google/benchmark/archive/v$_benchmark_ver.tar.gz
		re2-$_re2_rev.tar.gz::https://github.com/google/re2/archive/$_re2_rev.tar.gz
		01-chttp2-maybe-uninitialized.patch
		"
options="!check"

unpack() {
	default_unpack
	cd "$srcdir"
	rm -rf $pkgname-$pkgver/third_party/googletest
	ln -sfn $PWD/googletest-$_googletest_rev/ $pkgname-$pkgver/third_party/googletest

	rm -rf $pkgname-$pkgver/third_party/abseil-cpp
	ln -sfn $PWD/abseil-cpp-$_abseil_cpp_rev/ $pkgname-$pkgver/third_party/abseil-cpp

	rm -rf $pkgname-$pkgver/third_party/benchmark
	ln -sfn $PWD/benchmark-$_benchmark_ver/ $pkgname-$pkgver/third_party/benchmark

	rm -rf $pkgname-$pkgver/third_party/re2
	ln -sfn $PWD/re2-$_re2_rev/ $pkgname-$pkgver/third_party/re2
}

build() {
	mkdir -p cmake/build
	cd cmake/build
	# gRPC_BUILD_TESTS for grpc_cli - very slow
	cmake ../..                        \
	  -DgRPC_INSTALL=ON                \
	  -DgRPC_CARES_PROVIDER=package    \
	  -DgRPC_PROTOBUF_PROVIDER=package \
	  -DgRPC_SSL_PROVIDER=package      \
	  -DgRPC_ZLIB_PROVIDER=package     \
	  -DBUILD_TESTING=OFF              \
	  -DgRPC_BUILD_TESTS=ON            \
	  -DCMAKE_INSTALL_PREFIX="/usr"	   \
	  -DCMAKE_INSTALL_LIBDIR=lib
	make
	make grpc_cli
}

package() {
	cd cmake/build
	make DESTDIR="$pkgdir" install
	cp grpc_cli $pkgdir/usr/bin/
	rm -f "$pkgdir/usr/share/grpc/roots.pem"
}

cli() {
	pkgdesc="gRPC command line tool"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/grpc_cli "$subpkgdir"/usr/bin/
}

sha512sums="a5c638ffb9393e58396a86ee43fe3a8406e43bc8f78c71e8daec28f7e96590632773ab528c873a7adc7cfd38cfc5950bbfbc4f3801ea254efd7e7ef50136368b  grpc-1.36.0.tar.gz
7dda1e090d5054896899a250433d78ba9fcc004a60c886c93098c726ff12f70bb8d222112f8845e98c1ceacdb060b96699bb90d8f4207496546996195ae90343  googletest-c9ccac7cb7345901884aabf5d1a786cfa6e2f397.tar.gz
f64fee62863f2103c1991136fd3bc2b71cd28c7ff62138ac991b5a7f81780a05e0e2bdd6a119d02e1d70dd54f989f584093957efaec94f26c9d6c3f4ee37f8ae  abseil-cpp-6f9d96a1f41439ac172ee2ef7ccd8edf0e5d068c.tar.gz
1e8782ab6846b8b29c5eea41ed1ba19dd92a46a135cf74acdc588e2cd5ef05581c644d20fc0d6403456d65417538e1db80109ae87989601298b2fc56ae3c3161  benchmark-1.5.1.tar.gz
bbe972e3fd65da69e0d7ac0e0b025fb09ad894315cb6c0e1268fa296599274f9f7c2e771aa577b340c8fa9412d8539fe3db2171d0e9ab9714f3f10910a1d5529  re2-aecba11114cf1fac5497aeb844b6966106de3eb6.tar.gz
7fa146ce86ddd4f160bb1ca9ff01cb7aca6b2b8c9aa50e4fa6b84504b9117b104be0d1e31ccb452d846549dfe1e9012ceccfcdc1f2357ed567621d71fb8b08c5  01-chttp2-maybe-uninitialized.patch"