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

github.setup        scikit-learn-contrib hdbscan 0.8.24
name                py-${github.project}
revision            0
categories-append   science
platforms           darwin
license             BSD

python.versions     37 38

maintainers         nomaintainer

description         A high performance implementation of HDBSCAN clustering.

long_description    HDBSCAN - Hierarchical Density-Based Spatial\
                    Clustering of Applications with Noise. Performs\
                    DBSCAN over varying epsilon values and integrates\
                    the result to find a clustering that gives the\
                    best stability over epsilon. This allows HDBSCAN\
                    to find clusters of varying densities (unlike\
                    DBSCAN), and be more robust to parameter\
                    selection. In practice this means that HDBSCAN\
                    returns a good clustering straight away with\
                    little or no parameter tuning -- and the primary\
                    parameter, minimum cluster size, is intuitive and\
                    easy to select. HDBSCAN is ideal for exploratory\
                    data analysis\; it's a fast and robust algorithm\
                    that you can trust to return meaningful clusters\
                    (if there are any).

homepage            https://hdbscan.readthedocs.io/en/latest/

checksums           rmd160  0059cef4f9a2a870a9d7c103ee4220bb8ad796a2 \
                    sha256  29a07d47a4ff2d9e4938bb8d6f6b3c02e77b13669b0dc4cd3b2d43531c3aa957 \
                    size    10431303

if {${name} ne ${subport}} {
    depends_build-append \
                    port:py${python.version}-setuptools \
                    port:py${python.version}-cython
    depends_lib-append \
                    port:libomp \
                    port:py${python.version}-numpy \
                    port:py${python.version}-scikit-learn \
                    port:py${python.version}-scipy \
                    port:py${python.version}-six
    depends_run-append \
                    port:py${python.version}-joblib
    depends_test-append \
                    port:py${python.version}-nose

    compiler.openmp_version 2.5

    python.add_archflags no

    build.env-append    "CPPFLAGS=${configure.cppflags} -I${prefix}/include/libomp -Xpreprocessor -fopenmp" \
                        "CFLAGS=${configure.cc_archflags} -I${prefix}/include/libomp" \
                        "CXXFLAGS=${configure.cxx_archflags} -I${prefix}/include/libomp" \
                        "LDFLAGS=${configure.ld_archflags} -L${prefix}/lib/libomp -lomp" \
                        DYLD_LIBRARY_PATH=${prefix}/lib/libomp
    destroot.env-append "CPPFLAGS=${configure.cppflags} -I${prefix}/include/libomp -Xpreprocessor -fopenmp" \
                        "CFLAGS=${configure.cc_archflags} -I${prefix}/include/libomp" \
                        "CXXFLAGS=${configure.cxx_archflags} -I${prefix}/include/libomp" \
                        "LDFLAGS=${configure.ld_archflags} -L${prefix}/lib/libomp -lomp" \
                        DYLD_LIBRARY_PATH=${prefix}/lib/libomp

    test.run            yes

    livecheck.type      none
}
