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

github.setup        nicolargo glances 4.3.1 v
github.tarball_from archive
revision            0
categories          sysutils
license             GPL-3
maintainers         {hotmail.com:amtor @RobK88} \
                    openmaintainer
supported_archs     noarch

description         Glances is a CLI curses based monitoring tool for GNU/Linux and BSD OS.
long_description    Glances is a cross-platform monitoring tool which aims to present a large \
                    amount of monitoring information through a curses or Web based interface. \
                    The information dynamically adapts depending on the size of the user interface.

platforms           {darwin any}

checksums           rmd160  2322867040c6c21e701ac0d01c54f132b00f7e88 \
                    sha256  473793bf118a0c34ef54bc7004cfc2d7bbc8752551b440e07ed37684a68d50b3 \
                    size    7041565

python.default_version \
                    313
depends_lib-append  port:py${python.version}-packaging \
                    port:py${python.version}-psutil \
                    port:py${python.version}-future \
                    port:py${python.version}-setuptools

if {${os.platform} ne "darwin" || ${os.major} > 16} {
    depends_lib-append \
                    port:py${python.version}-orjson \
                    port:py${python.version}-pydantic
} else {
    # https://github.com/nicolargo/glances/issues/2930
    depends_run-append \
                    port:py${python.version}-ujson
}

depends_run-append  port:py${python.version}-defusedxml

post-patch {
    reinplace "s|/usr/local|${prefix}|" glances/config.py
}

variant html_export description {Adds HTML export option} {
    depends_lib-append port:py${python.version}-jinja2
}
