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

R.setup             cran vdorie stan4bart 0.0-10
revision            0
categories-append   math
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
license             GPL-3+
description         Uses Stan sampler and math library to semi-parametrically fit linear and multi-level models \
                    with additive Bayesian Additive Regression Tree (BART) components
long_description    {*}${description}
checksums           rmd160  17dca1ca7bfbf7040ee9c0f1e50f82fcb1780653 \
                    sha256  2a20f18c2a3d26a7bde3d8ac9cbc48e0dbda8bd30b42c3d69f5005c9494ec83d \
                    size    1403519

depends_lib-append  port:R-BH \
                    port:R-dbarts \
                    port:R-Rcpp \
                    port:R-RcppEigen \
                    port:R-RcppParallel

# Otherwise configure script uses OS one: https://github.com/vdorie/stan4bart/issues/8
patchfiles          patch-use-right-compiler.diff

post-patch {
    reinplace "s,@CC@,${configure.cc}," ${worksrcpath}/configure
    reinplace "s,@CXX@,${configure.cxx}," ${worksrcpath}/configure
}

# FIXME: https://github.com/vdorie/stan4bart/issues/15

depends_test-append port:R-lme4 \
                    port:R-testthat

test.run            yes
