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

# This is a painful package:
# https://github.com/allisonhorst/palmerpenguins/issues/96
# https://github.com/r-dbi/DBItest/issues/299
# It is easier to bypass R PG here and do install by hand.

name                R-palmerpenguins
set R.package       palmerpenguins
version             0.1.1
revision            2
maintainers         nomaintainer
license             public-domain
description         Palmer Archipelago (Antarctica) penguin data
long_description    {*}${description}
homepage            https://allisonhorst.github.io/palmerpenguins
master_sites        https://cran.r-project.org/src/contrib
distname            ${R.package}_${version}
checksums           rmd160  ec30e91d1484561b08bc05e5575945861e1c2fc0 \
                    sha256  2a40d48ba6c7978fdf2a6daf647ccb39cd17590680138931d11194d3dd1a30b4 \
                    size    2995960
supported_archs     noarch
platforms           {darwin any}

depends_lib-append  port:R

extract.only

use_configure       no

build               { }

set branch          4.4
set packages        ${frameworks_dir}/R.framework/Versions/${branch}/Resources/library

destroot {
    xinstall -d -m 0755 ${destroot}${packages}
    copy ${distpath}/${distname}.tar.gz ${destroot}${packages}

    system -W ${destroot}${packages} "${prefix}/bin/R CMD INSTALL ${distname}.tar.gz \
                    --library=${destroot}${packages} --install-tests"
}

post-destroot {
    delete ${destroot}${packages}/${distname}.tar.gz
}

depends_test-append port:R-dplyr \
                    port:R-ggplot2 \
                    port:R-knitr \
                    port:R-recipes \
                    port:R-rmarkdown \
                    port:R-tibble \
                    port:R-tidyr

# No PG, so no tests support.
test.run            no
