mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-26 06:18:07 -05:00
gnu: Add shfmt.
* gnu/packages/golang.scm (shfmt): New variable. Change-Id: I7c8bcb0f0a1d0c45d5f8f2274724188a435f0cd7 Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
parent
c08fc11527
commit
064a6e1f90
1 changed files with 56 additions and 0 deletions
|
@ -19,6 +19,7 @@
|
|||
;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@riseup.net>
|
||||
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
|
||||
;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
||||
;;; Copyright © 2024 Brian Kubisiak <brian@kubisiak.com>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -53,6 +54,7 @@ (define-module (gnu packages shellutils)
|
|||
#:use-module (gnu packages flex)
|
||||
#:use-module (gnu packages golang)
|
||||
#:use-module (gnu packages golang-build)
|
||||
#:use-module (gnu packages golang-check)
|
||||
#:use-module (gnu packages golang-xyz)
|
||||
#:use-module (gnu packages libunistring)
|
||||
#:use-module (gnu packages ncurses)
|
||||
|
@ -402,6 +404,60 @@ (define-public sh-z
|
|||
(home-page "https://github.com/rupa/z")
|
||||
(license license:expat)))
|
||||
|
||||
(define-public shfmt
|
||||
(package
|
||||
(name "shfmt")
|
||||
(version "3.9.0")
|
||||
(source
|
||||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/mvdan/sh")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32 "0qqrggliwicmrqzwv9ivg7w1chy1b97w8p7ifpvqfsbal0qcr1xi"))))
|
||||
(build-system go-build-system)
|
||||
(arguments
|
||||
(list
|
||||
#:install-source? #f
|
||||
#:import-path "mvdan.cc/sh/v3/cmd/shfmt"
|
||||
#:unpack-path "mvdan.cc/sh/v3"
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'unpack 'set-version
|
||||
(lambda* (#:key unpack-path #:allow-other-keys)
|
||||
(with-directory-excursion (string-append "src/" unpack-path)
|
||||
(let ((fixed-version (string-append #$version " (GNU Guix)")))
|
||||
;; shfmt uses modules to look up the version at runtime;
|
||||
;; since our build system does not yet support modules,
|
||||
;; inject the version string here instead
|
||||
(substitute* "cmd/shfmt/main.go"
|
||||
(("version = \"\\(devel\\)\"")
|
||||
(format #f "version = \"~a\"" fixed-version)))
|
||||
(substitute* "cmd/shfmt/testdata/script/flags.txtar"
|
||||
(("devel\\|v3") #$version)))))))))
|
||||
(native-inputs
|
||||
(list go-github-com-creack-pty
|
||||
go-github-com-frankban-quicktest
|
||||
go-github-com-google-go-cmp
|
||||
go-github-com-google-renameio-v2
|
||||
go-github-com-pkg-diff
|
||||
go-github-com-rogpeppe-go-internal
|
||||
go-golang-org-x-sync
|
||||
go-golang-org-x-sys
|
||||
go-golang-org-x-term
|
||||
go-mvdan-cc-editorconfig))
|
||||
(home-page "https://github.com/mvdan/sh")
|
||||
(synopsis "Shell formatter with bash support")
|
||||
(description
|
||||
"This package provides a shell formatter. Supports
|
||||
@url{https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html,POSIX
|
||||
Shell}, @url{https://www.gnu.org/software/bash/,Bash}, and
|
||||
@url{http://www.mirbsd.org/mksh.htm,mksh}.")
|
||||
(license license:bsd-3)))
|
||||
|
||||
|
||||
(define-public envstore
|
||||
(package
|
||||
(name "envstore")
|
||||
|
|
Loading…
Reference in a new issue