diff options
| author | Efraim Flashner <efraim@flashner.co.il> | 2026-04-19 10:04:03 +0300 |
|---|---|---|
| committer | Efraim Flashner <efraim@flashner.co.il> | 2026-04-19 10:17:30 +0300 |
| commit | 5e86b3e1125a9a530d7eab4184bdabf89101cabf (patch) | |
| tree | 74710179779b90486f09cf0eb72590426c6fd80c | |
| parent | d09c3b19e7c7b3e9b8572447b3e12e3aa75ab403 (diff) | |
gnu: storage: Install shell completions.
* gnu/packages/storage.scm (garage)[arguments]: Add a phase to generate
and install the shell completions.
[native-inputs]: When cross-compiling add this package.
Change-Id: Iaf4f90c88ee68520a749de5fe961626d5dc9b579
| -rw-r--r-- | gnu/packages/storage.scm | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/gnu/packages/storage.scm b/gnu/packages/storage.scm index faf3c8a0fe0..d8c19c1945d 100644 --- a/gnu/packages/storage.scm +++ b/gnu/packages/storage.scm | |||
| @@ -566,6 +566,10 @@ applications.") | |||
| 566 | "syslog" | 566 | "syslog" |
| 567 | "telemetry-otlp") | 567 | "telemetry-otlp") |
| 568 | #:install-source? #f | 568 | #:install-source? #f |
| 569 | #:modules | ||
| 570 | '((guix build cargo-build-system) | ||
| 571 | (guix build utils) | ||
| 572 | (ice-9 match)) | ||
| 569 | #:phases | 573 | #:phases |
| 570 | #~(modify-phases %standard-phases | 574 | #~(modify-phases %standard-phases |
| 571 | ;; The 'check phase doesn't honor #:features | 575 | ;; The 'check phase doesn't honor #:features |
| @@ -592,10 +596,31 @@ applications.") | |||
| 592 | "--features" (string-join features))) | 596 | "--features" (string-join features))) |
| 593 | (if (null? cargo-install-paths) | 597 | (if (null? cargo-install-paths) |
| 594 | '(".") | 598 | '(".") |
| 595 | cargo-install-paths))))))) | 599 | cargo-install-paths)))) |
| 596 | (native-inputs (list nss-certs-for-test | 600 | (add-after 'install 'install-completions |
| 597 | pkg-config | 601 | (lambda* (#:key native-inputs #:allow-other-keys) |
| 598 | protobuf)) | 602 | (for-each |
| 603 | (match-lambda | ||
| 604 | ((shell . path) | ||
| 605 | (mkdir-p (in-vicinity #$output (dirname path))) | ||
| 606 | (let ((binary | ||
| 607 | (if #$(%current-target-system) | ||
| 608 | (search-input-file native-inputs "bin/garage") | ||
| 609 | (in-vicinity #$output "bin/garage")))) | ||
| 610 | (with-output-to-file (in-vicinity #$output path) | ||
| 611 | (lambda _ | ||
| 612 | (invoke binary "completions" shell)))))) | ||
| 613 | '(("bash" . "share/bash-completion/completions/garage") | ||
| 614 | ("elvish" . "share/elvish/lib/garage") | ||
| 615 | ("fish" . "share/fish/vendor_completions.d/garage.fish") | ||
| 616 | ("zsh" . "share/zsh/site-functions/_garage")))))))) | ||
| 617 | (native-inputs | ||
| 618 | (append (if (%current-target-system) | ||
| 619 | (list this-package) | ||
| 620 | '()) | ||
| 621 | (list nss-certs-for-test | ||
| 622 | pkg-config | ||
| 623 | protobuf))) | ||
| 599 | (inputs | 624 | (inputs |
| 600 | (cons* libsodium | 625 | (cons* libsodium |
| 601 | lmdb | 626 | lmdb |
