1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-06-12 09:14:05 +02:00

gnu: tectonic: Install shell completions.

* gnu/packages/rust-apps.scm (tectonic)[arguments]: Add a phase to
generate the shell completions.

Change-Id: I9a624b1c44770325ff33567181440168c5b9a38f
This commit is contained in:
Efraim Flashner
2026-04-23 16:50:00 +03:00
parent b10d0fdaf0
commit d7f45831cf
+22 -1
View File
@@ -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