[arch-commits] Commit in grpc/trunk (PKGBUILD cmake-cli.patch)

Massimiliano Torromeo mtorromeo at archlinux.org
Thu Apr 16 09:38:39 UTC 2020


    Date: Thursday, April 16, 2020 @ 09:38:39
  Author: mtorromeo
Revision: 615321

upgpkg: grpc 1.28.1-1

Added:
  grpc/trunk/cmake-cli.patch
Modified:
  grpc/trunk/PKGBUILD

-----------------+
 PKGBUILD        |   52 ++++++++++++++++++++++---------------------
 cmake-cli.patch |   65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 92 insertions(+), 25 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-04-16 09:26:12 UTC (rev 615320)
+++ PKGBUILD	2020-04-16 09:38:39 UTC (rev 615321)
@@ -4,9 +4,9 @@
 
 pkgbase='grpc'
 pkgname=('grpc' 'python-grpcio' 'php-grpc' 'grpc-cli')
-pkgver=1.27.3
+pkgver=1.28.1
 _gtestver=c9ccac7cb7345901884aabf5d1a786cfa6e2f397
-_abseilcppver=37dd2562ec830d547a1524bb306be313ac3f2556
+_abseilcppver=20200225.1
 pkgrel=1
 pkgdesc="High performance, open source, general RPC framework that puts mobile and HTTP/2 first."
 arch=('x86_64')
@@ -15,13 +15,16 @@
 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")
-sha256sums=('c2ab8a42a0d673c1acb596d276055adcc074c1116e427f118415da3e79e52969'
+        "https://github.com/abseil/abseil-cpp/archive/$_abseilcppver/abseil-cpp-$_abseilcppver.tar.gz"
+        "cmake-cli.patch")
+sha256sums=('4cbce7f708917b6e58b631c24c59fe720acc8fef5f959df9a58cdf9558d0a79b'
             '443d383db648ebb8e391382c0ab63263b7091d03197f304390baac10f178a468'
-            '19391fb4882601a65cb648d638c11aa301ce5f525ef02da1a9eafd22f72d7c59')
+            '0db0d26f43ba6806a8a3338da3e646bb581f0ca5359b3a201d8fb8e4752fd5f8'
+            'dfd1b8cd2a5860557fba06dbdb926b3b5122feca629af7972104204da1b50caf')
 
 prepare() {
   cd "$srcdir/$pkgname-$pkgver"
+  patch -p1 -i "$srcdir/cmake-cli.patch"
 
   ln -sf "$srcdir/googletest-$_gtestver/"{googlemock,googletest} \
     third_party/googletest
@@ -32,46 +35,43 @@
   mkdir build
   cd build
   cmake \
-    -DCMAKE_BUILD_TYPE=Release \
+    -DgRPC_INSTALL=ON \
+    -DBUILD_SHARED_LIBS=ON \
     -DCMAKE_INSTALL_PREFIX=/usr \
-    -DgRPC_BUILD_CSHARP_EXT=OFF \
-    -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \
-    -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \
     -DgRPC_CARES_PROVIDER=package \
     -DgRPC_PROTOBUF_PROVIDER=package \
     -DgRPC_SSL_PROVIDER=package \
     -DgRPC_ZLIB_PROVIDER=package \
+    -DgRPC_GFLAGS_PROVIDER=package \
     ..
 }
 
 build() {
-  cd "$srcdir/$pkgname-$pkgver"
-  export CFLAGS="$CFLAGS -Wno-unused-parameter -Wno-unused-function"
-  export CXXFLAGS="$CXXFLAGS -Wno-unused-parameter -Wno-unused-function"
+  cd "$srcdir/$pkgname-$pkgver/build"
+  make
+  export LDFLAGS="$LDFLAGS -L$PWD"
 
-  make shared plugins
+  # 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
-
-  # PHP
-  cd "$srcdir/$pkgbase-$pkgver/src/php/ext/$pkgbase"
-  phpize
-  LDFLAGS=-L"$srcdir/$pkgname-$pkgver/libs/opt" ./configure --enable-grpc="$srcdir/$pkgname-$pkgver"
-  make
 }
 
 package_grpc() {
   depends=('c-ares' 'protobuf' 'openssl')
 
-  cd "$srcdir/$pkgbase-$pkgver"
-  make prefix="$pkgdir/usr" install
-  find "$pkgdir"/usr/{include,share,lib/pkgconfig} -type f -exec chmod a-x {} +
-  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+  cd "$srcdir/$pkgbase-$pkgver/build"
+  make DESTDIR="$pkgdir" install
+  install -Dm644 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
 }
 
 package_python-grpcio() {
@@ -102,9 +102,11 @@
 
 package_grpc-cli() {
   pkgdesc='gRPC protocol buffers cli'
-  depends=('c-ares' 'gflags' 'protobuf' 'openssl')
+  depends=('grpc' 'gflags')
 
   cd "$srcdir/$pkgbase-$pkgver"
-  make prefix="$pkgdir/usr" install-grpc-cli
+  install -dm0755 "$pkgdir/usr/lib"
+  cp -a build/libgrpc{_cli_libs,++_test_config,++_proto_reflection_desc_db}.so* "$pkgdir/usr/lib/"
+  install -Dm0755 build/grpc_cli "$pkgdir/usr/bin/grpc_cli"
   install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
 }

Added: cmake-cli.patch
===================================================================
--- cmake-cli.patch	                        (rev 0)
+++ cmake-cli.patch	2020-04-16 09:38:39 UTC (rev 615321)
@@ -0,0 +1,65 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f7d6191..54ce048 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -44,6 +44,7 @@ set(gRPC_INSTALL_CMAKEDIR "lib/cmake/${PACKAGE_NAME}" CACHE STRING "Installation
+ set(gRPC_INSTALL_SHAREDIR "share/grpc" CACHE STRING "Installation directory for root certificates")
+ 
+ # Options
++option(gRPC_BUILD_CLI "Build cli" ON)
+ option(gRPC_BUILD_TESTS "Build tests" OFF)
+ option(gRPC_BUILD_CODEGEN "Build codegen" ON)
+ option(gRPC_BUILD_CSHARP_EXT "Build C# extensions" ON)
+@@ -84,7 +85,7 @@ set_property(CACHE gRPC_PROTOBUF_PROVIDER PROPERTY STRINGS "module" "package")
+ set(gRPC_PROTOBUF_PACKAGE_TYPE "" CACHE STRING "Algorithm for searching protobuf package")
+ set_property(CACHE gRPC_PROTOBUF_PACKAGE_TYPE PROPERTY STRINGS "CONFIG" "MODULE")
+ 
+-if(gRPC_BUILD_TESTS)
++if(gRPC_BUILD_TESTS OR gRPC_BUILD_CLI)
+   set(gRPC_GFLAGS_PROVIDER "module" CACHE STRING "Provider of gflags library")
+   set_property(CACHE gRPC_GFLAGS_PROVIDER PROPERTY STRINGS "module" "package")
+ 
+@@ -4277,7 +4278,7 @@ if(gRPC_INSTALL)
+ endif()
+ 
+ endif()
+-if(gRPC_BUILD_TESTS)
++if(gRPC_BUILD_TESTS OR gRPC_BUILD_CLI)
+ 
+ if(gRPC_BUILD_CODEGEN)
+ add_library(grpc++_proto_reflection_desc_db
+@@ -4411,7 +4412,7 @@ if(gRPC_INSTALL)
+ endif()
+ 
+ endif()
+-if(gRPC_BUILD_TESTS)
++if(gRPC_BUILD_TESTS OR gRPC_BUILD_CLI)
+ 
+ add_library(grpc++_test_config
+   test/cpp/util/test_config_cc.cc
+@@ -5268,7 +5269,7 @@ target_link_libraries(grpc_benchmark
+ 
+ 
+ endif()
+-if(gRPC_BUILD_TESTS)
++if(gRPC_BUILD_TESTS OR gRPC_BUILD_CLI)
+ 
+ if(gRPC_BUILD_CODEGEN)
+ add_library(grpc_cli_libs
+@@ -5321,6 +5322,7 @@ target_link_libraries(grpc_cli_libs
+   grpc++_proto_reflection_desc_db
+   grpc++
+   grpc
++  gflags
+   ${_gRPC_GFLAGS_LIBRARIES}
+ )
+ 
+@@ -13003,7 +13005,7 @@ target_link_libraries(grpc_alts_credentials_options_test
+ 
+ 
+ endif()
+-if(gRPC_BUILD_TESTS)
++if(gRPC_BUILD_TESTS OR gRPC_BUILD_CLI)
+ 
+ add_executable(grpc_cli
+   test/cpp/util/grpc_cli.cc



More information about the arch-commits mailing list