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

github.setup        torproject stem 1.8.3
github.tarball_from archive
name                py-stem
revision            1

license             LGPL-3
maintainers         {mps @Schamschula} openmaintainer
description         Stem is a Python controller library for Tor.
long_description    {*}${description} With it you can use Tor's control protocol to \
                    script against the Tor process, or build things such as Nyx.
homepage            https://stem.torproject.org

platforms           {darwin any}
supported_archs     noarch

# stealth update GitHub
dist_subdir         ${name}/${version}_${revision}

checksums           rmd160  3e1fcc9fbee151b9178c6eb9107e779e5e3099fd \
                    sha256  789e591d30b5682ef65dd463ca80bfeb4a8bf69348b77c4733a701449bc837f4 \
                    size    2862782

python.versions     310 311 312 313 314

if {${name} ne ${subport}} {
    depends_lib-append  \
                    port:py${python.version}-codestyle \
                    port:py${python.version}-cryptography \
                    port:py${python.version}-mock \
                    port:py${python.version}-pyflakes \
                    port:py${python.version}-tox \
                    port:stem_select

    select.group    stem
    select.file     ${filespath}/stem${python.version}

    notes "
    To make the Python ${python.branch} version of tor-prompt the one that is run\
    when you execute the commands without a version suffix, e.g. 'tor-prompt',\
    run:
    sudo port select --set ${select.group} [file tail ${select.file}]
    "
}
