# -*- 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/jesseduffield/lazygit 0.66.3 v
# upstream has a branch named like the v0.66.3 tag, which makes
# archive/<tag> ambiguous (HTTP 300); refs/tags names the tag (https://trac.macports.org/ticket/70652)
github.master_sites ${github.homepage}/archive/refs/tags/${git.branch}
go.toolchain_min    1.25.0
revision            0

description         A simple terminal UI for git commands, written in Go
long_description    {*}$description

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

checksums           rmd160  a8ce838563aedcee352df441f0334e30be72ea4c \
                    sha256  49e80d28e03e53048105f6ebb5afefbe5caacffa8549347d8a59eab3a00dafe1 \
                    size    5160892

# lazygit's dependencies are already vendored in the source code
# Allow Go modules so that we can build vendored dependencies
build.env-delete        GO111MODULE=off
build.pre_args-append   -mod=vendor
build.args              -ldflags \" \
                            -X main.version=${version} \
                            -X main.buildSource=macports \
                        \"

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/
    file copy ${worksrcpath}/docs ${destroot}${prefix}/share/doc/${name}
}
