# -*- 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.66.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  4269c5a114ceda14fcfa9e0a87a7d33bb71bc494 \
                    sha256  b76261f399ee828524713f2c83d13cd2d2592f20ff5b2536d6c15edc0483be86 \
                    size    2601103

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
}
