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

github.setup        tatami-inc tatami 3.1.0 v
revision            0
conflicts           tatami-devel
categories          devel math
license             MIT
maintainers         nomaintainer
description         C++ API for all sorts of matrices
long_description    {*}${description}

checksums           rmd160  2f3d070d2f9f10223bb994a2b47f45283da8113e \
                    sha256  8b89b8331df7694d83922e35383dfe8af3559271a2fcae10519df9220b78a98b \
                    size    173988
supported_archs     noarch
platforms           any

if {${subport} ne "tatami-devel"} {
    github.tarball_from archive
}

subport tatami-devel {
    github.setup    tatami-inc tatami f0ee2f58f5923b20dba9b17955eba1bc2a9a4423
    # Change github.tarball_from to 'releases' or 'archive' next update
    github.tarball_from tarball
    version         2024.09.02
    revision        0
    conflicts       tatami
    checksums       rmd160  4544896a690856bb679f99bbaf217039bfbded34 \
                    sha256  219fcf54ee73357a9c9e15166d2d0dc09575da8eb75a84faecb01ab5acdb13ad \
                    size    173706
}

set py_ver          3.12
set py_ver_nodot    [string map {. {}} ${py_ver}]
depends_build-append \
                    port:python${py_ver_nodot}
depends_lib-append  port:zlib

compiler.cxx_standard 2017

configure.args-append \
                    -DBUILD_TESTING:BOOL=ON \
                    -DCODE_COVERAGE:BOOL=OFF \
                    -DPython_EXECUTABLE=${prefix}/bin/python${py_ver} \
                    -DUSE_OPENMP:BOOL=OFF

destroot {
    move ${worksrcpath}/include/tatami ${destroot}${prefix}/include
}

test.run            yes
