From 4b5ac6b226bdf34387ded002647c44a0c63587f8 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sat, 1 Oct 2022 23:46:12 +0300 Subject: gnu: exercism: Install shell completions. * gnu/packages/education.scm (exercism)[arguments]: Add a phase to build and install shell completions. --- gnu/packages/education.scm | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'gnu') diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm index a2607087e5..f16324a2c6 100644 --- a/gnu/packages/education.scm +++ b/gnu/packages/education.scm @@ -1065,7 +1065,28 @@ machine, and more.") (arguments `(#:import-path "github.com/exercism/cli/exercism" #:unpack-path "github.com/exercism/cli" - #:install-source? #f)) + #:install-source? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'install-completions + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bash (string-append out "/etc/bash_completion.d/exercism")) + (fish (string-append + out "/share/fish/vendor_completions.d/exercism.fish")) + (zsh (string-append out "/share/zsh/site-functions/_exercism"))) + (mkdir-p (dirname bash)) + (with-output-to-file bash + (lambda () + (invoke (string-append out "/bin/exercism") "completion" "bash"))) + (mkdir-p (dirname fish)) + (with-output-to-file fish + (lambda () + (invoke (string-append out "/bin/exercism") "completion" "fish"))) + (mkdir-p (dirname zsh)) + (with-output-to-file zsh + (lambda () + (invoke (string-append out "/bin/exercism") "completion" "zsh"))))))))) (inputs `(("github.com/blang/semver" ,go-github-com-blang-semver) ("github.com/spf13/cobra" ,go-github-com-spf13-cobra) -- cgit 1.4.1