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

name                fxt
version             2024.11.16
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  d41ad788a55f4a110e9f7045dbe9eacfb205d7a4 \
                    sha256  d4a968fbdff813f0c4a93345ed9deb82a3a1dc206574e49b6d856d890a872816 \
                    size    1570112
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}
