[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/05: gnu: nim: Install shell completions.
From: |
guix-commits |
Subject: |
02/05: gnu: nim: Install shell completions. |
Date: |
Wed, 3 Aug 2022 13:11:38 -0400 (EDT) |
efraim pushed a commit to branch master
in repository guix.
commit d50f8b7ddc913a0d89af891846564777bdf1bc9c
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Wed Aug 3 18:20:53 2022 +0300
gnu: nim: Install shell completions.
* gnu/packages/nim.scm (nim)[arguments]: Add custom 'install-completions
phase to install shell completion scripts.
---
gnu/packages/nim.scm | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/nim.scm b/gnu/packages/nim.scm
index 321f4d3e3e..cf6d19c518 100644
--- a/gnu/packages/nim.scm
+++ b/gnu/packages/nim.scm
@@ -77,7 +77,22 @@
(invoke "./install.sh" bin)
(for-each (lambda (file)
(install-file file bin))
- (delete "testament" (find-files "bin")))))))))
+ (delete "testament" (find-files "bin"))))))
+ (add-after 'install 'install-completions
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((share (string-append (assoc-ref outputs "out")
"/share"))
+ (bash (string-append share
"/bash-completion/completions"))
+ (zsh (string-append share "/zsh/vendor_completions")))
+ (mkdir-p bash)
+ (mkdir-p zsh)
+ (copy-file "tools/nim.bash-completion"
+ (string-append bash "/nim"))
+ (copy-file "dist/nimble/nimble.bash-completion"
+ (string-append bash "/nimble"))
+ (copy-file "tools/nim.zsh-completion"
+ (string-append zsh "/_nim"))
+ (copy-file "dist/nimble/nimble.bash-completion"
+ (string-append zsh "/_nimble"))))))))
(home-page "https://nim-lang.org")
(synopsis "Statically-typed, imperative programming language")
(description "Nim (formerly known as Nimrod) is a statically-typed,