# -*- 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.7.0 v
go.package          github.com/google/osv-scanner/v2
go.offline_build    no
go.toolchain_min    1.27.0
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  f069901e7c9ef35f928bd0fc6c3a2af6546afdae \
                    sha256  acd8ebbf345a9a04eb299cb8e1339512fd4f2ad402f8f40972edcffa3eb45109 \
                    size    15530468
