# -*- 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           cxx11 1.1
PortGroup           compilers 1.0

name                py-networkit
version             4.6
revision            0
categories-append   devel
platforms           darwin
license             MIT

python.versions     35 36 37

maintainers         {stromnov @stromnov} openmaintainer

description         NetworKit is a toolbox for high-performance network analysis
long_description    ${description}

homepage            https://networkit.iti.kit.edu/
master_sites        pypi:[string index ${python.rootname} 0]/${python.rootname}

distname            ${python.rootname}-${version}

checksums           rmd160  089c0e41ef0ecbb31aa516f2b78d2b6d22eaead0 \
                    sha256  1b27864ed3279812705a463ee251eec7bd2453080bd554c150ffbeecedc71d42 \
                    size    1223734

if {${name} ne ${subport}} {
    # Pick a compiler that supports openmp
    compiler.whitelist macports-clang-6.0 macports-clang-5.0 macports-clang-4.0 macports-clang-3.9 macports-clang-3.7 macports-gcc-7 macports-gcc-6 macports-gcc-5 macports-gcc-4.8 macports-gcc-4.7 macports-gcc-4.6 macports-gcc-4.5 macports-gcc-4.4 macports-gcc-4.3
    compiler.fallback macports-clang-6.0

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

    depends_lib-append  port:py${python.version}-scipy \
                        port:py${python.version}-matplotlib \
                        port:py${python.version}-pandas \
                        port:py${python.version}-numpy \
                        port:py${python.version}-networkx \
                        port:py${python.version}-tabulate \
                        port:py${python.version}-seaborn \
                        port:py${python.version}-scikit-learn \
                        port:py${python.version}-ipython

    patchfiles-append   patch-setup_util.py.diff

    post-patch {
        reinplace "s|installExternalPythonPackages|#installExternalPythonPackages|" ${worksrcpath}/setup.py
    }

    if {[vercmp [macports_version] 2.5.99] >= 0} {
    build.env-append    CC=${configure.cc} \
                        CXX=${configure.cxx} \
                        CFLAGS=${configure.cc_archflags} \
                        CXXFLAGS=${configure.cxx_archflags} \
                        CPPFLAGS=${configure.cppflags}

    destroot.env-append CC=${configure.cc} \
                        CXX=${configure.cxx} \
                        CFLAGS=${configure.cc_archflags} \
                        CXXFLAGS=${configure.cxx_archflags} \
                        CPPFLAGS=${configure.cppflags}
    } else {
    build.env-append    CC="${configure.cc}" \
                        CXX="${configure.cxx}" \
                        CFLAGS="${configure.cc_archflags}" \
                        CXXFLAGS="${configure.cxx_archflags}" \
                        CPPFLAGS="${configure.cppflags}"

    destroot.env-append CC="${configure.cc}" \
                        CXX="${configure.cxx}" \
                        CFLAGS="${configure.cc_archflags}" \
                        CXXFLAGS="${configure.cxx_archflags}" \
                        CPPFLAGS="${configure.cppflags}"
    }

    livecheck.type      none
}