# -*- 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/magefile/mage 1.17.2 v
go.toolchain_min    1.18
revision            0

homepage            https://magefile.org

description         a Make/rake-like dev tool using Go

long_description    Mage is a make-like build tool using Go. You write \
                    plain-old Go functions, and Mage automatically uses them \
                    as Makefile-like runnable targets.

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

checksums           rmd160  2ad0867a9dd3154c07ff3c921d34d47fe20dcbe5 \
                    sha256  af594292c863a7c0bfe93c35a33a1c441a2dca24c5ade552a96caacf5015efcc \
                    size    8831461

patchfiles          patch-mage-version.diff

build.cmd           ${go.bin} run
build.target        bootstrap.go

# 1.17.x reports its version from debug.ReadBuildInfo, which yields "(devel)"
# for a build from a tarball, so the patch reinstates a stamped value.
post-patch {
    reinplace \
        "s|@VERSION@|${github.tag_prefix}${version}|" \
        ${worksrcpath}/mage/main.go
}

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