# Maintainer: Pekka Ristola # Contributor: Guoyi Zhang # Contributor: Viktor Drobot (aka dviktor) linux776 [at] gmail [dot] com _pkgname=cpp11 _pkgver=0.4.6 pkgname=r-${_pkgname,,} pkgver=${_pkgver//-/.} pkgrel=2 pkgdesc="A C++11 Interface for R's C Interface" arch=(any) url="https://cran.r-project.org/package=${_pkgname}" license=(MIT) depends=( r ) checkdepends=( r-decor r-knitr r-mockery r-progress r-testthat ) optdepends=( r-bench r-brio r-callr r-cli r-covr r-decor r-desc r-ggplot2 r-glue r-knitr r-lobstr r-mockery r-progress r-rcpp r-rmarkdown r-scales r-testthat r-tibble r-vctrs r-withr ) source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz" "fix-tests.patch") md5sums=('786e1fdd894c982290d4ae401123fe59' '7b7abe5ee87b665f50a36776475111ce') sha256sums=('d1c56954671d3398078ad52aaa4efce0864e8166465c8c5e5e9a1e40599055b3' '88d4f13e8b518250c520c906784f68971782a470f5451e510c3b25b47f3b11b9') prepare() { # fix test snapshots patch -Np1 -i fix-tests.patch } build() { mkdir -p build R CMD INSTALL "$_pkgname" -l build } check() { cd "$_pkgname/tests" R_LIBS="$srcdir/build" NOT_CRAN=true Rscript --vanilla testthat.R } package() { install -d "$pkgdir/usr/lib/R/library" cp -a --no-preserve=ownership "build/$_pkgname" "$pkgdir/usr/lib/R/library" install -d "$pkgdir/usr/share/licenses/$pkgname" ln -s "/usr/lib/R/library/$_pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname" }