diff options
| author | Efraim Flashner <efraim@flashner.co.il> | 2026-02-23 11:35:58 +0200 |
|---|---|---|
| committer | Efraim Flashner <efraim@flashner.co.il> | 2026-02-23 11:35:58 +0200 |
| commit | 6f0395fd9b57e0fdb32187f0decc7e3f34d97cb3 (patch) | |
| tree | 68ca95e71a2aa519ce237a46fa674e24cf4a46b1 /gnu/packages/shellutils.scm | |
| parent | 94fb1eacc978a003f245d4795e6478f4df1d9a71 (diff) | |
gnu: pay-respects: Install shell completions.
* gnu/packages/shellutils.scm (pay-respects)[arguments]: Add a phase to
generate the shell completions.
[native-inputs]: When cross-compiling add pay-respects.
Change-Id: I150fd240283ae3b3994b5e8e6028ed7d6b359d9d
Diffstat (limited to 'gnu/packages/shellutils.scm')
| -rw-r--r-- | gnu/packages/shellutils.scm | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm index 6fbd60ae2a9..17a4e4fa7de 100644 --- a/gnu/packages/shellutils.scm +++ b/gnu/packages/shellutils.scm | |||
| @@ -1183,7 +1183,42 @@ shell with fzf, enabling fuzzy finding and multi-selection.") | |||
| 1183 | (sha256 | 1183 | (sha256 |
| 1184 | (base32 "0nmh5kkjhsrmhwlb09wvg6chzpl7w7xq1qr1yy9gc202yrv6cnmk")))) | 1184 | (base32 "0nmh5kkjhsrmhwlb09wvg6chzpl7w7xq1qr1yy9gc202yrv6cnmk")))) |
| 1185 | (build-system cargo-build-system) | 1185 | (build-system cargo-build-system) |
| 1186 | (arguments (list #:install-source? #f)) | 1186 | (arguments |
| 1187 | (list | ||
| 1188 | #:install-source? #f | ||
| 1189 | #:modules | ||
| 1190 | '((guix build cargo-build-system) | ||
| 1191 | (guix build utils) | ||
| 1192 | (ice-9 match)) | ||
| 1193 | #:phases | ||
| 1194 | #~(modify-phases %standard-phases | ||
| 1195 | (add-after 'install 'install-completions | ||
| 1196 | (lambda* (#:key native-inputs #:allow-other-keys) | ||
| 1197 | (for-each | ||
| 1198 | (match-lambda | ||
| 1199 | ((shell . path) | ||
| 1200 | (mkdir-p (in-vicinity #$output (dirname path))) | ||
| 1201 | (let ((binary | ||
| 1202 | (if #$(%current-target-system) | ||
| 1203 | (search-input-file native-inputs "bin/pay-respects") | ||
| 1204 | (in-vicinity #$output "bin/pay-respects")))) | ||
| 1205 | (with-output-to-file (in-vicinity #$output path) | ||
| 1206 | (lambda _ | ||
| 1207 | (invoke binary shell))) | ||
| 1208 | ;; The shell completions call the binary so we make sure | ||
| 1209 | ;; that we call the correct binary. | ||
| 1210 | (when #$(%current-target-system) | ||
| 1211 | (substitute* (in-vicinity #$output path) | ||
| 1212 | (((search-input-file native-inputs "bin/pay-respects")) | ||
| 1213 | (in-vicinity #$output "bin/pay-respects"))))))) | ||
| 1214 | '(("bash" . "share/bash-completion/completions/pay-respects") | ||
| 1215 | ("fish" . "share/fish/vendor_completions.d/pay-respects.fish") | ||
| 1216 | ("nushell" . "share/nushell/vendor/autoload/pay-respects") | ||
| 1217 | ("zsh" . "share/zsh/site-functions/_pay-respects")))))))) | ||
| 1218 | (native-inputs | ||
| 1219 | (if (%current-target-system) | ||
| 1220 | (list this-package) | ||
| 1221 | '())) | ||
| 1187 | (inputs (cargo-inputs 'pay-respects)) | 1222 | (inputs (cargo-inputs 'pay-respects)) |
| 1188 | (home-page "https://codeberg.org/iff/pay-respects") | 1223 | (home-page "https://codeberg.org/iff/pay-respects") |
| 1189 | (synopsis "Suggest correction for mistyped console commands") | 1224 | (synopsis "Suggest correction for mistyped console commands") |
