me
/
guix
Archived
1
0
Fork 0

gnu: grpc: Modernize.

* gnu/packages/rpc.scm (grpc) [arguments]: Use gexps.  Delete trailing #t.
[native-inputs]: Remove labels.
* gnu/packages/rpc.scm (grpc-1.16.1) [arguments]: Use gexps.

Change-Id: I0e89d246cc62a293274a32344108a7249f343257
master
Maxim Cournoyer 2024-05-07 21:16:12 -04:00
parent c9e3806ec1
commit 7fd2f2e6fd
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 58 additions and 60 deletions

View File

@ -5,7 +5,7 @@
;;; Copyright © 2020 Brett Gilio <brettg@gnu.org> ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
;;; Copyright © 2021 Greg Hogan <code@greghogan.com> ;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2022, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -65,55 +65,53 @@
"1fs407hnlnm0b8sncjwys9rc7ia5nb7wxrpx39nq3pzzfs1lv3vq")))) "1fs407hnlnm0b8sncjwys9rc7ia5nb7wxrpx39nq3pzzfs1lv3vq"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
`(#:tests? #f ; no test target (list
#:configure-flags #:tests? #f ; no test target
(list "-DgRPC_ZLIB_PROVIDER=package" #:configure-flags
"-DgRPC_ABSL_PROVIDER=package" #~(list "-DgRPC_ZLIB_PROVIDER=package"
"-DgRPC_CARES_PROVIDER=package" "-DgRPC_ABSL_PROVIDER=package"
"-DgRPC_SSL_PROVIDER=package" "-DgRPC_CARES_PROVIDER=package"
"-DgRPC_PROTOBUF_PROVIDER=package" "-DgRPC_SSL_PROVIDER=package"
"-DgRPC_RE2_PROVIDER=package" "-DgRPC_PROTOBUF_PROVIDER=package"
(string-append "-DCMAKE_INSTALL_PREFIX=" "-DgRPC_RE2_PROVIDER=package"
(assoc-ref %outputs "out")) (string-append "-DCMAKE_INSTALL_PREFIX=" #$output)
"-DCMAKE_INSTALL_LIBDIR=lib" "-DCMAKE_INSTALL_LIBDIR=lib"
(string-append "-DCMAKE_INSTALL_RPATH=" (string-append "-DCMAKE_INSTALL_RPATH=" #$output "/lib")
(assoc-ref %outputs "out") "/lib") "-DCMAKE_VERBOSE_MAKEFILE=ON")
"-DCMAKE_VERBOSE_MAKEFILE=ON") #:phases
#:phases #~(modify-phases %standard-phases
(modify-phases %standard-phases (add-before 'configure 'configure-shared
(add-before 'configure 'configure-shared (lambda* (#:key configure-flags #:allow-other-keys)
(lambda* (#:key (configure-flags '()) #:allow-other-keys) (mkdir "../build-shared")
(mkdir "../build-shared") (with-directory-excursion "../build-shared"
(with-directory-excursion "../build-shared" (apply invoke "cmake" "../source"
(apply invoke "-DBUILD_SHARED_LIBS=ON"
"cmake" "../source" configure-flags)
"-DBUILD_SHARED_LIBS=ON" (apply invoke "make"
configure-flags) (list "-j" (number->string (parallel-job-count)))))))
(apply invoke "make" (add-after 'install 'install-shared-libraries
`("-j" ,(number->string (parallel-job-count))))))) (lambda _
(add-after 'install 'install-shared-libraries (with-directory-excursion "../build-shared"
(lambda _ (invoke "make" "install"))))
(with-directory-excursion "../build-shared" (add-before 'strip 'move-static-libs
(invoke "make" "install")))) (lambda _
(add-before 'strip 'move-static-libs (let ((static #$output:static))
(lambda* (#:key outputs #:allow-other-keys) (mkdir-p (string-append static "/lib"))
(let ((out (assoc-ref outputs "out")) (with-directory-excursion (string-append #$output "/lib")
(static (assoc-ref outputs "static"))) (for-each
(mkdir-p (string-append static "/lib"))
(with-directory-excursion
(string-append out "/lib")
(for-each
(lambda (file) (lambda (file)
(rename-file file (rename-file file (string-append static "/lib/" file)))
(string-append static "/lib/" file))) (find-files "." "\\.a$")))))))))
(find-files "." "\\.a$"))))
#t)))))
(inputs
(list abseil-cpp-cxxstd11 c-ares/cmake openssl re2 zlib))
(native-inputs (native-inputs
`(("pkg-config" ,pkg-config) (list pkg-config
("protobuf" ,protobuf) protobuf
("python" ,python-wrapper))) python-wrapper))
(inputs
(list abseil-cpp-cxxstd11
c-ares/cmake
openssl
re2
zlib))
(home-page "https://grpc.io") (home-page "https://grpc.io")
(synopsis "High performance universal RPC framework") (synopsis "High performance universal RPC framework")
(description "gRPC is a modern high performance @dfn{Remote Procedure Call} (description "gRPC is a modern high performance @dfn{Remote Procedure Call}
@ -159,18 +157,18 @@ browsers to backend services.")
(arguments (arguments
(substitute-keyword-arguments (package-arguments grpc) (substitute-keyword-arguments (package-arguments grpc)
((#:phases phases) ((#:phases phases)
`(modify-phases ,phases #~(modify-phases #$phases
;; Note: This would be nicer as a snippet, but that creates a tarball ;; Note: This would be nicer as a snippet, but that creates a tarball
;; instead of a checkout and breaks assumptions made by the builder. ;; instead of a checkout and breaks assumptions made by the builder.
(add-after 'unpack 'rename-gettid (add-after 'unpack 'rename-gettid
(lambda _ (lambda _
;; Rename custom gettid() syscall wrapper to avoid conflict ;; Rename custom gettid() syscall wrapper to avoid conflict
;; with gettid() from glibc 2.30. ;; with gettid() from glibc 2.30.
(substitute* '("src/core/lib/gpr/log_linux.cc" (substitute* '("src/core/lib/gpr/log_linux.cc"
"src/core/lib/gpr/log_posix.cc" "src/core/lib/gpr/log_posix.cc"
"src/core/lib/iomgr/ev_epollex_linux.cc") "src/core/lib/iomgr/ev_epollex_linux.cc")
(("gettid\\(") (("gettid\\(")
"sys_gettid(")))))))) "sys_gettid("))))))))
(inputs (inputs
(modify-inputs (package-inputs grpc) (modify-inputs (package-inputs grpc)
(replace "abseil-cpp" abseil-cpp-20200923.3))) (replace "abseil-cpp" abseil-cpp-20200923.3)))