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

perl5.branches      5.28 5.30 5.32 5.34
perl5.setup         CSS 1.09
revision            1
maintainers         nomaintainer
license             {Artistic-1 GPL}

description         Object oriented access to Cascading Style Sheets (CSS)

long_description    This module can be used to parse CSS data and represent \
                    it as a tree of objects, which can then be transformed \
                    into other formats.

checksums           rmd160  9188e697c214a2d2951dd0808714487a4219eb6b \
                    sha256  3cafffb570b901408e0b4b7a1bfcb52a06bbc71251941b3b6ad265e4029bcf7c

platforms           {darwin any}
supported_archs     noarch

if {${perl5.major} != ""} {
    depends_lib-append \
                    port:p${perl5.major}-parse-recdescent

    post-configure {
        ui_debug "Recompiling CSS::Parse::CompiledGrammar (see https://rt.cpan.org/Public/Bug/Display.html?id=53948)"
        system "cd ${worksrcpath} && ${perl5.bin} -I${worksrcpath} ${filespath}/build-grammar.pl"
        move -force ${worksrcpath}/CompiledGrammar.pm ${worksrcpath}/CSS/Parse
    }

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        copy ${worksrcpath}/examples ${destroot}${docdir}/examples
    }
}
