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

name                magic-wormhole
version             0.19.2
revision            0
python.rootname     [string map {- _} ${python.rootname}]

homepage            https://magic-wormhole.readthedocs.io

description         Securely transfer data between computers.
long_description    {*}${description} This package provides a library and a \
                    command-line tool named wormhole, which makes it possible \
                    to get arbitrary-sized files and directories (or short \
                    pieces of text) from one computer to another. The two \
                    endpoints are identified by using identical \
                    “wormhole codes”: in general, the sending machine \
                    generates and displays the code, which must then be typed \
                    into the receiving machine.

categories          net python sysutils
platforms           {darwin any}
supported_archs     noarch
license             MIT

maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  0ee4ee4c8df299d4cb5eda8c3c96b2eebb3cec2c \
                    sha256  b2b4a78acf09ff4cfc503a238f674394a5e735fa08dcd54519243ffc67f97c71 \
                    size    304264

python.default_version \
                    313

depends_build-append \
                    port:py${python.version}-setuptools \
                    port:py${python.version}-versioneer

depends_lib-append  port:libsodium \
                    port:py${python.version}-attrs \
                    port:py${python.version}-autobahn \
                    port:py${python.version}-automat \
                    port:py${python.version}-click \
                    port:py${python.version}-hkdf \
                    port:py${python.version}-humanize \
                    port:py${python.version}-iterable-io \
                    port:py${python.version}-pynacl \
                    port:py${python.version}-qrcode \
                    port:py${python.version}-six \
                    port:py${python.version}-spake2 \
                    port:py${python.version}-tqdm \
                    port:py${python.version}-txtorcon \
                    port:py${python.version}-twisted \
                    port:py${python.version}-zipstream-ng

post-destroot {
    set comp_path(bash) ${destroot}${prefix}/share/bash-completion/completions/[lindex [split ${name} -] 1]
    set comp_path(fish) ${destroot}${prefix}/share/fish/completions/[lindex [split ${name} -] 1].fish
    set comp_path(zsh)  ${destroot}${prefix}/share/zsh/site-functions/_[lindex [split ${name} -] 1]
    foreach shell {bash fish zsh} {
        xinstall -d [file dirname $comp_path(${shell})]
        copy ${worksrcpath}/wormhole_complete.${shell} $comp_path(${shell})
    }
}
