From c61557b1b642b61abdb665527e6a34b97e3d064f Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 21 Mar 2020 12:17:11 +0100 Subject: gnu: gRPC: Move to (gnu packages rpc). * gnu/packages/machine-learning.scm (grpc): Move to ... * gnu/packages/rpc.scm: ... here. New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Adjust accordingly. * gnu/packages/hyperledger.scm: Adjust module imports. --- gnu/packages/rpc.scm | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 gnu/packages/rpc.scm (limited to 'gnu/packages/rpc.scm') diff --git a/gnu/packages/rpc.scm b/gnu/packages/rpc.scm new file mode 100644 index 0000000000..f37a660fc7 --- /dev/null +++ b/gnu/packages/rpc.scm @@ -0,0 +1,103 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Ricardo Wurmus +;;; Copyright © 2020 Efraim Flashner +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages rpc) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix git-download) + #:use-module (guix build-system cmake) + #:use-module (gnu packages adns) + #:use-module (gnu packages compression) + #:use-module (gnu packages protobuf) + #:use-module (gnu packages python) + #:use-module (gnu packages tls)) + +(define-public grpc + (package + (name "grpc") + (version "1.16.1") + (outputs '("out" "static")) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/grpc/grpc.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1jimqz3115f9pli5w6ik9wi7mjc7ix6y7yrq4a1ab9fc3dalj7p2")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f ; no test target + #:configure-flags + (list "-DgRPC_ZLIB_PROVIDER=package" + "-DgRPC_CARES_PROVIDER=package" + "-DgRPC_SSL_PROVIDER=package" + "-DgRPC_PROTOBUF_PROVIDER=package" + (string-append "-DCMAKE_INSTALL_PREFIX=" + (assoc-ref %outputs "out")) + "-DCMAKE_INSTALL_LIBDIR=lib" + (string-append "-DCMAKE_INSTALL_RPATH=" + (assoc-ref %outputs "out") "/lib") + "-DCMAKE_VERBOSE_MAKEFILE=ON") + #:phases + (modify-phases %standard-phases + (add-before 'configure 'configure-shared + (lambda* (#:key (configure-flags '()) #:allow-other-keys) + (mkdir "../build-shared") + (with-directory-excursion "../build-shared" + (apply invoke + "cmake" "../source" + "-DBUILD_SHARED_LIBS=ON" + configure-flags) + (apply invoke "make" + `("-j" ,(number->string (parallel-job-count))))))) + (add-after 'install 'install-shared-libraries + (lambda _ + (with-directory-excursion "../build-shared" + (invoke "make" "install")))) + (add-before 'strip 'move-static-libs + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (static (assoc-ref outputs "static"))) + (mkdir-p (string-append static "/lib")) + (with-directory-excursion + (string-append out "/lib") + (for-each + (lambda (file) + (rename-file file + (string-append static "/lib/" file))) + (find-files "." "\\.a$")))) + #t))))) + (inputs + `(("c-ares" ,c-ares/cmake) + ("openssl" ,openssl) + ("zlib" ,zlib))) + (native-inputs + `(("protobuf" ,protobuf) + ("python" ,python-wrapper))) + (home-page "https://grpc.io") + (synopsis "High performance universal RPC framework") + (description "gRPC is a modern high performance @dfn{Remote Procedure Call} +(RPC) framework that can run in any environment. It can efficiently connect +services in and across data centers with pluggable support for load balancing, +tracing, health checking and authentication. It is also applicable in last +mile of distributed computing to connect devices, mobile applications and +browsers to backend services.") + (license license:asl2.0))) -- cgit v1.2.3 From f2c7513d1604076049d1834580d218d764e6b85b Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 21 Mar 2020 12:20:14 +0100 Subject: gnu: python-grpcio: Move to (gnu packages rpc). * gnu/packages/python-xyz.scm (python-grpcio): Move from here ... * gnu/packages/rpc.scm (python-grpcio): ... to here. --- gnu/packages/python-xyz.scm | 20 -------------------- gnu/packages/rpc.scm | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 20 deletions(-) (limited to 'gnu/packages/rpc.scm') diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 3937bad5c3..d0da9b36c3 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -17022,26 +17022,6 @@ source via the Abstract Syntax Tree.") (define-public python2-astor (package-with-python2 python-astor)) -(define-public python-grpcio - (package - (name "python-grpcio") - (version "1.17.1") - (source - (origin - (method url-fetch) - (uri (pypi-uri "grpcio" version)) - (sha256 - (base32 - "0qb9y6j83nxa6d4kc60i8yfgdm7a8ms7b54kncjzf5y7nsxp8rzx")))) - (build-system python-build-system) - (propagated-inputs - `(("python-six" ,python-six))) - (home-page "https://grpc.io") - (synopsis "HTTP/2-based RPC framework") - (description "This package provides a Python library for communicating -with the HTTP/2-based RPC framework gRPC.") - (license license:asl2.0))) - (define-public python-astunparse (package (name "python-astunparse") diff --git a/gnu/packages/rpc.scm b/gnu/packages/rpc.scm index f37a660fc7..991dc89324 100644 --- a/gnu/packages/rpc.scm +++ b/gnu/packages/rpc.scm @@ -21,11 +21,14 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix git-download) + #:use-module (guix download) #:use-module (guix build-system cmake) + #:use-module (guix build-system python) #:use-module (gnu packages adns) #:use-module (gnu packages compression) #:use-module (gnu packages protobuf) #:use-module (gnu packages python) + #:use-module (gnu packages python-xyz) #:use-module (gnu packages tls)) (define-public grpc @@ -101,3 +104,23 @@ tracing, health checking and authentication. It is also applicable in last mile of distributed computing to connect devices, mobile applications and browsers to backend services.") (license license:asl2.0))) + +(define-public python-grpcio + (package + (name "python-grpcio") + (version "1.17.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "grpcio" version)) + (sha256 + (base32 + "0qb9y6j83nxa6d4kc60i8yfgdm7a8ms7b54kncjzf5y7nsxp8rzx")))) + (build-system python-build-system) + (propagated-inputs + `(("python-six" ,python-six))) + (home-page "https://grpc.io") + (synopsis "HTTP/2-based RPC framework") + (description "This package provides a Python library for communicating +with the HTTP/2-based RPC framework gRPC.") + (license license:asl2.0))) -- cgit v1.2.3 From 447fafe3d7ca1cad0f3dd91da8410c9b9d1ecd5a Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 21 Mar 2020 12:33:15 +0100 Subject: gnu: gRPC: Update to 1.27.3. * gnu/packages/rpc.scm (grpc): Update to 1.27.3. [arguments]: Add "-DgRPC_ABSL_PROVIDER=package" in #:configure-flags. [inputs]: Add ABSEIL-CPP. (grpc-1.16.1): New public variable. * gnu/packages/hyperledger.scm (hyperledger-iroha)[inputs]: Change from GRPC to GRPC-1.16. * gnu/packages/machine-learning.scm (tensorflow)[native-inputs, inputs]: Likewise. --- gnu/packages/hyperledger.scm | 2 +- gnu/packages/machine-learning.scm | 4 ++-- gnu/packages/rpc.scm | 25 ++++++++++++++++++++++--- 3 files changed, 25 insertions(+), 6 deletions(-) (limited to 'gnu/packages/rpc.scm') diff --git a/gnu/packages/hyperledger.scm b/gnu/packages/hyperledger.scm index 1aed8e23d8..86eb86d3b5 100644 --- a/gnu/packages/hyperledger.scm +++ b/gnu/packages/hyperledger.scm @@ -190,7 +190,7 @@ link-time. New implementations can be added as well.") (inputs `(("boost" ,boost-1.69) ("gflags" ,gflags) - ("grpc" ,grpc) + ("grpc" ,grpc-1.16.1) ("hyperledger-iroha-ed25519" ,hyperledger-iroha-ed25519) ("postgresql" ,postgresql) ("protobuf" ,protobuf) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index faf4bacfe3..8ff68123d1 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -1708,7 +1708,7 @@ INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n"))) (sha256 (base32 "161g9841rjfsy5pn52fcis0s9hdr7rxvb06pad38j5rppfihvign"))))) - ("grpc" ,grpc "static") + ("grpc" ,grpc-1.16.1 "static") ("googletest" ,googletest) ("swig" ,swig) ("unzip" ,unzip))) @@ -1730,7 +1730,7 @@ INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n"))) ("libjpeg" ,libjpeg) ("libpng" ,libpng) ("giflib" ,giflib) - ("grpc:bin" ,grpc) + ("grpc:bin" ,grpc-1.16.1) ("jsoncpp" ,jsoncpp-for-tensorflow) ("snappy" ,snappy) ("sqlite" ,sqlite) diff --git a/gnu/packages/rpc.scm b/gnu/packages/rpc.scm index 991dc89324..3691440590 100644 --- a/gnu/packages/rpc.scm +++ b/gnu/packages/rpc.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019 Ricardo Wurmus ;;; Copyright © 2020 Efraim Flashner +;;; Copyright © 2020 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,6 +27,7 @@ #:use-module (guix build-system python) #:use-module (gnu packages adns) #:use-module (gnu packages compression) + #:use-module (gnu packages cpp) #:use-module (gnu packages protobuf) #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) @@ -34,7 +36,7 @@ (define-public grpc (package (name "grpc") - (version "1.16.1") + (version "1.27.3") (outputs '("out" "static")) (source (origin (method git-fetch) @@ -44,12 +46,13 @@ (file-name (git-file-name name version)) (sha256 (base32 - "1jimqz3115f9pli5w6ik9wi7mjc7ix6y7yrq4a1ab9fc3dalj7p2")))) + "0czmbwnafc7jnrrq2fnac2av83vs2q7q0wy4k11w9zbpld7j5h6d")))) (build-system cmake-build-system) (arguments `(#:tests? #f ; no test target #:configure-flags (list "-DgRPC_ZLIB_PROVIDER=package" + "-DgRPC_ABSL_PROVIDER=package" "-DgRPC_CARES_PROVIDER=package" "-DgRPC_SSL_PROVIDER=package" "-DgRPC_PROTOBUF_PROVIDER=package" @@ -89,7 +92,8 @@ (find-files "." "\\.a$")))) #t))))) (inputs - `(("c-ares" ,c-ares/cmake) + `(("abseil-cpp" ,abseil-cpp) + ("c-ares" ,c-ares/cmake) ("openssl" ,openssl) ("zlib" ,zlib))) (native-inputs @@ -105,6 +109,21 @@ mile of distributed computing to connect devices, mobile applications and browsers to backend services.") (license license:asl2.0))) +;; Some packages require this older version. +(define-public grpc-1.16.1 + (package + (inherit grpc) + (version "1.16.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/grpc/grpc.git") + (commit (string-append "v" version)))) + (file-name (git-file-name "grpc" version)) + (sha256 + (base32 + "1jimqz3115f9pli5w6ik9wi7mjc7ix6y7yrq4a1ab9fc3dalj7p2")))))) + (define-public python-grpcio (package (name "python-grpcio") -- cgit v1.2.3 From 9dec91229b428a8b6c81354fa7cc68df17dcb724 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 21 Mar 2020 12:46:13 +0100 Subject: gnu: python-grpcio: Update to 1.27.2. * gnu/packages/rpc.scm (python-grpcio): Update to 1.27.2. [source](modules, snippet): New fields. [arguments]: Add phases to use system libraries and the correct compiler. [inputs]: Add C-ARES, OPENSSL, and ZLIB. --- gnu/packages/rpc.scm | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'gnu/packages/rpc.scm') diff --git a/gnu/packages/rpc.scm b/gnu/packages/rpc.scm index 3691440590..e73695b613 100644 --- a/gnu/packages/rpc.scm +++ b/gnu/packages/rpc.scm @@ -127,15 +127,47 @@ browsers to backend services.") (define-public python-grpcio (package (name "python-grpcio") - (version "1.17.1") + (version "1.27.2") (source (origin (method url-fetch) (uri (pypi-uri "grpcio" version)) (sha256 (base32 - "0qb9y6j83nxa6d4kc60i8yfgdm7a8ms7b54kncjzf5y7nsxp8rzx")))) + "0zl89jwcff9hkd8mi4yf3qbhns9vbv1s4x4vahm5mkpr7jwk5ras")) + (modules '((guix build utils) (ice-9 ftw))) + (snippet + '(begin + (with-directory-excursion "third_party" + ;; Delete the bundled source code of libraries that are possible + ;; to provide as inputs. + (for-each delete-file-recursively + (scandir "." + (lambda (file) + (not (member file + '("." ".." + "abseil-cpp" + "address_sorting" + "upb"))))))) + #t)))) (build-system python-build-system) + (arguments + '(#:phases (modify-phases %standard-phases + (add-before 'build 'use-system-libraries + (lambda _ + (setenv "GRPC_PYTHON_BUILD_SYSTEM_CARES" "1") + (setenv "GRPC_PYTHON_BUILD_SYSTEM_OPENSSL" "1") + (setenv "GRPC_PYTHON_BUILD_SYSTEM_ZLIB" "1") + #t)) + (add-before 'build 'configure-compiler + (lambda _ + (substitute* '("setup.py" "src/python/grpcio/commands.py") + (("'cc'") "'gcc'")) + #t))))) + (inputs + `(("c-ares" ,c-ares) + ("openssl" ,openssl) + ("zlib" ,zlib))) (propagated-inputs `(("python-six" ,python-six))) (home-page "https://grpc.io") -- cgit v1.2.3