# -*- 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/google/osv-scanner 2.5.1 v
go.package          github.com/google/osv-scanner/v2
go.offline_build    no
go.toolchain_min    1.26.5
revision            0

homepage            https://google.github.io/osv-scanner/

description         \
    Vulnerability scanner which uses the data provided by https://osv.dev

long_description    \
    {*}${description}. ${name} generates a list of dependencies from a \
    project's lockfiles, SBOMs, container images or installed packages, and \
    matches them against the OSV database of known vulnerabilities.

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

# Commit for the ${github.tag_prefix}${version} tag; update with the version
set git_commit      c84fa4568f2526d0333e9a914ea8a0a5f74ad68b

# The package must follow the build flags, so it goes in post_args
build.args-append   -trimpath \
                    -ldflags \" -X ${go.package}/internal/version.OSVVersion=${version} \
                                -X ${go.package}/cmd/${name}/internal/cmd.commit=${git_commit} \"
build.post_args     ./cmd/${name}

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

checksums           rmd160  8c51a0148d29114172d375da82f805f8fa44d6ab \
                    sha256  9a81d802aa0c0f667f8a80a045d4bab058fb9d9a6fb21f5cf2f1ea2007f73eef \
                    size    12982231
