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

github.setup        potassco clingcon 5.2.1 v
categories          math
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
license             MIT
description         Extension of clingo to handle constraints over integers
long_description    Clingcon is an answer set solver for constraint logic programs, \
                    building upon the answer set solver clingo. It extends the high-level \
                    modeling language of ASP with constraint solving capacities. \
                    Constraints over finite domain integer variables can be used \
                    in logic programs. Clingcon adopts state-of-the-art techniques \
                    from the area of SMT, like conflict-driven learning and theory propagation. \
                    It uses lazy nogood and variable generation on the order encoding \
                    and features several preprocessing techniques.
homepage            https://potassco.org/clingcon
github.tarball_from archive
checksums           rmd160  32ccefbf0c30179767c399b93431c245a01f6e22 \
                    sha256  ff17294757f3f3f2420acd2145fe9cb039b9aaeace428f546fee3896b00ef724 \
                    size    1376527

depends_lib-append  port:clingo

compiler.cxx_standard 2017
# Use the same blacklist as with its dependency clingo
compiler.blacklist-append \
                    {clang < 1200}

configure.args-append \
                    -DPYCLINGCON_ENABLE=OFF \
                    -DCLINGCON_BUILD_TESTS=ON

# ___atomic_load_8
if {${build_arch} in [list i386 ppc] && [string match *gcc* ${configure.compiler}]} {
    configure.ldflags-append -latomic
}

test.run            yes
test.dir            ${build.dir}/bin
test.cmd            ./test_clingcon
test.target
