diff options
| author | Efraim Flashner <efraim@flashner.co.il> | 2026-04-23 16:50:00 +0300 |
|---|---|---|
| committer | Efraim Flashner <efraim@flashner.co.il> | 2026-04-24 15:01:09 +0300 |
| commit | d7f45831cfe01062e130124ce3efd9dc40abfcd3 (patch) | |
| tree | ec544aa0a99a7add919661fade59a03c2f27e0a9 /gnu | |
| parent | b10d0fdaf0dc48e1ea005bf15665f5cc9ab3f1f2 (diff) | |
gnu: tectonic: Install shell completions.
* gnu/packages/rust-apps.scm (tectonic)[arguments]: Add a phase to
generate the shell completions.
Change-Id: I9a624b1c44770325ff33567181440168c5b9a38f
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/rust-apps.scm | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index 712ac88299..91f3e3e132 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -3419,6 +3419,10 @@ diagnostics, autocompletion, documentation, and formatting.") (arguments (list #:install-source? #f + #:modules + '((guix build cargo-build-system) + (guix build utils) + (ice-9 match)) #:cargo-install-paths ''(".") #:features '(list "external-harfbuzz") #:cargo-test-flags '(list "--features" "external-harfbuzz" @@ -3430,7 +3434,24 @@ diagnostics, autocompletion, documentation, and formatting.") (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (doc (string-append out "/share/doc/" #$name "-" #$version))) - (copy-recursively "docs/src" doc))))))) + (copy-recursively "docs/src" doc)))) + (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/tectonic") + (in-vicinity #$output "bin/tectonic")))) + (with-output-to-file (in-vicinity #$output path) + (lambda _ + (invoke binary "-X" "show" "shell-completions" shell)))))) + '(("bash" . "share/bash-completion/completions/tectonic") + ("elvish" . "share/elvish/lib/tectonic") + ("fish" . "share/fish/vendor_completions.d/tectonic.fish") + ("zsh" . "share/zsh/site-functions/_tectonic")))))))) (native-inputs (list pkg-config)) (inputs |
