# -*- 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.11.0 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  8b29da2c9aa61c85bbb66f6abbbbe0105be8b646 \
                        sha256  14441981afce3546c1c0f12b490714da3564af7a60d12ac0a494f9d2382d1a01 \
                        size    6978759

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
