# -*- 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 apache adbcpostgresql 0.14.0
revision            0
categories-append   databases
maintainers         nomaintainer
license             Apache-2
description         Arrow Database Connectivity (ADBC) SQLite driver
long_description    {*}${description}
homepage            https://github.com/apache/arrow-adbc
checksums           rmd160  0c193ee55a3f11e4bc1686d5b761bcec803f9955 \
                    sha256  4036ed1b4cd01f195bd087dbf3adc869308a8f5e1f00027126e895cedeb1dbd1 \
                    size    2846768

# Keep in sync with R-RPostgreSQL, so that we do not need multiple postgresql ports.
# Make sure a chosen version is supported for all archs, including powerpc.
set pgsql           postgresql15

depends_lib-append  port:${pgsql} \
                    port:R-adbcdrivermanager

# PKG_LIBS is not redundant here:
build.args-append   --configure-vars=' \
                        PKG_LIBS=-lpq \
                        INCLUDE_DIR=${prefix}/include/${pgsql} \
                        LIB_DIR=${prefix}/lib/${pgsql} '

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

test.run            no
