# -*- 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/twpayne/chezmoi 2.71.0 v
go.offline_build    no
revision            0

homepage            https://chezmoi.io

description         Manage your dotfiles across multiple machines, securely.

long_description    ${name} helps you manage your personal configuration \
                    files (dotfiles, like ~/.bashrc) across multiple machines.

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

checksums           rmd160  9c6aa9206ab0e8ebe98f8b74c65cfd96c3d82ec5 \
                    sha256  77f85f4d164f8ce0fc784b5d6ca86b0576a00729c5b23a113b92665e0509f252 \
                    size    2598600

build.cmd           make
build.pre_args-append \
                    BUILT_BY=macports \
                    VERSION="${github.tag_prefix}${version}"
build.args          build

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

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

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

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