# -*- 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-blis
epoch               1
version             1.3.3
revision            0

checksums           rmd160  7d5c61b0af8d470dd2397110339c0b477dca27e2 \
                    sha256  034d4560ff3cc43e8aa37e188451b0440e3261d989bb8a42ceee865607715ecd \
                    size    2644873

license             MIT

maintainers         {jonesc @cjones051073} openmaintainer

description         Fast matrix-multiplication as a self-contained Python library
long_description    {*}${description}

homepage            https://github.com/explosion/cython-blis

# Supported python versions
python.versions        310 311 312 313 314

# Compiler selection
compiler.c_standard    1999
compiler.cxx_standard  2011
compiler.blacklist-append *gcc-4.* {clang < 999} macports-clang-3.* {macports-clang-[4-6].0}

# Pass selected compiler to BLIS and set architecture
build.env-append    BLIS_COMPILER=${configure.cc} \
                    BLIS_ARCH=generic
destroot.env-append BLIS_COMPILER=${configure.cc} \
                    BLIS_ARCH=generic

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

    variant native description {Build from source for best native platform support} {
        # Prevent precompiled binaries to let compilation optimise the library for the user processor
        archive_sites
    }
    # Currently no easy way to prevent build from detecting machine capabilities for Darwin builds.
    # So for now force all users to build from source to ensure they get what they support
    default_variants-append +native

    depends_build-append \
        port:cctools

    depends_lib-append \
        port:py${python.version}-cython \
        port:py${python.version}-numpy

    depends_test-append \
        port:py${python.version}-pytest \
        port:py${python.version}-hypothesis
}
