diff options
author | Azat Khuzhin | 2019-03-17 18:32:38 +0300 |
---|---|---|
committer | Azat Khuzhin | 2019-03-17 18:39:17 +0300 |
commit | 3338f774804f20c4ff96e22ae29844238e1e00e0 (patch) | |
tree | 3e44c7a59b9e479f78fb575d318dbfe97f86d31c | |
download | aur-3338f774804f20c4ff96e22ae29844238e1e00e0.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | PKGBUILD | 83 |
3 files changed, 109 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..6632cd8e4eca --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = grpc-git-cmake + pkgdesc = gRPC - An RPC library and framework (uses cmake for building) + pkgver = v1.12.1.r5278.g8c3d4a7dfd + pkgrel = 1 + url = http://www.grpc.io/ + arch = i686 + arch = x86_64 + license = BSD + makedepends = gflags + makedepends = zlib + makedepends = cmake + makedepends = ninja + depends = c-ares + depends = protobuf>=3 + conflicts = grpc + conflicts = grpc-git + conflicts = grpc-git-boringssl + options = !makeflags + source = git+https://github.com/grpc/grpc.git + md5sums = SKIP + +pkgname = grpc-git-cmake + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..0b9c942bad99 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/grpc +/src +/pkg diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..010cdff396d4 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,83 @@ +# Maintainer: Azat Khuzhin <a3at.mail@gmail.coM> +# Based on PKGBUILD by +# - Daichi Shinozaki <dsdseg@gmail.com> (grpc-git) +# - Simon Schäfer <simon.schaefer@koeln.de> (grpc-git-boringssl) + +pkgname=grpc-git-cmake +_pkgname=${pkgname/-git-cmake/} +pkgver=v1.12.1.r5278.g8c3d4a7dfd +pkgrel=1 +pkgdesc="gRPC - An RPC library and framework (uses cmake for building)" +arch=('i686' 'x86_64') +url='http://www.grpc.io/' +license=('BSD') +conflicts=('grpc' 'grpc-git' 'grpc-git-boringssl') +depends=('c-ares' 'protobuf>=3') +makedepends=('gflags' 'zlib' 'cmake' 'ninja') +options=(!makeflags) +source=('git+https://github.com/grpc/grpc.git') +md5sums=('SKIP') + +pkgver() { + cd $_pkgname + git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +} + +prepare() { + cd "$_pkgname" + mkdir -p build +} + +build() { + cd "$_pkgname/build" + + local opts=( + -DgRPC_BUILD_TESTS=OFF + -DBUILD_SHARED_LIBS=ON + -DCMAKE_INSTALL_PREFIX="$pkgdir/usr" + -DCMAKE_INSTALL_LIBDIR="$pkgdir/usr/lib" + -DgRPC_SSL_PROVIDER=package + -DgRPC_ZLIB_PROVIDER=package + -DgRPC_GFLAGS_PROVIDER=package + -DgRPC_PROTOBUF_PROVIDER=package + -DgRPC_BENCHMARK_PROVIDER=package + -DgRPC_CARES_PROVIDER=packet + -D_gRPC_PROTOBUF_PROTOC_LIBRARIES=protoc + -D_gRPC_PROTOBUF_PROTOC=/usr/bin/protoc + # hack with the libprotobuf and libprotoc since the cmakelist does not find + # it correctly, and cares since this is not added by the packet + # searcher + -DCMAKE_C_FLAGS="-Wno-error=stringop-overflow -lprotobuf -lprotoc -lcares" + -DCMAKE_CXX_FLAGS="-lprotobuf -lprotoc -lcares" + ) + + cmake -G Ninja .. "${opts[@]}" + ninja +} + +package() { + cd "$_pkgname/build" + + ninja install + + # install pkg-config files + cd .. + make pc_c prefix=/usr + make pc_c_unsecure prefix=/usr + make pc_cxx prefix=/usr + make pc_cxx_unsecure prefix=/usr + cd - + + mkdir -p "$pkgdir"/usr/lib/pkgconfig + install -Dm644 ../libs/opt/pkgconfig/grpc.pc "$pkgdir"/usr/lib/pkgconfig + install -Dm644 ../libs/opt/pkgconfig/grpc_unsecure.pc "$pkgdir"/usr/lib/pkgconfig + install -Dm644 ../libs/opt/pkgconfig/grpc++.pc "$pkgdir"/usr/lib/pkgconfig + install -Dm644 ../libs/opt/pkgconfig/grpc++_unsecure.pc "$pkgdir"/usr/lib/pkgconfig + + # install license + install -Dm644 ../LICENSE "$pkgdir"/usr/share/licenses/$_pkgname/LICENSE + + # cleanup protobuf stuff since this comes from the arch package + rm -rf "$pkgdir/usr/bin/protoc" + rm -rf "$pkgdir/usr/include/google" +} |