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

name                jags
version             4.3.0
revision            1
set major           [lindex [split ${version} .] 0]
categories          science
license             GPL-2
platforms           darwin
maintainers         nomaintainer
description         Just Another Gibbs Sampler
long_description    JAGS is a program for analysis of Bayesian hierarchical \
                    models using Markov Chain Monte Carlo (MCMC) simulation, \
                    not wholly unlike BUGS.
homepage            http://mcmc-jags.sourceforge.net/
master_sites        sourceforge:project/mcmc-jags/JAGS/${major}.x/Source
distname            JAGS-${version}

checksums           rmd160  fd89f4b34d8866f19b1a72e181b56f1675d27b07 \
                    sha256  8ac5dd57982bfd7d5f0ee384499d62f3e0bb35b5f1660feb368545f1186371fc

# test deps pkgconfig and cppunit have to be added in build to work
depends_build-append    path:libexec/coreutils/libstdbuf.so:coreutils \
                        port:cppunit \
                        port:libtool \
                        port:pkgconfig

depends_build-delete        port:clang-9.0
depends_build-delete        port:gcc11
compiler.blacklist-append *clang* gcc-4.0 macports-gcc-8 macports-gcc-9 macports-gcc-10 macports-gcc-11
compiler.whitelist macports-gcc-7
compilers.choose   cc cxx f77
compilers.setup    require_fortran

universal_variant   no

# note: BLAS/LAPACK is an optional dependency
configure.args-append   --with-blas='-framework Accelerate'

compiler.cxx_standard   2011
configure.cxxflags-append \
    -std=c++11 \
    -Wno-c++11-narrowing

test.run            yes
test.target         check

# note: actually seems to contain source of SuiteSparse, which is another port

livecheck.type          sourceforge
livecheck.name          mcmc-jags
livecheck.regex         /JAGS-(\[0-9.\]+)${extract.suffix}
