mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 12:05:19 -06:00
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>
This commit is contained in:
parent
7b19f8d712
commit
03eec7034f
1 changed files with 33 additions and 1 deletions
|
|
@ -660,6 +660,9 @@ between various shells or commands.")
|
|||
(build-system python-build-system)
|
||||
(arguments
|
||||
(list
|
||||
#:modules `((guix build python-build-system)
|
||||
(guix build utils)
|
||||
(ice-9 match))
|
||||
#:phases #~(modify-phases %standard-phases
|
||||
(add-before 'build 'fix-setup.py
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
|
|
@ -674,7 +677,36 @@ between various shells or commands.")
|
|||
(replace 'check
|
||||
(lambda* (#:key tests? #:allow-other-keys)
|
||||
(when tests?
|
||||
(invoke "pytest")))))))
|
||||
(invoke "pytest"))))
|
||||
(add-before 'wrap 'install-completions
|
||||
(lambda _
|
||||
(for-each
|
||||
(lambda (binary)
|
||||
(for-each
|
||||
(match-lambda
|
||||
((shell . path)
|
||||
(mkdir-p (dirname path))
|
||||
(with-output-to-file path
|
||||
(lambda _
|
||||
(invoke
|
||||
(string-append #$output "/bin/" binary)
|
||||
"--print-completion" shell)))))
|
||||
`(("bash" .
|
||||
,(format ;format string must be literal
|
||||
#f "~a/share/bash-completion/completions/~a"
|
||||
#$output binary))
|
||||
("zsh" .
|
||||
,(format #f "~a/share/zsh/site-functions/_~a"
|
||||
#$output binary))
|
||||
("tcsh" .
|
||||
,(format #f "~a/etc/profile.d/~a.completion.csh"
|
||||
#$output binary)))))
|
||||
(list "trash"
|
||||
"trash-empty"
|
||||
"trash-list"
|
||||
"trash-put"
|
||||
"trash-restore"
|
||||
"trash-rm")))))))
|
||||
(native-inputs (list python-flexmock
|
||||
python-mock
|
||||
python-parameterized
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue