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

name                py-panel
version             1.9.3
revision            0

categories-append   graphics devel
license             BSD
maintainers         {mps @Schamschula} openmaintainer
description         A high-level app and dashboarding solution for Python.
long_description    Panel is an open-source Python library that lets you create custom \
                    interactive web apps and dashboards by connecting user-defined \
                    widgets to plots, images, tables, or text.
homepage            https://panel.holoviz.org

supported_archs     noarch
platforms           {darwin any}

checksums           rmd160  8a807c8532f2eb2be74bf75660827ef04b2571d8 \
                    sha256  4d7de30561e31674451ade5f029cddbec6156fd30f3e4cfd7da82f6ecfcbb98f \
                    size    32215008

python.versions     310 311 312 313 314

python.pep517_backend \
                    hatch

if {${name} ne ${subport}} {
    depends_build-append \
                    port:py${python.version}-hatch-vcs \
                    port:py${python.version}-packaging

    depends_lib-append \
                    port:panel_select \
                    port:py${python.version}-bleach \
                    port:py${python.version}-bokeh \
                    port:py${python.version}-linkify-it-py \
                    port:py${python.version}-markdown \
                    port:py${python.version}-markdown-it-py \
                    port:py${python.version}-mdit-py-plugins \
                    port:py${python.version}-narwhals \
                    port:py${python.version}-nh3 \
                    port:py${python.version}-pandas \
                    port:py${python.version}-param \
                    port:py${python.version}-pyct \
                    port:py${python.version}-pyviz_comms \
                    port:py${python.version}-requests \
                    port:py${python.version}-tqdm \
                    port:py${python.version}-typing_extensions \
                    port:py${python.version}-tzdata \
                    port:py${python.version}-xyzservices

    select.group    panel
    select.file     ${filespath}/py${python.version}-panel

    variant holoviews description {Add holoviews support.} {
        depends_lib-append \
                    port:py${python.version}-holoviews
    }

    variant matplotlib description {Add matplotlib support.} {
        depends_lib-append \
                    port:py${python.version}-matplotlib
    }

    variant pillow description {Add PIL support.} {
        depends_lib-append \
                    port:py${python.version}-Pillow
    }

    variant plotly description {Add plotly support.} {
        depends_lib-append \
                    port:py${python.version}-plotly
    }

    platform darwin {
        if {${os.major} > 21} {
            depends_lib-append \
                    port:nodejs24
        }
        if {${os.major} > 18 && ${os.major} < 22} {
            depends_lib-append \
                    port:nodejs22
        }
        if {${os.major} > 15 && ${os.major} < 19} {
            depends_lib-append \
                    port:nodejs20
        }
        if {${os.major} > 10 && ${os.major} < 16} {
            depends_lib-append \
                    port:nodejs16
        }

        if {${os.major} > 15} {
            depends_build-append \
                    port:npm11
        }
        if {${os.major} > 12 && ${os.major} < 16} {
            depends_build-append \
                    port:npm9
        }
        if {${os.major} < 13} {
            depends_build-append \
                    port:npm8
        }
    }
}
