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

github.setup        Kozea CairoSVG 2.8.2
github.tarball_from archive
name                py-cairosvg
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

checksums           rmd160  050b7d48e5299c25b2c3e774cfce0e806f95d585 \
                    sha256  c292f3111c8cc4e5dc80aac9d4a36098ecb3ec9cf3238a6269da03f567c98b8c \
                    size    8339775

python.versions     310 311 312 313

if {${name} ne ${subport}} {
    depends_build-append \
                    port:py${python.version}-pytest-runner

    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}]
"
}

github.livecheck.regex  {([^"rba]+)}
