# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           golang 1.0

go.setup            github.com/mvdan/sh 3.13.1 v
name                shfmt
categories          devel
maintainers         {amake @amake} openmaintainer
license             BSD

description         Autoformat shell script source code

long_description    A shell script formatter supporting POSIX shell, Bash, and mksh.

go.package          mvdan.cc/sh

checksums           ${distname}${extract.suffix} \
                        rmd160  eab26312ded503dfb142896e37d388168d82d31c \
                        sha256  b31aad2d4c26b0c6e8ebe894d59022520bbebce33e082d7d29e4325eee35d308 \
                        size    255760

go.vendors          mvdan.cc/editorconfig \
                        repo    github.com/mvdan/editorconfig \
                        lock    v0.3.0 \
                        rmd160  2dfecbb0d7f214f64774f5305c3a144a3f1ba4ed \
                        sha256  d19f7976ee4952203276428711a59b00c9e712bf92eb4124701cba0f6c3d2c4f \
                        size    10288 \
                    golang.org/x/tools \
                        lock    v0.38.0 \
                        rmd160  a1379cacf766e03cec012f186de875cf520f8a1c \
                        sha256  506c49799f532ae032c0ce48d04ae359462471166c28e5e9de1c9132b9c96bd5 \
                        size    8277674 \
                    golang.org/x/term \
                        lock    v0.41.0 \
                        rmd160  1ca3505605c1604700a5421204aa5d61594ef0da \
                        sha256  1bde581886ac0719d57bbe95e249648b0a098d74ea154618ff3d0222cb57b022 \
                        size    16451 \
                    golang.org/x/sys \
                        lock    v0.42.0 \
                        rmd160  9bf28fd4fb2566093e52db9828dace0cad68ece6 \
                        sha256  95cce678922f8cd653b53365de74085c97ca91d3f0c1ac20d96df2f0657d4e02 \
                        size    1540175 \
                    golang.org/x/sync \
                        lock    v0.17.0 \
                        rmd160  a00dd5b2e9d83097a0edf5cfd66eed7531542c28 \
                        sha256  9c955ca0cbae984640296cc3c0b01af9ee5a0ad21704e8022436db147b3db955 \
                        size    18199 \
                    golang.org/x/mod \
                        lock    v0.29.0 \
                        rmd160  4b5d8347498106c526b240ee7b778389a4655ce0 \
                        sha256  bd0173fc6b5ae3622d3e0ca88e32f6fb9a510b8792c2027c1264ceb2f922f09e \
                        size    126579 \
                    github.com/rogpeppe/go-internal \
                        lock    v1.14.1 \
                        rmd160  73e6c350ebee85f1124b04a1d0efecfa724a8835 \
                        sha256  32749548af3fe11d55ec86ce24a089e1611224a0e302058695961498e73cac8a \
                        size    116406 \
                    github.com/kr/text \
                        lock    v0.2.0 \
                        rmd160  48558c7e8ff67d510f83c66883907e95f4783163 \
                        sha256  2f2e21ac8a9d523e88cbba4039441defc4a66bfaa78811c900a88fcf28729c4c \
                        size    8702 \
                    github.com/kr/pretty \
                        lock    v0.3.1 \
                        rmd160  8c08579b4c56cdc958794e77afe3413e80aa67c3 \
                        sha256  7fcea475d6280976cf4a838e75d2b3a4105827316e588a80e49e8063d950c999 \
                        size    10232 \
                    github.com/google/renameio/v2 \
                        lock    v2.0.2 \
                        rmd160  f732f7df666d850c1bc535937f5d2c3d4800c1ca \
                        sha256  cebcb82c906875134ef6abe563f7c6597c2f0a68aa08bdb345b6b5c343cc6fe6 \
                        size    15386 \
                    github.com/google/go-cmp \
                        lock    v0.7.0 \
                        rmd160  3f04a79c291d786f9c69c2944bdd521402052a5c \
                        sha256  b621b304b529134076c9ebe09343aea7add039cd98e68be7e5a616245b0c3d03 \
                        size    105180 \
                    github.com/go-quicktest/qt \
                        lock    v1.101.0 \
                        rmd160  33a688f772ef1b90c8f1b3c250a2f9438d1f6c75 \
                        sha256  616b44a001d7852b3f17a7d0f3f64d565396b59f13c33637195ff0c5b302c4a5 \
                        size    27438 \
                    github.com/creack/pty \
                        lock    v1.1.24 \
                        rmd160  a17edbbfce8ff6ed14de8fa5cfe69a5e2dbebbf7 \
                        sha256  e340bd4e994d47d175cd75ffb085d4cea969569399845d9ce86a685b823487b1 \
                        size    21102

build.pre_args      -ldflags \"-w -s -extldflags '-static'\"
build.post_args     ${go.package}/cmd/shfmt

depends_build-append  port:scdoc

post-build {
    system -W ${worksrcpath} "scdoc < cmd/shfmt/shfmt.1.scd | gzip > shfmt.1.gz"
}

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin
    xinstall -m 0644 ${worksrcpath}/shfmt.1.gz ${destroot}${prefix}/share/man/man1
}

github.livecheck.regex  {([0-9.]+)}
