# -*- 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-parsing
python.rootname     pyparsing
version             3.3.2
revision            0
epoch               2

categories-append   lang
platforms           {darwin any}
supported_archs     noarch
maintainers         {reneeotten @reneeotten} openmaintainer
license             MIT

description         alternative approach to creating parsers in python

long_description    The parsing module is an alternative approach to creating \
                    and executing simple grammars, vs. the traditional \
                    lex/yacc approach, or the use of regular expressions. The \
                    parsing module provides a library of classes that client \
                    code uses to construct the grammar directly in Python code.

homepage            https://github.com/pyparsing/pyparsing/

checksums           rmd160  8b417fb8aecd37d8c45cfe3c2cd22233a45c8bb5 \
                    sha256  c777f4d763f140633dcb6d8a3eda953bf7a214dc4eff598413c070bcdc117cbc \
                    size    6851574

python.versions     27 35 36 310 311 312 313 314

if {${name} ne ${subport}} {
    if {${python.version} <= 35} {
        version     2.4.7
        checksums   rmd160  2dbbca645985bb7f4b4d7a36b6ba3958302adfb9 \
                    sha256  c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1 \
                    size    649718
        depends_build-append \
                    port:py${python.version}-setuptools
    } else {
        if {${python.version} <= 38} {
            version     3.1.4
            checksums   rmd160  b9c5d15d75f99c63de72dd620b5e4921a88a8aeb \
                        sha256  f86ec8d1a83f11977c9a6ea7598e8c27fc5cddfa5b07ea2241edbbde1d7bc032 \
                        size    900231
        }

        python.pep517   yes
        python.pep517_backend   flit
    }

    if {${python.version} == 36} {
        # break circular dependency with py36-build
        python.add_dependencies no
        depends_build-append   port:py36-bootstrap-modules
        depends_lib-append     port:python${python.version}
        build.env-append    PYTHONPATH=${prefix}/share/py36-bootstrap-modules
        build.args      --skip-dependency-check
        destroot.env-append PYTHONPATH=${prefix}/share/py36-bootstrap-modules
    }

    test.run        yes
    python.test_framework unittest

    livecheck.type  none
}
