# -*- 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.11 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  3dab523df818a4bd513558ceb1c639413cde8a52 \
                    sha256  a2c073d2aac12e9fe6b5b82f0bc1780d08b04bd6a331958cd783e46ee48e9cdf \
                    size    1640699

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