# -*- 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/k1LoW/gh-grep 1.2.5 v
go.offline_build    no
go.toolchain_min    1.23.0
revision            0

description         Find lines matching a pattern within Github repositories \
                    using the GitHub API

long_description    {*}${description}

categories          devel textproc
installs_libs       no
license             MIT
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  8f43e638d980371b372e5b7883956b84660ddc43 \
                    sha256  e8ca23c20693a989295422661507bb99d20ae18e14ce49f670525ae2b3f71dc0 \
                    size    23291

build.pre_args-append \
    -ldflags \
    \"-X ${go.package}/version.Version=${github.tag_prefix}${version} \
      -X ${go.package}/gh-grep.version=${github.tag_prefix}${version}\"

# The source tree ships a `gh-grep` shell script -- the gh(1) extension
# entry point -- in the same directory `go build` would write its binary to.
# Go refuses to overwrite a file that is not an object, so build to a
# distinct name and install that.
build.args-append   -o ${name}.bin

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