# -*- 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/cashapp/hermit 0.52.3 v
go.toolchain_min    1.25.0
go.offline_build    no
revision            0

homepage            https://cashapp.github.io/hermit

description         Hermit manages isolated, self-bootstrapping sets of tools \
                    in software projects.

long_description    {*}${description} Hermit installs tools for software \
                    projects in self-contained, isolated sets, so your team, \
                    your contributors, and your CI have the same consistent \
                    tooling.

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

checksums           rmd160  e5d6b951248e214b993dc270a6424ccef4ebcf56 \
                    sha256  1767bcb83352618f40f0e377d9df9bd199d342a0e2906ecd261c44dfc631f5a6 \
                    size    1219453

# 0.52.3 replaced the Makefile with a Justfile, whose build recipe is a single
# go build followed by a gzip. Build directly rather than depend on just.
build.env-append    CGO_ENABLED=0
build.pre_args-append \
                    -ldflags \" \
                        -X main.version=${github.tag_prefix}${version} \
                        -X main.channel=stable \
                    \"
build.args-append   -o ${name} ./cmd/${name}

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