From e57e7eaea072bfb45a73dc26e82f9d8f048cf452 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 30 Aug 2022 20:09:40 -0400 Subject: [PATCH] gnu: python-grpcio: Update to 1.47.0. * gnu/packages/rpc.scm (python-grpcio): Update to 1.47.0. [source]{snippet}: Remove abseil-cpp from preserved bundled libraries. Preserve xxhash. [phases]: Delete trailing #t. {use-system-libraries}: Set the GRPC_PYTHON_BUILD_SYSTEM_RE2 and GRPC_PYTHON_BUILD_SYSTEM_ABSL environment variables to 1. Path setup.py. [inputs]: Add abseil-cpp and re2. --- gnu/packages/rpc.scm | 45 ++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/gnu/packages/rpc.scm b/gnu/packages/rpc.scm index b4f4af9446..0b02d09ad7 100644 --- a/gnu/packages/rpc.scm +++ b/gnu/packages/rpc.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2020 Brett Gilio ;;; Copyright © 2021 Greg Hogan ;;; Copyright © 2021 Tobias Geerinckx-Rice +;;; Copyright © 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ (define-module (gnu packages rpc) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix download) #:use-module (guix utils) @@ -157,14 +159,14 @@ browsers to backend services.") (define-public python-grpcio (package (name "python-grpcio") - (version "1.27.2") + (version "1.47.0") (source (origin (method url-fetch) (uri (pypi-uri "grpcio" version)) (sha256 (base32 - "0zl89jwcff9hkd8mi4yf3qbhns9vbv1s4x4vahm5mkpr7jwk5ras")) + "00gqhz0b1sqnfx6zy7h5z41b6mpsq57r1f3p95xradcvmdgskfsx")) (modules '((guix build utils) (ice-9 ftw))) (snippet '(begin @@ -176,26 +178,33 @@ browsers to backend services.") (lambda (file) (not (member file '("." ".." - "abseil-cpp" "address_sorting" - "upb"))))))) - #t)))) + "upb" + "xxhash"))))))))))) (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))))) + (list + #: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") + (setenv "GRPC_PYTHON_BUILD_SYSTEM_RE2" "1") + (setenv "GRPC_PYTHON_BUILD_SYSTEM_ABSL" "1") + ;; Fix the linker options to link with abseil-cpp, which is + ;; looked under /usr/lib. + (substitute* "setup.py" + (("pathlib.Path\\('/usr').glob\\('lib\\*/libabsl_\\*.so')") + (format #f "pathlib.Path('~a').glob('lib*/libabsl_*.so')" + #$(this-package-input "abseil-cpp")))))) + (add-before 'build 'configure-compiler + (lambda _ + (substitute* '("setup.py" "src/python/grpcio/commands.py") + (("'cc'") "'gcc'"))))))) (inputs - (list c-ares openssl zlib)) + (list abseil-cpp c-ares openssl re2 zlib)) (propagated-inputs (list python-six)) (home-page "https://grpc.io")