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

# Revert to GitHub once updated there.
R.setup             cran hypertidy vapour 0.10.0 v
revision            2
categories-append   gis
maintainers         nomaintainer
license             GPL-3
description         Access to the Geospatial Data Abstraction Library (GDAL)
long_description    {*}${description}
homepage            https://hypertidy.github.io/vapour
checksums           rmd160  3b844f35d979593eb39006a836f61e33775a1e8a \
                    sha256  90ed59308ac5777eeeabbb3cb5c78fbf077ca3df3a057faccb52de2a8ce52ca2 \
                    size    1729425
# github.tarball_from archive

set proj_v          proj9

depends_build-append \
                    port:pkgconfig
depends_lib-append  path:lib/${proj_v}/lib/pkgconfig/proj.pc:${proj_v} \
                    port:gdal \
                    port:R-jsonlite \
                    port:R-Rcpp

# configure fails to do its job: https://github.com/r-spatial/sf/issues/2292
build.env-append    CPPFLAGS=-I${prefix}/lib/${proj_v}/include

build.args-append   --configure-args="--with-proj-include=${prefix}/lib/${proj_v}/include \
                        --with-proj-lib=${prefix}/lib/${proj_v}/lib \
                        --with-proj-share=${prefix}/lib/${proj_v}/share/proj"

depends_test-append port:R-knitr \
                    port:R-markdown \
                    port:R-rmarkdown \
                    port:R-spelling \
                    port:R-testthat

test.run            no
