diff options
| author | Andrew Wong <wongandj@icloud.com> | 2025-04-18 00:06:13 -0400 |
|---|---|---|
| committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2025-06-26 12:09:48 +0100 |
| commit | 03eec7034fa856b77ec5d6c23bb6240efcb23922 (patch) | |
| tree | 36cef243b9ecaa4b35e8ee6060b63a3a5115cacb /gnu | |
| parent | 7b19f8d712847348480735d011c4cab6d9e1c9d0 (diff) | |
gnu: trash-cli: Install shell completions.
* gnu/packages/shellutils.scm (trash-cli) [arguments] <#:phases>: Add
'install-completions.
Change-Id: I0b165155d1da8069837bd9b93990dfaf0ff7de52
Reviewed-by: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/shellutils.scm | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm index 33336e66944..769eea0b299 100644 --- a/gnu/packages/shellutils.scm +++ b/gnu/packages/shellutils.scm | |||
| @@ -660,6 +660,9 @@ between various shells or commands.") | |||
| 660 | (build-system python-build-system) | 660 | (build-system python-build-system) |
| 661 | (arguments | 661 | (arguments |
| 662 | (list | 662 | (list |
| 663 | #:modules `((guix build python-build-system) | ||
| 664 | (guix build utils) | ||
| 665 | (ice-9 match)) | ||
| 663 | #:phases #~(modify-phases %standard-phases | 666 | #:phases #~(modify-phases %standard-phases |
| 664 | (add-before 'build 'fix-setup.py | 667 | (add-before 'build 'fix-setup.py |
| 665 | (lambda* (#:key outputs #:allow-other-keys) | 668 | (lambda* (#:key outputs #:allow-other-keys) |
| @@ -674,7 +677,36 @@ between various shells or commands.") | |||
| 674 | (replace 'check | 677 | (replace 'check |
| 675 | (lambda* (#:key tests? #:allow-other-keys) | 678 | (lambda* (#:key tests? #:allow-other-keys) |
| 676 | (when tests? | 679 | (when tests? |
| 677 | (invoke "pytest"))))))) | 680 | (invoke "pytest")))) |
| 681 | (add-before 'wrap 'install-completions | ||
| 682 | (lambda _ | ||
| 683 | (for-each | ||
| 684 | (lambda (binary) | ||
| 685 | (for-each | ||
| 686 | (match-lambda | ||
| 687 | ((shell . path) | ||
| 688 | (mkdir-p (dirname path)) | ||
| 689 | (with-output-to-file path | ||
| 690 | (lambda _ | ||
| 691 | (invoke | ||
| 692 | (string-append #$output "/bin/" binary) | ||
| 693 | "--print-completion" shell))))) | ||
| 694 | `(("bash" . | ||
| 695 | ,(format ;format string must be literal | ||
| 696 | #f "~a/share/bash-completion/completions/~a" | ||
| 697 | #$output binary)) | ||
| 698 | ("zsh" . | ||
| 699 | ,(format #f "~a/share/zsh/site-functions/_~a" | ||
| 700 | #$output binary)) | ||
| 701 | ("tcsh" . | ||
| 702 | ,(format #f "~a/etc/profile.d/~a.completion.csh" | ||
| 703 | #$output binary))))) | ||
| 704 | (list "trash" | ||
| 705 | "trash-empty" | ||
| 706 | "trash-list" | ||
| 707 | "trash-put" | ||
| 708 | "trash-restore" | ||
| 709 | "trash-rm"))))))) | ||
| 678 | (native-inputs (list python-flexmock | 710 | (native-inputs (list python-flexmock |
| 679 | python-mock | 711 | python-mock |
| 680 | python-parameterized | 712 | python-parameterized |
