# -*- 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           boost 1.0

name                gecode
version             4.4.0
revision            4
categories          devel math
maintainers         nomaintainer
license             MIT

description         Generic Constraint Development Environment

long_description    Gecode is a toolkit for developing constraint-based systems and applications.\
                    Gecode provides a constraint solver with state-of-the-art \
                    performance while being modular and extensible.

homepage            https://www.gecode.org
master_sites        ${homepage}/download/
use_7z              yes

checksums           rmd160  db3a1fa2a49c2717b14190e4b40b401af7d9700e \
                    sha256  c3da433cf1de57e1a5b7a62a1206d13788583a20c20ca4a831d1a05254f00d50

boost.depends_type  build

configure.args      --disable-doc-dot \
                    --disable-examples \
                    --disable-qt \
                    --with-boost-include=[boost::include_dir]

# The build system doesn't use glibtool so we have to add the C++ standard
# library flag to LDFLAGS manually.
if {[string match *clang* ${configure.cxx}] && ${configure.cxx_stdlib} ne ""} {
    configure.ldflags-append \
                    -stdlib=${configure.cxx_stdlib}
}

# The build system ignores the LDFLAGS variable, but has a handy DLLFLAGS
# variable we can use.
variant universal {}
configure.env-append \
                    "DLLFLAGS=${configure.ldflags} [get_canonical_archflags ld]"

variant qt4 conflicts qt5 description {Add QT 4 support} {
    depends_lib-append      port:qt4-mac
    configure.args-replace  --disable-qt --enable-qt
    configure.env           PATH=$env(PATH):${prefix}/libexec/qt4-mac/bin
    build.env               PATH=$env(PATH):${prefix}/libexec/qt4-mac/bin
}

variant qt5 conflicts qt4 description {Add QT 5 support} {
    depends_lib-append      port:qt5
    configure.args-replace  --disable-qt --enable-qt
    configure.env           PATH=$env(PATH):${prefix}/libexec/qt5/bin
    build.env               PATH=$env(PATH):${prefix}/libexec/qt5/bin
}

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