# -*- 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/github/hub 2.14.2 v
# Delete this on next update to use golang PortGroup's default ('archive')
github.tarball_from tarball
revision            2
categories          devel
platforms           darwin
license             MIT
maintainers         {i0ntempest @i0ntempest} openmaintainer

description         git-wrapper for GitHub specific functionality
long_description    hub is a command line utility which adds GitHub knowledge to git. \
                    It can be used on its own or as a git wrapper.

homepage            https://hub.github.com/

checksums           ${distname}${extract.suffix} \
                        rmd160  6c15b7c5324faa0b41851d3b91fce4fcf9e89bf3 \
                        sha256  afa61617fcd829546e409f0c3478a59fc7325acbf49614efeb1ffea3ea082cda \
                        size    2080163

go.vendors          gopkg.in/yaml.v2 \
                        lock    7b8349ac747c \
                        rmd160  bec791a717843478ab86c1e04b861cfe04757aee \
                        sha256  7c00a60c2ba610d9a922e22243253db28d001062a90fe92a33579906f854baa7 \
                        size    70704 \
                    gopkg.in/check.v1 \
                        lock    20d25e280405 \
                        rmd160  412aa0d109919182ff84259e9b5bbc9f24d78117 \
                        sha256  233f8faf427ce6701ac3427f85c28bc6b6ae7cdc97a303a52873c69999223325 \
                        size    30360 \
                    golang.org/x/text \
                        lock    v0.3.0 \
                        rmd160  81061ce2006da3d6f7a8ef8dae237d65305513d3 \
                        sha256  6243d5bbd9d8550bc44cb58a0d70180f7a3f6767299b490015107b4d27c604ae \
                        size    6102563 \
                    golang.org/x/sys \
                        lock    33da011f77ad \
                        rmd160  73b15586a754ac5b9a6d768743bceb8ad02caac6 \
                        sha256  28a5f8af5b491ba6b01af7cadff04dff3895ab49cb77487b582fa7845d7aadb8 \
                        size    1292881 \
                    golang.org/x/net \
                        lock    2ec189313ef0 \
                        rmd160  f7112287bd337eb9aa322693229f757bc751c89f \
                        sha256  7606107fce1aa1f3b6e1b240a7c2c7bb024a50098ee1a6e75c6219dc4cf6fcf0 \
                        size    1100796 \
                    golang.org/x/crypto \
                        lock    c2843e01d9a2 \
                        rmd160  35481af319848c87b8a91b708c1e045831062227 \
                        sha256  f8e063af716f960d2bc47bac8f0c84e353797f791a955dd52c2a745396e930be \
                        size    1650814 \
                    github.com/shurcooL/sanitized_anchor_name \
                        lock    86672fcb3f95 \
                        rmd160  c4c7d8124c50b6b6fba4246c911d8695dab1ef8b \
                        sha256  87a96491969db13a0eeb7f9274cce0351a6d1ea1c7cdddfd1cc216a1510f6cf3 \
                        size    2061 \
                    github.com/russross/blackfriday \
                        lock    670777b536d3 \
                        rmd160  bd25772aed8331b1ae840a6a2f05d4d03b8d16fe \
                        sha256  50dcf06cb2a6d861558150262f8109a631d7ffab2236ae4f008bc003d57ccd87 \
                        size    79393 \
                    github.com/mitchellh/go-homedir \
                        lock    b8bc1bf76747 \
                        rmd160  5e918bec979c68204903d7051c51ab5b6a8eaca1 \
                        sha256  7ec12f9dbe4f40dc58609708ea1a3fd9aa424023b258d40218153a67a5c87694 \
                        size    3002 \
                    github.com/mattn/go-isatty \
                        lock    v0.0.3 \
                        rmd160  52fa78fd66eb44112b174b03b1dcbe9648059280 \
                        sha256  413ea81dd4dadf78a6713ad12c570577351cf8f4f8db617a8d7ec81c3d99ce09 \
                        size    3369 \
                    github.com/mattn/go-colorable \
                        lock    v0.0.9 \
                        rmd160  7251bb6bf8e5651a52c8e3244d7117918e812f89 \
                        sha256  22ae6fdf63bccd195bf108013ba477c896a11fffdbb3398487914e32e1db9b2a \
                        size    7602 \
                    github.com/kr/text \
                        lock    7cafcd837844 \
                        rmd160  68a125bd657bea2fb332a844a0de33a34adbfd1c \
                        sha256  97972c4c2cc3559684cec09ef0b7c6ebe44f8ae547f9d6d32bd81569c52341ad \
                        size    8587 \
                    github.com/kr/pretty \
                        lock    cfb55aafdaf3 \
                        rmd160  8d589c9fa94eaf4343703da3301b814a0ecf8d55 \
                        sha256  50fc299575f8c8b41d3260391fcc8e43ff7cf033dd43463bfe60d920b370815b \
                        size    8505 \
                    github.com/kballard/go-shellquote \
                        lock    cd60e84ee657 \
                        rmd160  1f83289bc9631bf285377653f0f162525ba346d4 \
                        sha256  114092c9e3f2aad9257496522ff9962d1b4302a68d928bf68272a0e361281925 \
                        size    4207 \
                    github.com/bmizerany/assert \
                        lock    b7ed37b82869 \
                        rmd160  cc0e24c59b3efd76d821706eedb45002a8d7bcaf \
                        sha256  36b96edebdba23f599a9f7db19897fff644f10def6c1609dbaa72202ba666e0f \
                        size    1472 \
                    github.com/atotto/clipboard \
                        lock    bc5958e1c833 \
                        rmd160  ac0c82107f4acaf9feb9b45ce92bb487cf5dee09 \
                        sha256  e073da778b48758d625d667e257b9457d3f7c859d91f2f6f7cbd6396543d0771 \
                        size    3784 \
                    github.com/BurntSushi/toml \
                        lock    v0.3.0 \
                        rmd160  08c91052763fa884c7d88f6b10a03bfbcdea93e8 \
                        sha256  360c150f4ec9f5450feee0009aba9555b6731ca0bbb2ce612c3b7b9173c0d896 \
                        size    41567

pre-build {
    delete ${gopath}/src/github.com/github/hub/vendor
    file mkdir ${gopath}/src/github.com/github/hub/bin
}

build.cmd           "${build.cmd} -o bin/ &&
                     ${build.cmd} -o bin/md2roff ./md2roff-bin &&
                     make man-pages"

destroot {
    xinstall -m 0755 ${worksrcpath}/bin/${name} ${destroot}${prefix}/bin/
    set man-pages ${destroot}${prefix}/share/man/man1
    xinstall -d ${man-pages}
    foreach m [glob -directory ${worksrcpath}/share/man/man1 *.1] {
        xinstall -m 0644 -W ${worksrcpath} ${m} ${man-pages}/
    }
    set bash-completions ${destroot}${prefix}/share/bash-completion/completions
    xinstall -d ${bash-completions}
    xinstall -m 0644 -W ${worksrcpath} etc/hub.bash_completion.sh ${bash-completions}/hub
    set site-functions ${destroot}${prefix}/share/zsh/site-functions
    xinstall -d ${site-functions}
    xinstall -m 0644 -W ${worksrcpath} etc/hub.zsh_completion ${site-functions}/_hub
}

notes "
Using hub feels best when it's aliased as git since
normal git commands will all work.  hub merely adds some sugar.

hub alias displays instructions for the current shell.
With the -s flag, it outputs a script suitable for eval.

You could place this command in your shell startup script:

eval \"\$(hub alias -s)\"
"

github.livecheck.regex  {([^"-]+)}
