Package: guix-patches;
Reported by: Nicolas Graves <ngraves <at> ngraves.fr>
Date: Wed, 4 Jun 2025 07:48:01 UTC
Severity: normal
Tags: patch
Done: Hilton Chain <hako <at> ultrarare.space>
View this message in rfc822 format
From: Nicolas Graves <ngraves <at> ngraves.fr> To: 78691 <at> debbugs.gnu.org Cc: Nicolas Graves <ngraves <at> ngraves.fr> Subject: [bug#78691] [PATCH 2/3] gnu: rbw: Improve style. Date: Wed, 4 Jun 2025 09:49:53 +0200
* gnu/packages/rust-apps.scm (rbw)[arguments]: Improve cargo-inputs and phases style. Use gexps. --- gnu/packages/rust-apps.scm | 191 ++++++++++++++++++------------------- 1 file changed, 95 insertions(+), 96 deletions(-) diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index ce01f6ed2c..8db5f48b41 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -3824,109 +3824,108 @@ (define-public rbw (string-append "\"^" version))))))) (build-system cargo-build-system) (arguments - `(#:install-source? #f - #:cargo-inputs - (("rust-aes" ,rust-aes-0.8) - ("rust-anyhow" ,rust-anyhow-1) - ("rust-argon2" ,rust-argon2-0.5) - ("rust-arrayvec" ,rust-arrayvec-0.7) - ("rust-axum" ,rust-axum-0.7) - ("rust-base32" ,rust-base32-0.5) - ("rust-base64" ,rust-base64-0.22) - ("rust-block-padding" ,rust-block-padding-0.3) - ("rust-cbc" ,rust-cbc-0.1) - ("rust-clap" ,rust-clap-4) - ("rust-clap-complete" ,rust-clap-complete-4) - ("rust-cli-clipboard" ,rust-cli-clipboard-0.4) - ("rust-daemonize" ,rust-daemonize-0.5) - ("rust-directories" ,rust-directories-5) - ("rust-env-logger" ,rust-env-logger-0.11) - ("rust-futures" ,rust-futures-0.3) - ("rust-futures-channel" ,rust-futures-channel-0.3) - ("rust-futures-util" ,rust-futures-util-0.3) - ("rust-hkdf" ,rust-hkdf-0.12) - ("rust-hmac" ,rust-hmac-0.12) - ("rust-humantime" ,rust-humantime-2) - ("rust-is-terminal" ,rust-is-terminal-0.4) - ("rust-libc" ,rust-libc-0.2) - ("rust-log" ,rust-log-0.4) - ("rust-open" ,rust-open-5) - ("rust-pbkdf2" ,rust-pbkdf2-0.12) - ("rust-percent-encoding" ,rust-percent-encoding-2) - ("rust-pkcs8" ,rust-pkcs8-0.10) - ("rust-rand" ,rust-rand-0.8) - ("rust-regex" ,rust-regex-1) - ("rust-region" ,rust-region-3) - ("rust-reqwest" ,rust-reqwest-0.12) - ("rust-rmpv" ,rust-rmpv-1) - ("rust-rsa" ,rust-rsa-0.9) - ("rust-rustix" ,rust-rustix-0.38) - ("rust-serde" ,rust-serde-1) - ("rust-serde-json" ,rust-serde-json-1) - ("rust-serde-path-to-error" ,rust-serde-path-to-error-0.1) - ("rust-serde-repr" ,rust-serde-repr-0.1) - ("rust-sha1" ,rust-sha1-0.10) - ("rust-sha2" ,rust-sha2-0.10) - ("rust-tempfile" ,rust-tempfile-3) - ("rust-terminal-size" ,rust-terminal-size-0.4) - ("rust-textwrap" ,rust-textwrap-0.16) - ("rust-thiserror" ,rust-thiserror-1) - ("rust-tokio" ,rust-tokio-1) - ("rust-tokio-stream" ,rust-tokio-stream-0.1) - ("rust-tokio-tungstenite" ,rust-tokio-tungstenite-0.24) - ("rust-totp-lite" ,rust-totp-lite-2) - ("rust-url" ,rust-url-2) - ("rust-urlencoding" ,rust-urlencoding-2) - ("rust-uuid" ,rust-uuid-1) - ("rust-zeroize" ,rust-zeroize-1)) - #:phases - (modify-phases %standard-phases - (add-after 'install 'install-completions - (lambda* (#:key native-inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (share (string-append out "/share")) - (rbw (if ,(%current-target-system) - (search-input-file native-inputs "/bin/rbw") - (string-append out "/bin/rbw")))) - (mkdir-p (string-append out "/etc/bash_completion.d")) - (with-output-to-file - (string-append out "/etc/bash_completion.d/rbw") - (lambda _ (invoke rbw "gen-completions" "bash"))) - (mkdir-p (string-append share "/fish/vendor_completions.d")) - (with-output-to-file - (string-append share "/fish/vendor_completions.d/rbw.fish") - (lambda _ (invoke rbw "gen-completions" "fish"))) - (mkdir-p (string-append share "/zsh/site-functions")) - (with-output-to-file - (string-append share "/zsh/site-functions/_rbw") - (lambda _ (invoke rbw "gen-completions" "zsh"))) - (mkdir-p (string-append share "/elvish/lib")) - (with-output-to-file - (string-append share "/elvish/lib/rbw") - (lambda _ (invoke rbw "gen-completions" "elvish")))))) - (add-after 'install 'install-scripts - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (scripts (assoc-ref outputs "scripts"))) - (for-each (lambda (file) - (install-file file (string-append scripts "/bin"))) - (find-files "bin")) - (for-each (lambda (file) - (wrap-script file - ;; TODO: Do we want to wrap these with more programs? - ;; pass git fzf libsecret xclip rofi - `("PATH" prefix - (,(string-append out "/bin") + (list + #:install-source? #f + #:cargo-inputs + (list rust-aes-0.8 + rust-anyhow-1 + rust-argon2-0.5 + rust-arrayvec-0.7 + rust-axum-0.7 + rust-base32-0.5 + rust-base64-0.22 + rust-block-padding-0.3 + rust-cbc-0.1 + rust-clap-4 + rust-clap-complete-4 + rust-cli-clipboard-0.4 + rust-daemonize-0.5 + rust-directories-5 + rust-env-logger-0.11 + rust-futures-0.3 + rust-futures-channel-0.3 + rust-futures-util-0.3 + rust-hkdf-0.12 + rust-hmac-0.12 + rust-humantime-2 + rust-is-terminal-0.4 + rust-libc-0.2 + rust-log-0.4 + rust-open-5 + rust-pbkdf2-0.12 + rust-percent-encoding-2 + rust-pkcs8-0.10 + rust-rand-0.8 + rust-regex-1 + rust-region-3 + rust-reqwest-0.12 + rust-rmpv-1 + rust-rsa-0.9 + rust-rustix-0.38 + rust-serde-1 + rust-serde-json-1 + rust-serde-path-to-error-0.1 + rust-serde-repr-0.1 + rust-sha1-0.10 + rust-sha2-0.10 + rust-tempfile-3 + rust-terminal-size-0.4 + rust-textwrap-0.16 + rust-thiserror-1 + rust-tokio-1 + rust-tokio-stream-0.1 + rust-tokio-tungstenite-0.24 + rust-totp-lite-2 + rust-url-2 + rust-urlencoding-2 + rust-uuid-1 + rust-zeroize-1) + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'install-completions + (lambda* (#:key native-inputs #:allow-other-keys) + (let ((share (string-append #$output "/share")) + (rbw (if #$(%current-target-system) + (search-input-file native-inputs "/bin/rbw") + (string-append #$output "/bin/rbw")))) + (mkdir-p (string-append #$output "/etc/bash_completion.d")) + (with-output-to-file + (string-append #$output "/etc/bash_completion.d/rbw") + (lambda _ (invoke rbw "gen-completions" "bash"))) + (mkdir-p (string-append share "/fish/vendor_completions.d")) + (with-output-to-file + (string-append share "/fish/vendor_completions.d/rbw.fish") + (lambda _ (invoke rbw "gen-completions" "fish"))) + (mkdir-p (string-append share "/zsh/site-functions")) + (with-output-to-file + (string-append share "/zsh/site-functions/_rbw") + (lambda _ (invoke rbw "gen-completions" "zsh"))) + (mkdir-p (string-append share "/elvish/lib")) + (with-output-to-file + (string-append share "/elvish/lib/rbw") + (lambda _ (invoke rbw "gen-completions" "elvish")))))) + (add-after 'install 'install-scripts + (lambda* (#:key inputs #:allow-other-keys) + (let ((scripts #$output:scripts)) + (for-each (lambda (file) + (install-file file (string-append scripts "/bin"))) + (find-files "bin")) + (for-each (lambda (file) + (wrap-script file + ;; TODO: Do we want to wrap these with more programs? + ;; pass git fzf libsecret xclip rofi + `("PATH" prefix + (,(string-append #$output "/bin") ,(dirname (search-input-file inputs "/bin/grep")) ,(dirname (search-input-file inputs "/bin/sed")) ,(dirname (search-input-file inputs "/bin/perl")) ,(dirname (search-input-file inputs "/bin/xargs")) ,(dirname (search-input-file inputs "/bin/sort")))))) - (find-files (string-append scripts "/bin"))))))))) + (find-files (string-append scripts "/bin"))))))))) (native-inputs (cons* perl (if (%current-target-system) - (list this-package) - '()))) + (list this-package) + '()))) (inputs (list coreutils-minimal findutils grep perl sed)) (home-page "https://git.tozt.net/rbw") -- 2.49.0
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.