# -*- 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           github 1.0

github.setup        ChrisJohnsen tmux-MacOSX-pasteboard 2.9 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
name                tmux-pasteboard
categories          sysutils
license             BSD
maintainers         {larryv @larryv} openmaintainer

description         Wrapper for accessing the OS X pasteboard in tmux sessions
long_description    {*}${description}

depends_run         path:bin/tmux:tmux

checksums           rmd160  05ae8aa8954306409c0430edcd110606b9292ea1 \
                    sha256  880fdc5533e25bb6ad27ce4ac424ed6c537b8351c228e13d196ef66406ea9ef8 \
                    size    17039

use_configure       no
variant universal {}

build.env           CC=${configure.cc} \
                    CFLAGS=-I${prefix}/include \
                    LDFLAGS=-L${prefix}/lib
build.target        reattach-to-user-namespace
build.args          ARCHES="[get_canonical_archs]"

set docdir ${prefix}/share/doc/${name}
destroot {
    xinstall -m 755 -W ${worksrcpath} \
            reattach-to-user-namespace ${destroot}${prefix}/bin

    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} \
            README.md Usage.md ${destroot}${docdir}
}

notes "
Please refer to the tmux-MacOSX-pasteboard documentation for usage\
instructions:

${docdir}/README.md
${github.homepage}/blob/${git.branch}/README.md

${docdir}/Usage.md
${github.homepage}/blob/${git.branch}/Usage.md
"