diff options
| author | Efraim Flashner <efraim@flashner.co.il> | 2026-02-23 10:23:16 +0200 |
|---|---|---|
| committer | Efraim Flashner <efraim@flashner.co.il> | 2026-02-23 10:41:19 +0200 |
| commit | a5428016964cdce3fd3d349711a910d8f818485d (patch) | |
| tree | e07685a9ca9ddd4bd65510d31a6677d1109d8c9c /gnu/packages/rust-apps.scm | |
| parent | b33485859f3ec46ed0465ad86c3dad6c69c472d8 (diff) | |
gnu: forgejo-cli: Install shell completions.
* gnu/packages/rust-apps.scm (forgejo-cli)[arguments]: Add a phase to
generate the shell completions.
[native-inputs]: When cross-compiling add forgejo-cli.
Change-Id: I6a22ef1b34c833d89244554d8e13b8287b2318ea
Diffstat (limited to 'gnu/packages/rust-apps.scm')
| -rw-r--r-- | gnu/packages/rust-apps.scm | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index a32a378ac2b..a6ee0d03b55 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -1266,8 +1266,39 @@ defaults for 80% of the use cases.") (base32 "1xsqcq6fyhvc4q3f79745lmx1afan5a58d2w920j7hmnczpgz6hh")))) (build-system cargo-build-system) (arguments - (list #:install-source? #f)) - (native-inputs (list pkg-config)) + (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-completions + (lambda* (#:key native-inputs #:allow-other-keys) + (setenv "HOME" (getcwd)) + (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/fj") + (in-vicinity #$output "bin/fj")))) + (with-output-to-file (in-vicinity #$output path) + (lambda _ + (invoke binary "completion" shell)))))) + '(("bash" . "share/bash-completion/completions/fj") + ("elvish" . "share/elvish/lib/fj") + ("fish" . "share/fish/vendor_completions.d/fj.fish") + ("nushell" . "share/nushell/vendor/autoload/fj") + ("zsh" . "share/zsh/site-functions/_fj")))))))) + (native-inputs + (append + (if (%current-target-system) + (list this-package) + '()) + (list pkg-config))) (inputs (cons* libgit2-1.9 libssh2 |
