diff --git a/BioArchLinux/r-rstanarm/PKGBUILD b/BioArchLinux/r-rstanarm/PKGBUILD index 88f04644b4..96d94f9f3b 100644 --- a/BioArchLinux/r-rstanarm/PKGBUILD +++ b/BioArchLinux/r-rstanarm/PKGBUILD @@ -1,30 +1,39 @@ -# system requirements: GNU make, pandoc (>= 1.12.3), pandoc-citeproc -# Maintainer: sukanka +# Maintainer: Pekka Ristola +# Contributor: sukanka _pkgname=rstanarm _pkgver=2.26.1 pkgname=r-${_pkgname,,} -pkgver=2.26.1 +pkgver=${_pkgver//-/.} pkgrel=1 -pkgdesc='Bayesian Applied Regression Modeling via Stan' -arch=('x86_64') +pkgdesc="Bayesian Applied Regression Modeling via Stan" +arch=(x86_64) url="https://cran.r-project.org/package=${_pkgname}" -license=('GPL') +license=(GPL3) depends=( - r + pandoc r-bayesplot - r-bh r-ggplot2 r-lme4 r-loo + r-posterior r-rcpp - r-rcppeigen r-rcppparallel r-rstan r-rstantools r-shinystan +) +makedepends=( + r-bh + r-rcppeigen r-stanheaders - pandoc +) +checkdepends=( + r-betareg + r-biglm + r-data.table + r-hsaur3 + r-testthat ) optdepends=( r-betareg @@ -35,24 +44,39 @@ optdepends=( r-gridextra r-hsaur3 r-knitr - r-mass - r-mgcv r-rmarkdown r-roxygen2 r-shiny r-stanheaders r-testthat ) -makedepends=('make') source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz") +md5sums=('8505a33ae9ff139e9f0b3d5b8cc6ee7e') sha256sums=('4a54792d6e035931b613647aebfc98b81d1aac646a5a3f6f116b6f560d544444') +prepare() { + cd "$_pkgname/tests/testthat" + # skip tests that make a coredump + sed -e '/"stan_betareg ok when modeling x and z (link.phi = '\'sqrt\'')"/a\ \ skip("dumps core")' \ + -e '/"heavy tailed priors work with stan_betareg"/a\ \ skip("dumps core")' \ + -i test_stan_betareg.R + sed -i '1i skip("dumps core")' test_stan_jm.R + sed -i '/"multiple grouping factors are ok"/a\ \ skip("dumps core")' test_stan_mvmer.R +} + build() { - R CMD INSTALL ${_pkgname}_${_pkgver}.tar.gz -l "${srcdir}" + mkdir -p build + # compilation needs a lot of memory + MAKEFLAGS+=" -j1" + R CMD INSTALL "$_pkgname" -l build +} + +check() { + cd "$_pkgname/tests" + R_LIBS="$srcdir/build" NOT_CRAN=true Rscript --vanilla testthat.R } package() { - install -dm0755 "${pkgdir}/usr/lib/R/library" - cp -a --no-preserve=ownership "${_pkgname}" "${pkgdir}/usr/lib/R/library" + install -d "$pkgdir/usr/lib/R/library" + cp -a --no-preserve=ownership "build/$_pkgname" "$pkgdir/usr/lib/R/library" } -# vim:set ts=2 sw=2 et: diff --git a/BioArchLinux/r-rstanarm/lilac.py b/BioArchLinux/r-rstanarm/lilac.py index 4dec65be90..86bb9ef848 100644 --- a/BioArchLinux/r-rstanarm/lilac.py +++ b/BioArchLinux/r-rstanarm/lilac.py @@ -1,17 +1,17 @@ #!/usr/bin/env python3 from lilaclib import * -# we use 2 threads in BioArchLinux, but it should not be pushed to aur. +import os +import sys +sys.path.append(os.path.normpath(f'{__file__}/../../../lilac-extensions')) +from lilac_r_utils import r_pre_build + def pre_build(): - for line in edit_file('PKGBUILD'): - if line.startswith('_pkgver='): - line = f'_pkgver={_G.newver}' - elif line.startswith('build()'): - line += '\n' + 'export MAKE="make -j2"' - print(line) - update_pkgver_and_pkgrel(_G.newver.replace(':', '.').replace('-', '.')) + r_pre_build( + _G, + expect_systemrequirements = "GNU make, pandoc (>= 1.12.3), pandoc-citeproc", + ) def post_build(): - run_cmd(['sh', '-c', "sed -i '/export MAKE/d' PKGBUILD"]) git_pkgbuild_commit() update_aur_repo() diff --git a/BioArchLinux/r-rstanarm/lilac.yaml b/BioArchLinux/r-rstanarm/lilac.yaml index 514ac61246..62e496c567 100644 --- a/BioArchLinux/r-rstanarm/lilac.yaml +++ b/BioArchLinux/r-rstanarm/lilac.yaml @@ -1,22 +1,30 @@ build_prefix: extra-x86_64 maintainers: - - github: sukanka +- github: pekkarr + email: pekkarr@protonmail.com repo_depends: - - r-bayesplot - - r-bh - - r-ggplot2 - - r-lme4 - - r-loo - - r-rcpp - - r-rcppeigen - - r-rcppparallel - - r-rstan - - r-rstantools - - r-shinystan - - r-stanheaders +- r-bayesplot +- r-ggplot2 +- r-lme4 +- r-loo +- r-posterior +- r-rcpp +- r-rcppparallel +- r-rstan +- r-rstantools +- r-shinystan +repo_makedepends: +- r-bh +- r-rcppeigen +- r-stanheaders +- r-betareg +- r-biglm +- r-data.table +- r-hsaur3 +- r-testthat update_on: - - regex: rstanarm_([\d._-]+).tar.gz - source: regex - url: https://cran.r-project.org/package=rstanarm - - alias: r -time_limit_hours: 10 +- source: rpkgs + pkgname: rstanarm + repo: cran + md5: true +- alias: r