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

# GitHub version lags behind.
R.setup             cran jeroen mongolite 4.0.0
revision            1
categories-append   databases
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
license             Apache-2
description         Fast and simple MongoDB client
long_description    {*}${description} for R.
homepage            https://jeroen.github.io/mongolite
checksums           rmd160  3608cdc435c37346bb6e65700e955fd801a262bc \
                    sha256  09808c1c68ada79b75dc22e617533611ac46f602a8e2194819600ef0d07d2892 \
                    size    1015027

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

depends_lib-append  port:cyrus-sasl2 \
                    port:R-jsonlite \
                    port:R-mime \
                    port:R-openssl

# mongolite upstream has broken the target for bson.
patchfiles-append   patch-fix-bson.diff \
                    patch-fix-configure.diff

# https://github.com/mongodb/mongo-c-driver/pull/1841
# patchfiles-append   patch-bson-memory-fix-for-Apple.diff
# Commenting out the patch for now, since R-mongolite 3.0.1
# disabled aligned_alloc for all Apple, which works for us.

depends_test-append port:R-curl \
                    port:R-ggplot2 \
                    port:R-nycflights13 \
                    port:R-spelling

test.run            yes
