gnu: exercism: Improve package.

* gnu/packages/education.scm (exercism): Apply G-expressions. Move all
inputs to native-inputs.

Change-Id: I9fc0956a5403abb5d1dc1adaad1c35f6089bb67d
This commit is contained in:
Sharlatan Hellseher 2025-06-26 22:59:13 +01:00
parent 444f93ebf6
commit 0842b49f44
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -1121,36 +1121,41 @@ machine, and more.")
(commit (string-append "v" version)))) (commit (string-append "v" version))))
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32 "0shh84g7j977kn9kcm09rj3lz6a3y5qq9yvklsldgb9zvass5szd"))
"0shh84g7j977kn9kcm09rj3lz6a3y5qq9yvklsldgb9zvass5szd"))
(patches (search-patches "exercism-disable-self-update.patch")))) (patches (search-patches "exercism-disable-self-update.patch"))))
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
`(#:import-path "github.com/exercism/cli/exercism" (list
#:unpack-path "github.com/exercism/cli"
#:install-source? #f #:install-source? #f
#:import-path "github.com/exercism/cli/exercism"
#:unpack-path "github.com/exercism/cli"
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'install 'install-completions (add-after 'install 'install-completions
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((exercism (string-append #$output "/bin/exercism"))
(bash (string-append out "/etc/bash_completion.d/exercism")) (bash (string-append
#$output
"/etc/bash_completion.d/exercism"))
(fish (string-append (fish (string-append
out "/share/fish/vendor_completions.d/exercism.fish")) #$output
(zsh (string-append out "/share/zsh/site-functions/_exercism"))) "/share/fish/vendor_completions.d/exercism.fish"))
(zsh (string-append
#$output
"/share/zsh/site-functions/_exercism")))
(mkdir-p (dirname bash)) (mkdir-p (dirname bash))
(with-output-to-file bash (with-output-to-file bash
(lambda () (lambda ()
(invoke (string-append out "/bin/exercism") "completion" "bash"))) (invoke exercism "completion" "bash")))
(mkdir-p (dirname fish)) (mkdir-p (dirname fish))
(with-output-to-file fish (with-output-to-file fish
(lambda () (lambda ()
(invoke (string-append out "/bin/exercism") "completion" "fish"))) (invoke exercism "completion" "fish")))
(mkdir-p (dirname zsh)) (mkdir-p (dirname zsh))
(with-output-to-file zsh (with-output-to-file zsh
(lambda () (lambda ()
(invoke (string-append out "/bin/exercism") "completion" "zsh"))))))))) (invoke exercism "completion" "zsh")))))))))
(inputs (native-inputs
(list go-github-com-blang-semver (list go-github-com-blang-semver
go-github-com-spf13-cobra go-github-com-spf13-cobra
go-github-com-spf13-pflag go-github-com-spf13-pflag
@ -1159,8 +1164,9 @@ machine, and more.")
go-golang-org-x-text)) go-golang-org-x-text))
(home-page "https://exercism.org/") (home-page "https://exercism.org/")
(synopsis "Mentored learning for programming languages") (synopsis "Mentored learning for programming languages")
(description "Commandline client for exercism.io, a free service providing (description
mentored learning for programming languages.") "Commandline client for exercism.io, a free service providing mentored
learning for programming languages.")
(license license:expat))) (license license:expat)))
(define-public mazo (define-public mazo