diff options
| author | Efraim Flashner <efraim@flashner.co.il> | 2026-03-31 21:14:58 +0300 |
|---|---|---|
| committer | Efraim Flashner <efraim@flashner.co.il> | 2026-03-31 21:14:58 +0300 |
| commit | cf5286df357e34f0da24911c09aa821357175ddf (patch) | |
| tree | b7b8f9322a543101f8b8f84da5fc600a33db90c3 /gnu/packages | |
| parent | 8374fac8b6c496001bcf10217667b603fe18d056 (diff) | |
gnu: git-absorb: Adjust custom phase.
* gnu/packages/rust-apps.scm (git-absorb)[arguments]: Rewrite the phase
to install the shell completions.
Change-Id: Ia41c4766f13fdfbd2d6cae75649d7d4258a56c3c
Diffstat (limited to 'gnu/packages')
| -rw-r--r-- | gnu/packages/rust-apps.scm | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index 4f529c09cea..1988092487a 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -4335,44 +4335,43 @@ tools.") (base32 "1xr1bjia3sx2i7hw99r2s950xi4fa996bcg3n7j9arcjmrb7w14c")))) (build-system cargo-build-system) (arguments - `(#:install-source? #f - #:phases - (modify-phases %standard-phases - (add-after 'install 'install-manual-page - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (man (string-append out "/share/man/man1"))) - (with-directory-excursion "Documentation" - (invoke "a2x" - "--no-xmllint" - "--doctype=manpage" - "--format=manpage" - "git-absorb.adoc")) - (install-file "Documentation/git-absorb.1" man)))) - (add-after 'install 'install-completions - (lambda* (#:key native-inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (share (string-append out "/share")) - (git-absorb - (if ,(%current-target-system) - (search-input-file native-inputs "/bin/git-absorb") - (string-append out "/bin/git-absorb")))) - (mkdir-p (string-append out "/etc/bash_completion.d")) - (with-output-to-file - (string-append out "/etc/bash_completion.d/git-absorb") - (lambda _ (invoke git-absorb "--gen-completions" "bash"))) - (mkdir-p (string-append share "/fish/vendor_completions.d")) - (with-output-to-file - (string-append share "/fish/vendor_completions.d/git-absorb.fish") - (lambda _ (invoke git-absorb "--gen-completions" "fish"))) - (mkdir-p (string-append share "/zsh/site-functions")) - (with-output-to-file - (string-append share "/zsh/site-functions/_git-absorb") - (lambda _ (invoke git-absorb "--gen-completions" "zsh"))) - (mkdir-p (string-append share "/elvish/lib")) - (with-output-to-file - (string-append share "/elvish/lib/git-absorb") - (lambda _ (invoke git-absorb "--gen-completions" "elvish"))))))))) + (list + #:install-source? #f + #:modules + '((guix build cargo-build-system) + (guix build utils) + (ice-9 match)) + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'install-manual-page + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (man (string-append out "/share/man/man1"))) + (with-directory-excursion "Documentation" + (invoke "a2x" + "--no-xmllint" + "--doctype=manpage" + "--format=manpage" + "git-absorb.adoc")) + (install-file "Documentation/git-absorb.1" man)))) + (add-after 'install 'install-completions + (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/git-absorb") + (in-vicinity #$output "bin/git-absorb")))) + (with-output-to-file (in-vicinity #$output path) + (lambda _ + (invoke binary "--gen-completions" shell)))))) + '(("bash" . "share/bash-completion/completions/git-absorb") + ("elvish" . "share/elvish/lib/git-absorb") + ("fish" . "share/fish/vendor_completions.d/git-absorb.fish") + ("nushell" . "share/nushell/vendor/autoload/git-absorb") + ("zsh" . "share/zsh/site-functions/_git-absorb")))))))) (native-inputs (append (if (%current-target-system) |
