1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages rpc)
21 #:use-module ((guix licenses) #:prefix license:)
22 #:use-module (guix packages)
23 #:use-module (guix git-download)
24 #:use-module (guix download)
25 #:use-module (guix build-system cmake)
26 #:use-module (guix build-system python)
27 #:use-module (gnu packages adns)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages protobuf)
30 #:use-module (gnu packages python)
31 #:use-module (gnu packages python-xyz)
32 #:use-module (gnu packages tls))
38 (outputs '("out" "static"))
42 (url "https://github.com/grpc/grpc.git")
43 (commit (string-append "v" version))))
44 (file-name (git-file-name name version))
47 "1jimqz3115f9pli5w6ik9wi7mjc7ix6y7yrq4a1ab9fc3dalj7p2"))))
48 (build-system cmake-build-system)
50 `(#:tests? #f ; no test target
52 (list "-DgRPC_ZLIB_PROVIDER=package"
53 "-DgRPC_CARES_PROVIDER=package"
54 "-DgRPC_SSL_PROVIDER=package"
55 "-DgRPC_PROTOBUF_PROVIDER=package"
56 (string-append "-DCMAKE_INSTALL_PREFIX="
57 (assoc-ref %outputs "out"))
58 "-DCMAKE_INSTALL_LIBDIR=lib"
59 (string-append "-DCMAKE_INSTALL_RPATH="
60 (assoc-ref %outputs "out") "/lib")
61 "-DCMAKE_VERBOSE_MAKEFILE=ON")
63 (modify-phases %standard-phases
64 (add-before 'configure 'configure-shared
65 (lambda* (#:key (configure-flags '()) #:allow-other-keys)
66 (mkdir "../build-shared")
67 (with-directory-excursion "../build-shared"
70 "-DBUILD_SHARED_LIBS=ON"
73 `("-j" ,(number->string (parallel-job-count)))))))
74 (add-after 'install 'install-shared-libraries
76 (with-directory-excursion "../build-shared"
77 (invoke "make" "install"))))
78 (add-before 'strip 'move-static-libs
79 (lambda* (#:key outputs #:allow-other-keys)
80 (let ((out (assoc-ref outputs "out"))
81 (static (assoc-ref outputs "static")))
82 (mkdir-p (string-append static "/lib"))
83 (with-directory-excursion
84 (string-append out "/lib")
88 (string-append static "/lib/" file)))
89 (find-files "." "\\.a$"))))
92 `(("c-ares" ,c-ares/cmake)
96 `(("protobuf" ,protobuf)
97 ("python" ,python-wrapper)))
98 (home-page "https://grpc.io")
99 (synopsis "High performance universal RPC framework")
100 (description "gRPC is a modern high performance @dfn{Remote Procedure Call}
101 (RPC) framework that can run in any environment. It can efficiently connect
102 services in and across data centers with pluggable support for load balancing,
103 tracing, health checking and authentication. It is also applicable in last
104 mile of distributed computing to connect devices, mobile applications and
105 browsers to backend services.")
106 (license license:asl2.0)))
108 (define-public python-grpcio
110 (name "python-grpcio")
115 (uri (pypi-uri "grpcio" version))
118 "0qb9y6j83nxa6d4kc60i8yfgdm7a8ms7b54kncjzf5y7nsxp8rzx"))))
119 (build-system python-build-system)
121 `(("python-six" ,python-six)))
122 (home-page "https://grpc.io")
123 (synopsis "HTTP/2-based RPC framework")
124 (description "This package provides a Python library for communicating
125 with the HTTP/2-based RPC framework gRPC.")
126 (license license:asl2.0)))