# -*- 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/aquasecurity/trivy 0.74.0 v
go.offline_build    no
go.toolchain_min    1.26.3
revision            1

description         \
    A Simple and Comprehensive Vulnerability Scanner for Containers, Suitable \
    for CI

long_description    \
    {*}${description}. Trivy detects vulnerabilities of OS packages (Alpine, \
    RHEL, CentOS, etc.) and application dependencies (Bundler, Composer, npm, \
    yarn, etc.). Trivy is easy to use. Just install the binary and you're \
    ready to scan. All you need to do for scanning is to specify a target \
    such as an image name of the container.

categories          security sysutils
installs_libs       no
license             Apache-2
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer
platforms           darwin linux freebsd

checksums           rmd160  8b76a6634af48c79b75e63f38a8fb8bdd152c9eb \
                    sha256  04268af574690b84bc3474a5f19e002cd6da3e16899fac9fd39c6e84e7843940 \
                    size    56668389

# 0.74.0 uses json.SkipFunc, which Go 1.27 replaced with errors.ErrUnsupported.
depends_build       port:go-1.26
go.bin              ${prefix}/bin/go-1.26

# pkg/x/json imports encoding/json/v2, which is behind an experiment.
build.env-append    CGO_ENABLED=0 GOEXPERIMENT=jsonv2
build.args-append   -trimpath \
                    -ldflags \"-s -w -X ${go.package}/pkg/version/app.ver=${version}\" \
                    ./cmd/${name}

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