# -*- 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        FEniCS basix 0.9.0 v
revision            0
categories          science
license             MIT
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
homepage            https://fenicsproject.org
description         FEniCS finite element basis evaluation library
long_description    {*}${description}

checksums           rmd160  359ebef7367ed42edd13921530c50146e0371906 \
                    sha256  60e96b2393084729b261cb10370f0e44d12735ab3dbd1f15890dec23b9e85329 \
                    size    639363
github.tarball_from archive

cmake.source_dir    ${worksrcpath}/cpp

depends_lib-append  path:lib/libopenblas.dylib:OpenBLAS

compiler.cxx_standard 2020

# https://github.com/FEniCS/basix/issues/752
compiler.blacklist-append {clang < 1400}

# -DBLA_VENDOR is broken on Ventura for some reason.
configure.args-append \
                    -DBLAS_LIBRARIES="-lopenblas" \
                    -DLAPACK_LIBRARIES="-lopenblas" \
                    -DBUILD_SHARED_LIBS=ON

platform darwin {
    # TODO: This is a temporary solution, the classic linker will be removed in a future release by Apple.
    if {([vercmp ${xcodeversion} 15] >= 0) || ([vercmp ${xcodecltversion} 15] >= 0)} {
        configure.ldflags-append \
                    -Wl,-ld_classic
    }
}
