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

name                py-beautifulsoup4
version             4.15.0
revision            0

categories-append   textproc
license             MIT
maintainers         {mps @Schamschula} openmaintainer
description         Python HTML/XML parser
long_description    Beautiful Soup is a Python HTML/XML parser designed for \
                    quick turnaround projects like screen-scraping.

supported_archs     noarch
platforms           {darwin any}

checksums           rmd160  97f3cb035fff3b13dbb3babc7e734875b2912ff5 \
                    sha256  288e3ca7d54b06f2ac191970bc275c1939cb46d450b255bf6718b04aa37ab4f7 \
                    size    632571

homepage            https://www.crummy.com/software/BeautifulSoup/

python.versions     310 311 312 313 314

python.pep517_backend \
                    hatch

if {${name} ne ${subport}} {
    depends_lib-append \
                    port:py${python.version}-soupsieve \
                    port:py${python.version}-typing_extensions

    variant chardet description {Build with chardet support} {
        depends_lib-append  port:py${python.version}-chardet
    }

    variant charset_normalizer description {Build with charset-normalizer support} {
        depends_lib-append  port:py${python.version}-charset-normalizer
    }

    variant html5lib description {Build with HTML5 support} {
        depends_lib-append  port:py${python.version}-html5lib
    }

    variant lxml description {Build with lxml support} {
        depends_lib-append  port:py${python.version}-lxml
    }

    post-destroot   {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 644 -W ${worksrcpath} \
            LICENSE \
            NEWS.txt \
            README.md \
            ${destroot}${docdir}
    }

    default_variants \
                    +html5lib +lxml

    test.run        yes
}
