# -*- 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/golangci/golangci-lint 2.13.1 v
revision            0

homepage            https://golangci-lint.run

description         Fast linters runner for Go.

long_description    \
    GolangCI-Lint is a fast linters runner for Go that runs linters in \
    parallel, uses caching, and supports YAML configuration. It includes \
    over 100 linters, integrates with major IDEs, has minimal false \
    positives, and supports multiple output formats.

categories          devel
installs_libs       no
license             GPL-3
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    {@steenzout} \
                    openmaintainer

checksums           rmd160  c4961cf195d0976b1b26f6da68dfddab60573eac \
                    sha256  1e132dc546c90611af81eede4c213018a542ff33e4c10eadab5d964854e0d9ae \
                    size    5488112

# date is the release commit's date; refresh it on every update.
build.args          -trimpath \
                    -ldflags="-X main.version=v${version} -X main.commit=v${version} -X main.date=20260820" \
                    ./cmd/golangci-lint

# FIXME: This port currently can't be built without allowing go mod to fetch
# dependencies during the build phase. See
# https://trac.macports.org/ticket/61192
go.offline_build no
go.toolchain_min    1.26.0

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/${name}

    xinstall -d ${destroot}${prefix}/share/bash-completion/completions
    system -W ${destroot} \
        ".${prefix}/bin/${name} completion bash > \
         .${prefix}/share/bash-completion/completions/${name}"

    xinstall -d ${destroot}${prefix}/share/fish/vendor_completions.d
    system -W ${destroot} \
        ".${prefix}/bin/${name} completion fish > \
         .${prefix}/share/fish/vendor_completions.d/${name}.fish"

    xinstall -d ${destroot}${prefix}/share/zsh/site-functions
    system -W ${destroot} \
        ".${prefix}/bin/${name} completion zsh > \
         .${prefix}/share/zsh/site-functions/_${name}"
}
