# -*- 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 koheiw proxyC 0.4.1
revision            1
categories-append   math
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
license             GPL-3
description         Computes proximity between rows or columns \
                    of large matrices efficiently in C++
long_description    {*}${description}
checksums           rmd160  e45af70f0ad5d17c6f21abb614424518d46811b7 \
                    sha256  e83d8653578b3c245d912dd5d7b03f0b2f875b206fbe3d0f328635dabf2522a8 \
                    size    94669

# Notice that 0.4.0 has switched to using OneTBB
# instead of R-RcppParallel. Make sure our OneTBB
# is found. Configure script is broken and does nothing:
# https://github.com/koheiw/proxyC/issues/50
patchfiles          patch-Makevars.diff

post-patch {
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/src/Makevars.in
}

depends_lib-append  port:onetbb \
                    port:R-Rcpp \
                    port:R-RcppArmadillo

compilers.setup     require_fortran

depends_test-append port:R-entropy \
                    port:R-knitr \
                    port:R-proxy \
                    port:R-rmarkdown \
                    port:R-testthat

test.run            yes
