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

name                py-thinc
# Don't upgrade past py-spaCy's highest supported version.
version             8.0.2
revision            0
github.setup        explosion thinc ${version} v

checksums           rmd160  950f55b0f158062d56e002b70dfd65eee8f39929 \
                    sha256  9393e10f76b57b6d1c78947ff2402e76a746f958b072d4084b02b80241eb50b7 \
                    size    1326282

platforms           darwin
supported_archs     x86_64

license             MIT

maintainers         {jonesc @cjones051073} openmaintainer

description         spaCy's Machine Learning library for NLP in Python
long_description    ${description}

# Exclude anything with non-numbers
github.livecheck.regex {([0-9.]+)}

# Support python versions
python.versions     36 37 38 39

# Compiler selection
compiler.cxx_standard 2011
compiler.blacklist-append *gcc* {clang < 900} {macports-clang-3.[0-9]} macports-clang-4.0

if {${name} ne ${subport}} {

    depends_build-append \
        port:py${python.version}-setuptools

    depends_lib-append \
        port:py${python.version}-cython \
        port:py${python.version}-cymem \
        port:py${python.version}-murmurhash \
        port:py${python.version}-numpy \
        port:py${python.version}-tqdm \
        port:py${python.version}-blis \
        port:py${python.version}-plac \
        port:py${python.version}-srsly \
        port:py${python.version}-wasabi \
        port:py${python.version}-mock \
        port:py${python.version}-preshed

    depends_test-append \
        port:py${python.version}-hypothesis \
        port:py${python.version}-flake8 
        
    post-extract {
        # Set cython version
        set PythonVersionWithDot [join [split ${python.version} ""] "."]
        foreach f [ exec find ${worksrcpath}/ -name "*.py"] {
            reinplace -q "s|\'cython\'|\'cython-${PythonVersionWithDot}\'|g" ${f}
        }
    }

    livecheck.type none 

}
