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

github.setup                flintlib flint 3.1.3-p1 v
revision                    0
categories                  math devel
license                     LGPL-2.1+
maintainers                 {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
description                 Fast Library for Number Theory
long_description            FLINT is a C library for doing number theory

homepage                    https://www.flintlib.org

checksums                   rmd160  2dd98dd68b9f65035944075c0aa1be6abdb53e8c \
                            sha256  96637ba9de43397d06657deefe8e6dee9d226992b5526bb1c9a9d563b983e027 \
                            size    8136205

github.tarball_from         releases

# Autotools are explicitly preferred by upstream
# for anything but Windows. As of now (2024.04),
# CMake implementation has a number of bugs,
# and there is no interest to address them;
# instead, autotools build is advised, and it works.
# https://github.com/flintlib/flint/issues/1905
# https://github.com/flintlib/flint/pull/1906
# https://github.com/flintlib/flint/issues/1907

use_autoreconf              yes

compiler.cxx_standard           2011
compiler.thread_local_storage   yes

depends_lib-append          port:gmp \
                            port:mpfr \
                            port:ntl

# We do not want pre-built ports with -march.
configure.args-append       --disable-arch

configure.args-append       --with-ntl
# NTL requires C++11
configure.cxxflags-append   -std=c++11

test.run                    yes
test.target                 check

livecheck.url               ${homepage}/downloads.html
