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

# Revert to GitHub once updated there.
R.setup             cran FBartos RoBMA 3.2.0
revision            0
categories-append   math
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
license             GPL-3
description         Robust Bayesian Meta-Analyses
long_description    {*}${description}
homepage            https://fbartos.github.io/RoBMA
checksums           rmd160  d16afd6856ae6adb8ca375935e1e414170e83bee \
                    sha256  cdb27398fa9761dcd978ec10c7b3a8779cfbac007d8438750b3b20de399e4f9d \
                    size    1836511

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

depends_lib-append  port:jags \
                    port:R-BayesTools \
                    port:R-coda \
                    port:R-ggplot2 \
                    port:R-mvtnorm \
                    port:R-Rdpack \
                    port:R-rjags \
                    port:R-rlang \
                    port:R-runjags \
                    port:R-scales

# https://github.com/FBartos/RoBMA/issues/27
if {${os.platform} eq "darwin" && ${configure.cxx_stdlib} ne "libc++"} {
    # Symbol not found: __ZNK4jags12Distribution5aliasB5cxx11Ev
    patchfiles-append \
                    patch-Makevars.diff
}

compilers.setup     require_fortran

depends_test-append port:R-covr \
                    port:R-fixest \
                    port:R-knitr \
                    port:R-metaBMA \
                    port:R-metadat \
                    port:R-metafor \
                    port:R-rmarkdown \
                    port:R-testthat \
                    port:R-vdiffr \
                    port:R-weightr

test.run            yes