From 8def789f44fa3cc27a30163c92773fe8727fd33f Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 19 Mar 2026 12:03:11 +0200 Subject: [PATCH] gnu: rbw: Rewrite with g-exps. * gnu/packages/rust-apps.scm (rbw)[arguments]: Rewrite using g-exps. Change-Id: I82a959f4fb750e1275a6088c6e3fe4296ec4f1f0 --- gnu/packages/rust-apps.scm | 62 ++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index dd99ac631d..6e746cbece 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -3690,51 +3690,49 @@ runs a command whenever it detects modifications.") (base32 "1fg9jad5r255xcnc22ldmjra9ydf40yqvmpa7pwrzxncvf37v3l9")))) (build-system cargo-build-system) (arguments - `(#:install-source? #f + (list + #:install-source? #f #: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"))) + #~(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) (for-each (lambda (file) - (install-file file (string-append scripts "/bin"))) + (install-file file (string-append #$output: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") + (,(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 #$output:scripts "/bin")))))))) (native-inputs (cons* perl (if (%current-target-system) (list this-package)