diff options
| author | Efraim Flashner <efraim@flashner.co.il> | 2026-03-19 12:08:09 +0200 |
|---|---|---|
| committer | Efraim Flashner <efraim@flashner.co.il> | 2026-03-19 12:15:31 +0200 |
| commit | 0b94b8ad63ff8cc6a1d4d4ca9b6a390d65bbb773 (patch) | |
| tree | 566a0eee09dd3cb5bb0c19d3d5537ccfdd965e5b /gnu | |
| parent | 8def789f44fa3cc27a30163c92773fe8727fd33f (diff) | |
gnu: rbw: Adjust custom phases.
* gnu/packages/rust-apps.scm (rbw)[arguments]: Rewrite the phase
generating the shell completions. Simplify the phase wrapping and
installing the scripts.
Change-Id: I5454cacc4fbf8bd1e246a3facfcb1ce2247897a6
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/rust-apps.scm | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index 6e746cbece2..55cb7b1a849 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm | |||
| @@ -3692,47 +3692,46 @@ runs a command whenever it detects modifications.") | |||
| 3692 | (arguments | 3692 | (arguments |
| 3693 | (list | 3693 | (list |
| 3694 | #:install-source? #f | 3694 | #:install-source? #f |
| 3695 | #:modules | ||
| 3696 | '((guix build cargo-build-system) | ||
| 3697 | (guix build utils) | ||
| 3698 | (ice-9 match)) | ||
| 3695 | #:phases | 3699 | #:phases |
| 3696 | #~(modify-phases %standard-phases | 3700 | #~(modify-phases %standard-phases |
| 3697 | (add-after 'install 'install-completions | 3701 | (add-after 'install 'install-completions |
| 3698 | (lambda* (#:key native-inputs #:allow-other-keys) | 3702 | (lambda* (#:key native-inputs #:allow-other-keys) |
| 3699 | (let ((share (string-append #$output "/share")) | 3703 | (for-each |
| 3700 | (rbw (if #$(%current-target-system) | 3704 | (match-lambda |
| 3701 | (search-input-file native-inputs "/bin/rbw") | 3705 | ((shell . path) |
| 3702 | (string-append #$output "/bin/rbw")))) | 3706 | (mkdir-p (in-vicinity #$output (dirname path))) |
| 3703 | (mkdir-p (string-append #$output "/etc/bash_completion.d")) | 3707 | (let ((binary |
| 3704 | (with-output-to-file | 3708 | (if #$(%current-target-system) |
| 3705 | (string-append #$output "/etc/bash_completion.d/rbw") | 3709 | (search-input-file native-inputs "bin/rbw") |
| 3706 | (lambda _ (invoke rbw "gen-completions" "bash"))) | 3710 | (in-vicinity #$output "bin/rbw")))) |
| 3707 | (mkdir-p (string-append share "/fish/vendor_completions.d")) | 3711 | (with-output-to-file (in-vicinity #$output path) |
| 3708 | (with-output-to-file | 3712 | (lambda _ |
| 3709 | (string-append share "/fish/vendor_completions.d/rbw.fish") | 3713 | (invoke binary "gen-completions" shell)))))) |
| 3710 | (lambda _ (invoke rbw "gen-completions" "fish"))) | 3714 | '(("bash" . "share/bash-completion/completions/rbw") |
| 3711 | (mkdir-p (string-append share "/zsh/site-functions")) | 3715 | ("elvish" . "share/elvish/lib/rbw") |
| 3712 | (with-output-to-file | 3716 | ("fish" . "share/fish/vendor_completions.d/rbw.fish") |
| 3713 | (string-append share "/zsh/site-functions/_rbw") | 3717 | ("nushell" . "share/nushell/vendor/autoload/rbw") |
| 3714 | (lambda _ (invoke rbw "gen-completions" "zsh"))) | 3718 | ("zsh" . "share/zsh/site-functions/_rbw"))))) |
| 3715 | (mkdir-p (string-append share "/elvish/lib")) | ||
| 3716 | (with-output-to-file | ||
| 3717 | (string-append share "/elvish/lib/rbw") | ||
| 3718 | (lambda _ (invoke rbw "gen-completions" "elvish")))))) | ||
| 3719 | (add-after 'install 'install-scripts | 3719 | (add-after 'install 'install-scripts |
| 3720 | (lambda* (#:key inputs #:allow-other-keys) | 3720 | (lambda* (#:key inputs #:allow-other-keys) |
| 3721 | (for-each (lambda (file) | 3721 | (for-each |
| 3722 | (install-file file (string-append #$output:scripts "/bin"))) | 3722 | (lambda (file) |
| 3723 | (find-files "bin")) | 3723 | (wrap-script file |
| 3724 | (for-each (lambda (file) | 3724 | ;; TODO: Do we want to wrap these with more programs? |
| 3725 | (wrap-script file | 3725 | ;; pass git fzf libsecret xclip rofi |
| 3726 | ;; TODO: Do we want to wrap these with more programs? | 3726 | `("PATH" prefix |
| 3727 | ;; pass git fzf libsecret xclip rofi | 3727 | (,(string-append #$output "/bin") |
| 3728 | `("PATH" prefix | 3728 | ,(dirname (search-input-file inputs "/bin/grep")) |
| 3729 | (,(string-append #$output "/bin") | 3729 | ,(dirname (search-input-file inputs "/bin/sed")) |
| 3730 | ,(dirname (search-input-file inputs "/bin/grep")) | 3730 | ,(dirname (search-input-file inputs "/bin/perl")) |
| 3731 | ,(dirname (search-input-file inputs "/bin/sed")) | 3731 | ,(dirname (search-input-file inputs "/bin/xargs")) |
| 3732 | ,(dirname (search-input-file inputs "/bin/perl")) | 3732 | ,(dirname (search-input-file inputs "/bin/sort"))))) |
| 3733 | ,(dirname (search-input-file inputs "/bin/xargs")) | 3733 | (install-file file (string-append #$output:scripts "/bin"))) |
| 3734 | ,(dirname (search-input-file inputs "/bin/sort")))))) | 3734 | (find-files "bin"))))))) |
| 3735 | (find-files (string-append #$output:scripts "/bin")))))))) | ||
| 3736 | (native-inputs | 3735 | (native-inputs |
| 3737 | (cons* perl (if (%current-target-system) | 3736 | (cons* perl (if (%current-target-system) |
| 3738 | (list this-package) | 3737 | (list this-package) |
