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

PortSystem          1.0
if {${subport} eq "cloog"} {
PortGroup           muniversal 1.0
}

name                cloog
epoch               1
version             0.18.4
categories          devel math
platforms           darwin
license             LGPL-2.1+
maintainers         larryv

description         CLooG, the Chunky Loop Generator
long_description    CLooG is a free software and library to generate \
                    code for scanning Z-polyhedra. That is, it finds \
                    a code (e.g. in C, FORTRAN...) that reaches each \
                    integral point of one or more parameterized \
                    polyhedra. CLooG has been originally written to \
                    solve the code generation problem for optimizing \
                    compilers based on the polytope model. \
                    Nevertheless it is used now in various area e.g. \
                    to build control automata for high-level synthesis \
                    or to find the best polynomial approximation of \
                    a function. CLooG may help in any situation where \
                    scanning polyhedra matters. While the user has \
                    full control on generated code quality, CLooG is \
                    designed to avoid control overhead and to produce \
                    a very effective code.
homepage            http://www.cloog.org

depends_lib         port:gmp path:lib/pkgconfig/isl.pc:isl

master_sites        http://www.bastoul.net/cloog/pages/download/count.php3?url=./
checksums           rmd160  12d7a27442fc95f01f7c6445b5559579f8f614cc \
                    sha256  325adf3710ce2229b7eeb9e84d3b539556d093ae860027185e7af8a8b00a750e

# prevent -L/lib from being added to LDFLAGS
# see http://groups.google.com/group/isl-development/t/37ad876557e50f2c
patchfiles          patch-configure.diff

# Don't link using "-flat_namespace -undefined suppress" on Yosemite and
# later (#45706).
patchfiles-append   yosemite-libtool.patch

configure.args-append   --disable-silent-rules \
                        --with-gmp=system \
                        --with-isl=system \
                        --with-osl=no

subport cloog {
variant osl description {Build with OpenScop support (causes tests to fail)} {
    ui_warn "This variant causes tests to fail"
    depends_lib-append      port:openscop
    configure.args-replace  --with-osl=no --with-osl=system
}
}

test.run            yes
test.target         check

livecheck.type      regex
livecheck.url       [lindex ${master_sites} 0]
livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}

subport cloog-devel {
    replaced_by         cloog
    PortGroup           obsolete 1.0
    version             0.18.3
    revision            1
    maintainers         larryv
    long_description    "This port has been replaced by ${replaced_by}."
    homepage            http://www.cloog.org
}