mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-18 22:54:00 +00:00
123 lines
4.1 KiB
Bash
123 lines
4.1 KiB
Bash
# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
|
|
# Contributor: Aleksey Filippov <sarum9in@gmail.com>
|
|
# Contributor: Victor Aurélio Santos <victoraur.santos@gmail.com>
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
# - explicitly link v5/v6 with libatomic
|
|
|
|
pkgbase='grpc'
|
|
pkgname=('grpc' 'python-grpcio' 'php-grpc' 'grpc-cli')
|
|
pkgver=1.29.1
|
|
_gtestver=c9ccac7cb7345901884aabf5d1a786cfa6e2f397
|
|
_abseilcppver=20200225.2
|
|
_gbenchmark=1.5.0
|
|
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=('re2c' 'protobuf' 'php' 'c-ares' 'openssl' 'chrpath' 'gflags' 'cython' 'cmake')
|
|
source=("https://github.com/$pkgname/$pkgname/archive/v$pkgver/$pkgname-$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"
|
|
"https://github.com/google/benchmark/archive/v$_gbenchmark/google-benchmark-$_gbenchmark.tar.gz")
|
|
sha256sums=('0343e6dbde66e9a31c691f2f61e98d79f3584e03a11511fad3f10e3667832a45'
|
|
'443d383db648ebb8e391382c0ab63263b7091d03197f304390baac10f178a468'
|
|
'f41868f7a938605c92936230081175d1eae87f6ea2c248f41077c8f88316f111'
|
|
'3c6a165b6ecc948967a1ead710d4a181d7b0fbcaa183ef7ea84604994966221a')
|
|
|
|
prepare() {
|
|
cd "$srcdir/$pkgname-$pkgver"
|
|
ln -sf "$srcdir/googletest-$_gtestver/"{googlemock,googletest} \
|
|
third_party/googletest
|
|
|
|
rm -rf third_party/abseil-cpp
|
|
ln -s "$srcdir/abseil-cpp-$_abseilcppver/" third_party/abseil-cpp
|
|
|
|
rm -rf third_party/benchmark
|
|
ln -s "$srcdir/benchmark-$_gbenchmark/" third_party/benchmark
|
|
|
|
sed '/TARGET gflags::gflags/i \ set(_gRPC_GFLAGS_LIBRARIES gflags)' -i cmake/gflags.cmake
|
|
|
|
[[ $CARCH == "armv6h" || $CARCH == "arm" ]] && 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
|
|
|
|
mkdir build
|
|
cd build
|
|
cmake \
|
|
-DgRPC_INSTALL=ON \
|
|
-DBUILD_SHARED_LIBS=ON \
|
|
-DgRPC_BUILD_TESTS=ON \
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
-DgRPC_CARES_PROVIDER=package \
|
|
-DgRPC_PROTOBUF_PROVIDER=package \
|
|
-DgRPC_SSL_PROVIDER=package \
|
|
-DgRPC_ZLIB_PROVIDER=package \
|
|
-DgRPC_GFLAGS_PROVIDER=package \
|
|
-DBENCHMARK_HAS_CXX03_FLAG=OFF \
|
|
..
|
|
}
|
|
|
|
build() {
|
|
cd "$srcdir/$pkgname-$pkgver/build"
|
|
make
|
|
export LDFLAGS="$LDFLAGS -L$PWD"
|
|
|
|
# PHP
|
|
cd "$srcdir/$pkgbase-$pkgver/src/php/ext/$pkgbase"
|
|
phpize
|
|
./configure --enable-grpc="$srcdir/$pkgname-$pkgver"
|
|
make
|
|
|
|
# Python
|
|
cd "$srcdir/$pkgname-$pkgver"
|
|
GRPC_PYTHON_BUILD_WITH_CYTHON=1 \
|
|
GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 \
|
|
GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 \
|
|
GRPC_PYTHON_BUILD_SYSTEM_CARES=1 \
|
|
python setup.py build
|
|
}
|
|
|
|
package_grpc() {
|
|
depends=('c-ares' 'protobuf' 'openssl')
|
|
|
|
cd "$srcdir/$pkgbase-$pkgver/build"
|
|
make DESTDIR="$pkgdir" install
|
|
install -Dm644 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
|
|
}
|
|
|
|
package_python-grpcio() {
|
|
pkgdesc='Python language bindings for grpc, remote procedure call (RPC) framework'
|
|
depends=('c-ares' 'python')
|
|
|
|
cd "$srcdir/$pkgbase-$pkgver"
|
|
python setup.py install -O1 --skip-build --root="$pkgdir"
|
|
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
|
|
}
|
|
|
|
package_php-grpc() {
|
|
pkgdesc='gRPC module for PHP'
|
|
depends=('grpc' 'php')
|
|
backup=('etc/php/conf.d/grpc.ini')
|
|
|
|
# Install PHP extension.
|
|
cd "$srcdir/$pkgbase-$pkgver/src/php/ext/$pkgbase"
|
|
make install "INSTALL_ROOT=$pkgdir"
|
|
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
|
|
|
|
# Remove RPATH
|
|
chrpath -d "$pkgdir/usr/lib/php/modules/grpc.so"
|
|
|
|
echo ';extension=grpc.so' >grpc.ini
|
|
install -Dm644 grpc.ini "$pkgdir/etc/php/conf.d/grpc.ini"
|
|
}
|
|
|
|
package_grpc-cli() {
|
|
pkgdesc='gRPC protocol buffers cli'
|
|
depends=('grpc' 'gflags')
|
|
|
|
cd "$srcdir/$pkgbase-$pkgver"
|
|
install -dm0755 "$pkgdir/usr/lib"
|
|
cp -a build/libgrpc++_test_config.so* "$pkgdir/usr/lib/"
|
|
install -Dm0755 build/grpc_cli "$pkgdir/usr/bin/grpc_cli"
|
|
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
|
|
}
|