# -*- 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 r-spatial stars 0.7-1
revision            0
categories-append   math
platforms           {darwin any}
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
license             Apache
description         Spatiotemporal arrays, raster and vector data cubes
long_description    {*}${description}
homepage            https://r-spatial.github.io/stars
checksums           rmd160  fdb98620621bc14b99ab4457236d135793764449 \
                    sha256  808884e68a4e29fbe507e68f0825708ae663e7ff4689ae4389720bbb811cc5e6 \
                    size    4030899
supported_archs     noarch

depends_lib-append  port:R-abind \
                    port:R-classInt \
                    port:R-rlang \
                    port:R-sf \
                    port:R-units

# Notice that several tests imply that GDAL has been built with NetCDF support,
# which is not the case in MacPorts by default. Related tests will fail.
# https://github.com/r-spatial/stars/issues/692
# https://github.com/r-spatial/stars/issues/693
# mdim test fails regardless, remove it for now.
post-extract {
    delete ${worksrcpath}/tests/mdim.R
}

# Some optional test deps are omitted.
depends_test-append port:R-Cairo \
                    port:R-CFtime \
                    port:R-clue \
                    port:R-covr \
                    port:R-cubble \
                    port:R-cubelyr \
                    port:R-digest \
                    port:R-dplyr \
                    port:R-exactextractr \
                    port:R-FNN \
                    port:R-future.apply \
                    port:R-ggforce \
                    port:R-ggplot2 \
                    port:R-ggthemes \
                    port:R-gstat \
                    port:R-httr \
                    port:R-jsonlite \
                    port:R-knitr \
                    port:R-lwgeom \
                    port:R-maps \
                    port:R-mapdata \
                    port:R-ncdfgeom \
                    port:R-ncmeta \
                    port:R-pbapply \
                    port:R-PCICt \
                    port:R-plm \
                    port:R-randomForest \
                    port:R-raster \
                    port:R-rmarkdown \
                    port:R-RNetCDF \
                    port:R-sp \
                    port:R-spacetime \
                    port:R-spatstat \
                    port:R-spatstat.geom \
                    port:R-terra \
                    port:R-testthat \
                    port:R-tibble \
                    port:R-tidyr \
                    port:R-tsibble \
                    port:R-viridis \
                    port:R-xts \
                    port:R-zoo

test.run            yes
# Vignettes do not run due to a broken R BATCH:
# https://trac.macports.org/ticket/67059
test.args-append    --ignore-vignettes

# GDAL is used via R-sf, it is not a direct dependency,
# but how it is installed matters.
notes "
Some funtionality needs GDAL to be installed with +netcdf variant.
"
