# -*- 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           compiler_blacklist_versions 1.0

name                fxt
version             2024.03.14
categories          math science
license             GPL-3+
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
description         Library of low-level algorithms
long_description    {*}${description}
homepage            https://www.jjj.de/fxt/
master_sites        ${homepage}
checksums           rmd160  04a011101d0778de07bb66aaa88e3ab35dd96bf3 \
                    sha256  f72edc8595681ee2b7e180ba869600076303da41006f0415f8c8e45df4dba56c \
                    size    1569801
extract.rename      yes

patchfiles          patch-makefile.diff

post-patch {
    reinplace "s,@PREFIX@,${prefix}," ${worksrcpath}/makefile
}

use_configure       no

# Does not build with clangs at the moment:
# error: constexpr variable 's2' must be initialized by a constant expression
# See also: https://github.com/llvm/llvm-project/issues/60548
compiler.blacklist-append \
                    {clang} macports-clang-*
compiler.fallback   macports-gcc-13 macports-gcc-12 \
                    macports-gcc-11 macports-gcc-7

compiler.cxx_standard   2017

build.args-append   CC="${configure.cc} [get_canonical_archflags cc]" \
                    CXX="${configure.cxx} [get_canonical_archflags cxx]"

destroot.env-append PREFIX=${prefix}
