diff options
| author | Efraim Flashner <efraim@flashner.co.il> | 2026-03-22 16:04:57 +0200 |
|---|---|---|
| committer | Efraim Flashner <efraim@flashner.co.il> | 2026-03-22 16:18:47 +0200 |
| commit | 3285ded4c31d3afc4b8cab08484c93a3a1dcd393 (patch) | |
| tree | ac5b8e10153fc0cfa788f23cec3e142a8b764da2 /gnu | |
| parent | 6049b4e50088ee4cd2c38217f170c47bba138dbb (diff) | |
gnu: ripgrep: Adjust custom phase.
* gnu/packages/rust-apps.scm (ripgrep)[arguments]: Rewrite the phase to
install the manpage and shell completions.
Change-Id: I5dda1f510ba0b03a77ea3e81a656c6bc78de1be9
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/rust-apps.scm | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index a278238d844..b4f8ff67d96 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -2606,41 +2606,29 @@ server for rapid website iteration.") (arguments (list #:install-source? #f - ;; Note: the built target 'rg' binary is required for 'install-extras - #:phases #~(modify-phases %standard-phases - (add-after 'install 'install-extras - (lambda* (#:key native-inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (share (string-append out "/share")) - (bash-completions-dir - (string-append out "/share/bash-completion/completions")) - (zsh-completions-dir - (string-append share "/zsh/site-functions")) - (fish-completions-dir - (string-append share "/fish/vendor_completions.d")) - (man1 (string-append share "/man/man1")) - (rg (if #$(%current-target-system) - (search-input-file native-inputs "/bin/rg") - (string-append out "/bin/rg")))) - (mkdir-p man1) - (with-output-to-file (string-append man1 "/rg.1") - (lambda _ - (invoke rg "--generate" "man"))) - (mkdir-p bash-completions-dir) - (with-output-to-file (string-append - bash-completions-dir "/rg") - (lambda _ - (invoke rg "--generate" "complete-bash"))) - (mkdir-p zsh-completions-dir) - (with-output-to-file (string-append - zsh-completions-dir "/_rg") - (lambda _ - (invoke rg "--generate" "complete-zsh"))) - (mkdir-p fish-completions-dir) - (with-output-to-file - (string-append fish-completions-dir "/rg.fish") - (lambda _ - (invoke rg "--generate" "complete-fish"))))))) + #:modules + '((guix build cargo-build-system) + (guix build utils) + (ice-9 match)) + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'install-extras + (lambda* (#:key native-inputs #:allow-other-keys) + (for-each + (match-lambda + ((shell . path) + (mkdir-p (in-vicinity #$output (dirname path))) + (let ((binary + (if #$(%current-target-system) + (search-input-file native-inputs "bin/rg") + (in-vicinity #$output "bin/rg")))) + (with-output-to-file (in-vicinity #$output path) + (lambda _ + (invoke binary "--generate" shell)))))) + '(("complete-bash" . "share/bash-completion/completions/rg") + ("complete-fish" . "share/fish/vendor_completions.d/rg.fish") + ("complete-zsh" . "share/zsh/site-functions/_rg") + ("man" . "share/man/man1/rg")))))) #:features '(list "pcre2"))) (inputs (cons pcre2 (cargo-inputs 'ripgrep))) (native-inputs (cons* pkg-config (if (%current-target-system) |
