# $Id: Portfile 115946 2014-01-15 07:09:04Z mww@macports.org $

PortSystem 1.0

name                gringo
version             4.2.1
categories          math devel
platforms           darwin
maintainers         mww openmaintainer
license             GPL-3
description         gringo computes an equivalent ground program
long_description \
    Gringo is a grounder that, given an input program with first-order variables, \
    computes an equivalent ground (variable-free) program. Its output can be \
    processed further with answer set solvers like clasp, cmodels, or smodels.

homepage            http://potassco.sourceforge.net/
master_sites        sourceforge:potassco

distname            ${name}-${version}-source

checksums           rmd160  7b0b116f7485edd0e199707425c0ffaabd94681d \
                    sha256  24da7958ca6c4f41a3df43ca786059926057289d5f01bfd22e6d9483977c0581

depends_build       port:scons port:re2c port:bison
depends_lib         port:boost

worksrcdir          ${name}-${version}-source

use_configure       no
use_parallel_build  no

# needs compiler with C++11 support -- currently does not build on OS X < 10.9
build.cmd           scons --build-dir=release gringo clingo
build.target

destroot {
    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name} \
        ${destroot}${prefix}/bin
    xinstall -m 0755 -W ${worksrcpath}/build/release clingo gringo \
        ${destroot}${prefix}/bin
    xinstall -m 644 -W ${worksrcpath} CHANGES README COPYING NOTES INSTALL \
        ${destroot}${prefix}/share/doc/${name}
}

livecheck.url       http://sourceforge.net/projects/potassco/files/gringo/
livecheck.regex     potassco/files/gringo/(\[0-9\\.\]+)/

