# -*- 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.8.0
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}

python.versions     39 310 311 312 313

checksums           rmd160  56b3ed24b9fe0ae5d2f0d35e15ee90bc7d737b51 \
                    sha256  972900789f9703ac97237d872c2b667a944696415ec598a6e151236cdaa7c13c \
                    size    31990617

if {${name} ne ${subport}} {
    if {${python.version} eq 39} {
        version     1.4.5
        revision    0
        checksums   rmd160  a97be410438a274dbd7c8c7f7fb0cbc0da9804b0 \
                    sha256  a7c9be109b57bdea16a143ce6a897500e1172a28b8a7c0dcfd5b7f61c616ea42 \
                    size    39096558
    } else {
        depends_lib-append \
                    port:py${python.version}-narwhals
    }

    python.pep517_backend \
                    hatch

    depends_build-append \
                    port:npm11 \
                    port:py${python.version}-hatch-vcs \
                    port:py${python.version}-packaging

    depends_lib-append \
                    path:bin/node:nodejs24 \
                    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}-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

    platform darwin {
        if {${os.major} < 13} {
            depends_build-replace \
                    port:npm11 \
                    port:npm8

            depends_run-replace \
                    path:bin/node:nodejs24 \
                    path:bin/node:nodejs14
        }

        if {${os.major} < 16} {
            depends_build-replace \
                    port:npm11 \
                    port:npm9

            depends_run-replace \
                    path:bin/node:nodejs24 \
                    path:bin/node:nodejs18
        }
    }
}
