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

name                nusmv
version             2.6.0
revision            1
categories          devel math
maintainers         nomaintainer
license             LGPL-2.1
conflicts           libcudd

description         The NuSMV model checker

long_description    {*}${description}

homepage            http://nusmv.fbk.eu
master_sites        ${homepage}/distrib/:nusmv \
                    https://github.com/niklasso/minisat/archive/:minisat

distname            NuSMV-${version}
set nusmv_distfile  ${distfiles}
set minisat_distfile 37dc6c67e2af26379d88ce349eb9c4c6160e8543.zip

distfiles           ${nusmv_distfile}:nusmv \
                    ${minisat_distfile}:minisat

checksums           ${nusmv_distfile} \
                    rmd160  3967791a7f5db2ed87749812ad809221e965c23b \
                    sha256  dba953ed6e69965a68cd4992f9cdac6c449a3d15bf60d200f704d3a02e4bbcbb \
                    size    4223312 \
                    ${minisat_distfile} \
                    rmd160  b2ad86d14debb70824aebff7f4e61d9e11b80a3e \
                    sha256  75f30bfd79669a6c788cbaecce867b49fa4c66c8158e98948077a09ef498a704 \
                    size    77725

depends_build-append \
                    path:bin/pkg-config:pkgconfig

depends_lib         port:libxml2 \
                    port:readline

extract.only        ${nusmv_distfile}
post-extract {
    ln -s ${distpath}/${minisat_distfile} ${worksrcpath}/MiniSat/
}

universal_variant   no
cmake.source_dir    ${worksrcpath}/NuSMV

if {${os.platform} eq "darwin" && \
    (${os.major} > 10 && ${os.major} < 21)} {
    configure.python /usr/bin/python
} else {
    set python_version 2.7
    depends_build-append port:python[string map {. {}} ${python_version}]
    configure.python ${prefix}/bin/python${python_version}
}

configure.args      -DDOXYGEN_EXECUTABLE= \
                    -DPDFLATEX_COMPILER= \
                    -DPYTHON_EXECUTABLE=${configure.python}

# make[1]: *** read jobs pipe: Resource temporarily unavailable. Stop.
use_parallel_build  no

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     NuSMV-(\[0-9.\]+\[0-9\])
