# -*- 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        arminbiere cadical 2.0.0 rel-
revision            0
categories          math
license             MIT
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
description         Simple CDCL satisfiability solver
long_description    {*}${description}.
homepage            http://fmv.jku.at/cadical
checksums           rmd160  5c79903c913c155ab4cb79aba7a7049237ef6ba5 \
                    sha256  9afe5f6439442d854e56fc1fac3244ce241dbb490735939def8fd03584f89331 \
                    size    709136
github.tarball_from archive

depends_build-append    port:gmake

compiler.cxx_standard   2011

# Configure is unaware of --prefix option:
configure.pre_args-delete \
                        --prefix=/opt/local

patchfiles-append       0001-mobical.cpp-define-MAP_ANONYMOUS-if-undefined.patch

build.cmd               ${prefix}/bin/gmake

# https://github.com/arminbiere/cadical/issues/49
destroot {
    xinstall -m 0644 -W ${worksrcpath}/src cadical.hpp ccadical.h \
        ${destroot}${prefix}/include/
    copy ${worksrcpath}/build/cadical ${destroot}${prefix}/bin/
    copy ${worksrcpath}/build/mobical ${destroot}${prefix}/bin/
    copy ${worksrcpath}/build/libcadical.a ${destroot}${prefix}/lib/
}
