# -*- 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.12 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

checksums           rmd160  bc950ce2c62bc1e3b1765157fe815575f50e8763 \
                    sha256  454800bd4f854592bcfe79b161f71d56e35940eb7016e48a26dd356adc9d400a \
                    size    1646100

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/
}
