community/grpc to 1.35.0-1

This commit is contained in:
Kevin Mihelich 2021-01-29 01:10:13 +00:00
parent 33c80662f9
commit 7be642afce

View file

@ -6,21 +6,22 @@
# - explicitly link v5/v6 with libatomic
pkgbase='grpc'
pkgname=('grpc' 'python-grpcio' 'php-grpc' 'grpc-cli')
pkgver=1.34.0
pkgname=('grpc' 'python-grpcio' 'php-grpc' 'php7-grpc' 'grpc-cli')
pkgver=1.35.0
_gtestver=c9ccac7cb7345901884aabf5d1a786cfa6e2f397
_abseilcppver=20200923.2
pkgrel=4
pkgrel=1
pkgdesc="High performance, open source, general RPC framework that puts mobile and HTTP/2 first."
arch=('x86_64')
url='https://grpc.io'
license=('BSD')
makedepends=('re2' 're2c' 'protobuf' 'php' 'c-ares' 'openssl' 'chrpath' 'cython' 'cmake' 'benchmark')
makedepends=('re2' 're2c' 'protobuf' 'php' 'php7' 'c-ares' 'openssl' 'chrpath' 'cython'
'cmake' 'benchmark' 'python-setuptools')
source=("https://github.com/grpc/grpc/archive/v$pkgver/$pkgbase-$pkgver.tar.gz"
"https://github.com/google/googletest/archive/$_gtestver/googletest-$_gtestver.tar.gz"
"https://github.com/abseil/abseil-cpp/archive/$_abseilcppver/abseil-cpp-$_abseilcppver.tar.gz"
"atomic.patch")
sha256sums=('7372a881122cd85a7224435a1d58bc5e11c88d4fb98a64b83f36f3d1c2f16d39'
sha256sums=('27dd2fc5c9809ddcde8eb6fa1fa278a3486566dfc28335fca13eb8df8bd3b958'
'443d383db648ebb8e391382c0ab63263b7091d03197f304390baac10f178a468'
'bf3f13b13a0095d926b25640e060f7e13881bd8a792705dd9e161f3c2b9aa976'
'2f1285c8874cad70a7e1800f80b1673e8a1b7e2ff11f1f3e198063988cc5ab06')
@ -36,6 +37,8 @@ prepare() {
mkdir build
cp -a src/php{,7}
if [[ $CARCH == "armv6h" || $CARCH == "arm" ]]; then
sed -i -e "s/set(_gRPC_ALLTARGETS_LIBRARIES \${CMAKE_DL_LIBS} rt m pthread)/set(_gRPC_ALLTARGETS_LIBRARIES \${CMAKE_DL_LIBS} atomic rt m pthread)/g" CMakeLists.txt
@ -70,6 +73,12 @@ build() {
./configure --enable-grpc="$srcdir/$pkgbase-$pkgver"
make
# PHP7
cd "$srcdir/$pkgbase-$pkgver/src/php7/ext/$pkgbase"
phpize7
./configure --enable-grpc="$srcdir/$pkgbase-$pkgver"
make
# Python
cd "$srcdir/$pkgbase-$pkgver"
GRPC_PYTHON_BUILD_WITH_CYTHON=1 \
@ -129,6 +138,23 @@ package_php-grpc() {
install -Dm644 grpc.ini "$pkgdir/etc/php/conf.d/grpc.ini"
}
package_php7-grpc() {
pkgdesc='gRPC module for PHP'
depends=('grpc' 'php7')
backup=('etc/php7/conf.d/grpc.ini')
# Install PHP extension.
cd "$srcdir/$pkgbase-$pkgver/src/php7/ext/$pkgbase"
make install "INSTALL_ROOT=$pkgdir"
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
# Remove RPATH
chrpath -d "$pkgdir/usr/lib/php7/modules/grpc.so"
echo ';extension=grpc.so' >grpc.ini
install -Dm644 grpc.ini "$pkgdir/etc/php7/conf.d/grpc.ini"
}
package_grpc-cli() {
pkgdesc='gRPC protocol buffers cli'
depends=('grpc')
@ -136,6 +162,11 @@ package_grpc-cli() {
cd "$srcdir/$pkgbase-$pkgver"
install -dm0755 "$pkgdir/usr/lib"
cp -a build/libgrpc++_test_config.so* "$pkgdir/usr/lib/"
for solib in build/third_party/abseil-cpp/absl/flags/*.so; do
install -t "$pkgdir/usr/lib" "$solib"
done
install -Dm0755 build/grpc_cli "$pkgdir/usr/bin/grpc_cli"
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}