# -*- 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-cairosvg
python.rootname     CairoSVG
version             2.9.0
revision            0

categories-append   graphics
platforms           {darwin any}
supported_archs     noarch
license             LGPL-3+
maintainers         {reneeotten @reneeotten} openmaintainer

description         A Simple SVG Converter based on Cairo
long_description    CairoSVG is a SVG converter based on Cairo. It can export SVG \
                    files to PDF, PostScript and PNG files.

homepage            https://cairosvg.org

distname            cairosvg-${version}

checksums           rmd160  4802e19b3f7455b9adf4d83adaf84a89225f8aba \
                    sha256  1debb00cd2da11350d8b6f5ceb739f1b539196d71d5cf5eb7363dbd1bfbc8dc5 \
                    size    40877

python.versions     310 311 312 313 314

if {${name} ne ${subport}} {
    depends_lib-append  \
                    port:py${python.version}-cairocffi \
                    port:py${python.version}-cssselect2 \
                    port:py${python.version}-defusedxml \
                    port:py${python.version}-Pillow \
                    port:py${python.version}-tinycss2

    depends_run-append \
                    port:py-cairosvg_select

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

    notes "
To make the Python ${python.branch} version of py-cairosvg the one that is run\
when you execute the commands without a version suffix, e.g. 'cairosvg', run:

port select --set ${select.group} [file tail ${select.file}]
"
}
