# -*- 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/gopasspw/gopass 1.17.0 v
go.toolchain_min    1.25.0
go.offline_build    no
revision            0
categories          security
maintainers         {@sikmir disroot.org:sikmir} \
                    {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer
platforms           {darwin >= 23}
license             MIT

description         The slightly more awesome Standard Unix Password Manager for Teams
long_description    {*}${description}
homepage            https://www.gopass.pw

depends_lib-append  port:gnupg2

checksums           rmd160  c49e037b8260146a39edb4e811c74be6c3531477 \
                    sha256  ce004c82b65ffac44de2991020843828b38bb510909506f2fa0f40bec05b7c75 \
                    size    3153916

set go_ldflags      "-s -w -X main.version=${version}"
build.args          -ldflags \"${go_ldflags}\" -tags=netgo

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

    # Install shell completions
    xinstall -d ${destroot}${prefix}/share/bash-completion/completions
    xinstall -m 0644 ${worksrcpath}/bash.completion \
        ${destroot}${prefix}/share/bash-completion/completions/${name}

    xinstall -d ${destroot}${prefix}/share/fish/vendor_completions.d/
    xinstall -m 0644 ${worksrcpath}/fish.completion \
        ${destroot}${prefix}/share/fish/vendor_completions.d/${name}.fish

    xinstall -d ${destroot}${prefix}/share/zsh/site-functions
    xinstall -m 0644 ${worksrcpath}/zsh.completion \
        ${destroot}${prefix}/share/zsh/site-functions/_${name}
}
