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

github.setup        RaRe-Technologies gensim 4.0.0
name                py-gensim
categories-append   textproc
platforms           darwin
license             LGPL-2+

python.versions     37 38 39

maintainers         {stromnov @stromnov} openmaintainer

description         Python framework for fast Vector Space Modelling

long_description    Gensim is a Python library for topic modelling, document \
                    indexing and similarity retrieval with large corpora. \
                    Target audience is the natural language processing (NLP) and \
                    information retrieval (IR) community.

homepage            http://radimrehurek.com/gensim/

checksums           rmd160  cda411d58088c75ec651da777f304d36fe839890 \
                    sha256  dee8521b69a503ad11a39696947aee079d410d8fe0dd56766d625b4c8a5e6dd3 \
                    size    60222148

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

    depends_lib-append  port:py${python.version}-numpy \
                        port:py${python.version}-scipy \
                        port:py${python.version}-six \
                        port:py${python.version}-smart_open

    # unpin cython version
    post-patch {
        set cython_version [exec bash -c "${python.bin} -c 'import cython; print(cython.__version__)' || true"]
        reinplace -E \
            "s|^(CYTHON_STR = 'Cython==)\[\[:digit:].]+(')|\\1${cython_version}\\2|" \
            ${worksrcpath}/setup.py
    }
    
    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 644 -W ${worksrcpath} \
            CHANGELOG.md COPYING README.md \
            ${destroot}${docdir}
    }

    livecheck.type      none
}

foreach {old new} {27 38 35 38 36 38} {
    subport py${old}-${python.rootname} "
        replaced_by py${new}-${python.rootname}
        PortGroup obsolete 1.0
    "
}
