# -*- 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/rhysd/actionlint 1.7.8 v
revision            0

# go.vendors doesn't yet support go.yaml.in/yaml, which is the new home for go-yaml
# (github.com/yaml/go-yaml) used by this version of actionlint. Until this is resolved, we
# can't do offline builds.
go.offline_build    no

description         Static checker for GitHub Actions workflow files

long_description    {*}${description}

categories          devel
installs_libs       no
license             MIT
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

build.cmd           make
build.target        build

depends_build-append \
    port:go-md2man

patch {
    reinplace \
        "s|go build|go build -ldflags '-X ${go.package}.version=v${version}'|" \
        ./Makefile
}

post-build {
    system -W ${worksrcpath}/man "go-md2man -in ${name}.1.ronn -out ${name}.1"
}

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

checksums           ${distname}${extract.suffix} \
                        rmd160  ec429ad097ea22ca9b254a3b997b842a30d322f3 \
                        sha256  1c1e058ed2202e342f474c6ec1a18164cd60473f61163b78a6afb5aff4fac4bc \
                        size    1611073
