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

github.setup            Normaliz Normaliz 3.10.4 v
github.tarball_from     releases
name                    normaliz
revision                0
categories              math science
license                 GPL-3
maintainers             nomaintainer
description             a tool for computations in affine monoids, vector configurations, lattice polytopes, and rational cones.
long_description        {*}${description}

homepage                https://www.normaliz.uni-osnabrueck.de/
distname                ${name}-${version}

checksums               rmd160  300f5180d9bc6943073c4581b719e2a09e7016bb \
                        sha256  9b424f966d553ae32e710b8ab674c7887ddcbf0e5ea08af7f8bc1b587bcbb2aa \
                        size    6961480

use_autoreconf          yes
autoreconf.args         -fvi

depends_lib-append      port:gmp \
                        port:flint

compiler.openmp_version 4.5

post-patch {
    # ld: internal error: atom not found in symbolIndex(...) for architecture ...
    reinplace -W ${worksrcpath} {s|-Wl,-s||} \
                        source/Makefile.am \
                        source/Makefile.configuration
}

configure.args-append   --enable-openmp \
                        --with-gmp=${prefix} \
                        --with-flint=${prefix}

# normaliz is used with polymake which builds against bliss
configure.args-append   --without-nauty

# MacPorts hasn't got it, prevent picks it
configure.args-append   --without-hash-library \
                        --without-e-antic
