# -*- 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/mikefarah/yq 4.45.1 v
go.package          github.com/mikefarah/yq/v4
github.tarball_from archive
revision            0

homepage            https://mikefarah.gitbook.io/yq

description         \
    yq is a portable command-line YAML processor

long_description    \
    {*}${description}. The aim of the project is to be the jq or sed of yaml \
    files.

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

# use generated man page to avoid build depedency on pandoc
master_sites-append https://github.com/mikefarah/yq/releases/download/v${version}/:yqman
distfiles-append    yq_man_page_only.tar.gz:yqman

build.pre_args-append \
                    -ldflags \"-X ${go.package}/cmd.Version=${version}\"
build.args-append   -o ${name}

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/
    xinstall -d ${destroot}${prefix}/share/man/man1
    xinstall -m 0644 ${workpath}/${name}.1 ${destroot}${prefix}/share/man/man1/

    xinstall -d ${destroot}${prefix}/share/${name}
    xinstall -m 0644 ${worksrcpath}/LICENSE ${destroot}${prefix}/share/${name}
    file copy ${worksrcpath}/examples ${destroot}${prefix}/share/${name}/

    set bash_completion ${prefix}/share/bash-completion/completions
    xinstall -d ${destroot}${bash_completion}
    exec ${destroot}${prefix}/bin/${name} shell-completion bash > \
        ${destroot}${bash_completion}/${name}

    set zsh_completion ${prefix}/share/zsh/site-functions
    xinstall -d ${destroot}${zsh_completion}
    exec ${destroot}${prefix}/bin/${name} shell-completion zsh > \
        ${destroot}${zsh_completion}/_${name}

    set fish_completion ${prefix}/share/fish/vendor_completions.d
    xinstall -d ${destroot}${fish_completion}
    exec ${destroot}${prefix}/bin/${name} shell-completion fish > \
        ${destroot}${fish_completion}/${name}.fish
}

checksums           ${distname}${extract.suffix} \
                        rmd160  36d897af3821a8744194239780256014004bfa56 \
                        sha256  074a21a002c32a1db3850064ad1fc420083d037951c8102adecfea6c5fd96427 \
                        size    299351 \
                    yq_man_page_only.tar.gz \
                        rmd160  a38c7c842b404ecc70093f0bd5c076b310549784 \
                        sha256  3c3a40707480ebb939922690ff38bb236f473aee1d013c3bf5d6d8b7b1ad0edc \
                        size    42042

go.vendors          gopkg.in/yaml.v3 \
                        lock    v3.0.1 \
                        rmd160  e85ac1368fb7f9ef945b7fd7bd608a1f0d261c12 \
                        sha256  f3ea6be3f405ec25f8799773355aba54f8831d11f5315a01155bdc69b92eca7b \
                        size    91208 \
                    gopkg.in/op/go-logging.v1 \
                        lock    b2cb9fa56473 \
                        rmd160  2621efba2352994d2b3a1541c853511b24884e54 \
                        sha256  73acfa44b0fe8e3074d173f04ce164e81b6996327d07d0bec0025df0491e4091 \
                        size    35888 \
                    gopkg.in/check.v1 \
                        lock    20d25e280405 \
                        rmd160  412aa0d109919182ff84259e9b5bbc9f24d78117 \
                        sha256  233f8faf427ce6701ac3427f85c28bc6b6ae7cdc97a303a52873c69999223325 \
                        size    30360 \
                    golang.org/x/text \
                        lock    v0.21.0 \
                        rmd160  0a0d95c777a2df3108c79f5a23de3c226ad84d06 \
                        sha256  de16b0463799b320acfa2707e154091015d4b25dbaae866a8fc9bf2f72d67b5c \
                        size    8976785 \
                    golang.org/x/sys \
                        lock    v0.28.0 \
                        rmd160  6afc12ada3ca9173b9f8ba2c66caf3dbf0ac7929 \
                        sha256  aa8ba4cd13aa5d7f839d604e002d2c994e6dfc09c3746f532bf69fc64617869c \
                        size    1520294 \
                    golang.org/x/net \
                        lock    v0.33.0 \
                        rmd160  c1974416a5379a87b032076f82d4353929b7cf30 \
                        sha256  c9edb767d02ea972c474508028e90d8c2b19a075f89697dbe787860f8dba3aa2 \
                        size    1466556 \
                    golang.org/x/crypto \
                        lock    v0.31.0 \
                        rmd160  ccd79163c4c288444622b7e39560353ba8caef9a \
                        sha256  8c60e95193c8a72264fef36dc5f6a23e69c9a5948680829fcfbe9d28030f9dca \
                        size    1837747 \
                    github.com/yuin/gopher-lua \
                        lock    v1.1.1 \
                        rmd160  05c9f9160a898f43e00a32d83a9f8d344709a962 \
                        sha256  a185651c80c6d28f8c3937f0e6272eb6344efce3605cf8ff430eebe5a1e394d3 \
                        size    170728 \
                    github.com/stretchr/testify \
                        lock    v1.9.0 \
                        rmd160  59147e117812fdf8270ec79e46a229c472caf08d \
                        sha256  e6fa4f530cad5bac94bf08af05ddd1f569aeac8db4017ab4330ab7fe2802a6a3 \
                        size    108716 \
                    github.com/spf13/pflag \
                        lock    v1.0.5 \
                        rmd160  2ce81608a38c6f383a35bccd24d64361df5828c9 \
                        sha256  7f41acdcba65b1fab5b9b633947a139f9915b60f94bdab486cdbe9d90c54f61e \
                        size    50815 \
                    github.com/spf13/cobra \
                        lock    v1.8.1 \
                        rmd160  a735ec73fa26b66076a971e066513fff3eb7e367 \
                        sha256  49ca05093e0452e1b56be8a0765e23fd74be819228f0e1870c759b2e2e8178da \
                        size    192387 \
                    github.com/pmezard/go-difflib \
                        lock    v1.0.0 \
                        rmd160  fc879bfbdef9e3ff50844def58404e2b5a613ab8 \
                        sha256  7cd492737641847266115f3060489a67f63581e521a8ec51efbc280c33fc991f \
                        size    11409 \
                    github.com/pkg/diff \
                        lock    20ebb0f2a09e \
                        rmd160  f8336f7442e9394b64a6aad23a6ae1d6a230dfc4 \
                        sha256  086dfcc0449ef79f412e6308fd2ace2207a8a88cde2c86f13f77635673e08890 \
                        size    200592 \
                    github.com/pelletier/go-toml \
                        lock    v2.2.3 \
                        rmd160  7384ee006e116df0c6a5437d4da3520fd2aac16b \
                        sha256  34218ff07934e45ca6968d1f1052e94c8ed969268ebef9e8c260152c549d3ca1 \
                        size    909291 \
                    github.com/mattn/go-isatty \
                        lock    v0.0.20 \
                        rmd160  ef20ccdf87de8b704c0c7118625b2beb31d8f1b4 \
                        sha256  397549e98cf5d40df585f31dc7902f017c37be88c64311dd2b4aeccab4009949 \
                        size    4717 \
                    github.com/mattn/go-colorable \
                        lock    v0.1.13 \
                        rmd160  c9e8ab9d0773c0984f36235e3c9f8c033552ac1a \
                        sha256  0cd9a951799c1a9f999df56e4b020170fa887456049c274aae6262d9ae3f7424 \
                        size    9778 \
                    github.com/magiconair/properties \
                        lock    v1.8.9 \
                        rmd160  7d9d9da68e1bf44dc43d66de88baf6bfdec126fb \
                        sha256  6ed1fd45b0230449b7379d6ada32918cda0ab4ce2f864b81885dd449bfd525af \
                        size    28409 \
                    github.com/leodido/go-urn \
                        lock    v1.4.0 \
                        rmd160  ceb452492eb72d1cc179f3ea4e068e74ca22be3c \
                        sha256  8002ffa13ae89de5bc4c53b87e23fef9c75d1f09af1ae330022464bcbfef1c8a \
                        size    1998706 \
                    github.com/jinzhu/copier \
                        lock    v0.4.0 \
                        rmd160  65599e8d5280dd006a398bfcab349e2c9a2bbce1 \
                        sha256  41b5aac6de7515accd0c53ac7aa07c92b24e36e338b7602c0442a12bda8e4a0b \
                        size    18301 \
                    github.com/inconshreveable/mousetrap \
                        lock    v1.1.0 \
                        rmd160  88f9577df93ac0f8801d8960adc7f28e38867f3e \
                        sha256  f69af10ff08c0e87f92dac3ee5172d8ed02463725b74edfc8943ef018a1a632d \
                        size    5343 \
                    github.com/hexops/gotextdiff \
                        lock    v1.0.3 \
                        rmd160  074c0503049683deb78ab28932d83837343f4ae9 \
                        sha256  6ff3e645743eb9831a6325dd3edcce1f1f5c2f918c4981cec89143252d5e1dac \
                        size    23250 \
                    github.com/google/go-cmp \
                        lock    v0.6.0 \
                        rmd160  2c9f5dab93f8a0895591466fe4a07c5dd9166ae2 \
                        sha256  0d550825fae514f8a947ab7e42fcb874f509d9cbfa3ad2711d7570a25f31571a \
                        size    104795 \
                    github.com/goccy/go-yaml \
                        lock    v1.13.3 \
                        rmd160  ca945e66a36243b2fa98bb62b3c89f9aa4ed96dd \
                        sha256  71aa2c60536900a78718cefffcfb5c0fdcbe1af11d3f1facde54a98b9816da7c \
                        size    105065 \
                    github.com/goccy/go-json \
                        lock    v0.10.4 \
                        rmd160  7d769ccf8f0bc1946b78514382c66c67aa73b93c \
                        sha256  b53ef0217497d21795d32d1fa361650236b640e956e90d0565a36804d6f3cb8f \
                        size    399170 \
                    github.com/go-playground/validator \
                        lock    v10.22.1 \
                        rmd160  06b2ed9fbfb3ae35683d4175fb1250ed1918ffb8 \
                        sha256  ff5587c5da46e126619ca88cf62a135df324b4ab7cc41e31f303108a52d2f062 \
                        size    270320 \
                    github.com/go-playground/universal-translator \
                        lock    v0.18.1 \
                        rmd160  db17dd09961812609699c2c30016db647c4e18b6 \
                        sha256  4613483514bc2df0f103c7ddbb32341fcf4335874063e967001ed150d1b05325 \
                        size    37150 \
                    github.com/go-playground/locales \
                        lock    v0.14.1 \
                        rmd160  762675a94ea6b0bb97d607041d41f9907e961a9e \
                        sha256  ea9d52236f0db72988de8dccc7cdba8162e7e27ba52d455a2c819d11ddef5a0b \
                        size    4365413 \
                    github.com/gabriel-vasile/mimetype \
                        lock    v1.4.3 \
                        rmd160  7cc45a302c1d936bcaf3cc0343e72206dd59c0b4 \
                        sha256  a64578fd8d2a03e1ef76f8aabcf390baefbf1283815d8a5165e3f71b3889ad73 \
                        size    24986313 \
                    github.com/fatih/color \
                        lock    v1.18.0 \
                        rmd160  cea38fd7fdad5b4b20f519ebd1301bc2c277f54b \
                        sha256  e085d36aabb91de9adfa7ff605a06a342b6bc583e3bbb8ce49605590f4e0bd71 \
                        size    12711 \
                    github.com/elliotchance/orderedmap \
                        lock    v1.7.1 \
                        rmd160  c4cc25c8d95173ab4b204cb9110825dd161e1490 \
                        sha256  c562095c108c13b30b412756bcab91111781094689b75391a27798f0f78f71af \
                        size    18912 \
                    github.com/dimchansky/utfbom \
                        lock    v1.1.1 \
                        rmd160  182248653dc487311900d188180c74962909bd76 \
                        sha256  203f7bd33e56dfc3d1764493615e3171f4fb3edf5ee234628123e464406e77b1 \
                        size    8497 \
                    github.com/davecgh/go-spew \
                        lock    v1.1.1 \
                        rmd160  7c02883aa81f81aca14e13a27fdca9e7fbc136f7 \
                        sha256  e85d6afa83e64962e0d63dd4812971eccf2b9b5445eda93f46a4406f0c177d5f \
                        size    42171 \
                    github.com/alecthomas/repr \
                        lock    v0.4.0 \
                        rmd160  c955864f47bf3039484f1d57200d1331cd0d1987 \
                        sha256  424de5d9d2bb7b6f9b910c7e37f9d4a1a4f45a75b8d5f5eebd6aaca8b7595f6f \
                        size    8511 \
                    github.com/alecthomas/participle \
                        lock    v2.1.1 \
                        rmd160  9c25ce5bb84ff462fa0d73cc347ddfb74465a7d9 \
                        sha256  52492e4bea09b95a105404243f0503f138b33d9c0c4be5891e6931cc8f12ed62 \
                        size    178558 \
                    github.com/alecthomas/assert \
                        lock    v2.3.0 \
                        rmd160  eedc3e436287b78acc158df21a17222de11ca5c4 \
                        sha256  49ddf925cc07dcc607923624c87310b438a52ac6b1698c63f25aa1e3616c20b4 \
                        size    7825 \
                    github.com/a8m/envsubst \
                        lock    v1.4.2 \
                        rmd160  b689c9d8284004e80b378d2e6f7889d7e5310ad1 \
                        sha256  5c3a965cea2d074db5e71f87380a4ca60c3775d39c2e65c63c9a1debde345d93 \
                        size    12314
