From 6f5a16938bba07aff81053d4525a63ee7cc7a4d4 Mon Sep 17 00:00:00 2001 From: Pekka Ristola Date: Sun, 18 Jun 2023 08:41:07 +0300 Subject: [PATCH] r-cachem: use metadata checks --- BioArchLinux/r-cachem/PKGBUILD | 34 +++++++++++++++++++++----------- BioArchLinux/r-cachem/lilac.py | 12 ++++++----- BioArchLinux/r-cachem/lilac.yaml | 13 +++++++----- 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/BioArchLinux/r-cachem/PKGBUILD b/BioArchLinux/r-cachem/PKGBUILD index d538bb4c40..f3bbd5917b 100644 --- a/BioArchLinux/r-cachem/PKGBUILD +++ b/BioArchLinux/r-cachem/PKGBUILD @@ -1,32 +1,44 @@ -# Maintainer: Guoyi Zhang +# Maintainer: Pekka Ristola +# Contributor: Guoyi Zhang +# Contributor: Viktor Drobot (aka dviktor) linux776 [at] gmail [dot] com _pkgname=cachem _pkgver=1.0.8 pkgname=r-${_pkgname,,} -pkgver=1.0.8 +pkgver=${_pkgver//[:-]/.} pkgrel=1 -pkgdesc='Cache R Objects with Automatic Pruning' -arch=('x86_64') +pkgdesc="Cache R Objects with Automatic Pruning" +arch=(x86_64) url="https://cran.r-project.org/package=${_pkgname}" -license=('MIT') +license=(MIT) depends=( - r r-fastmap r-rlang ) +checkdepends=( + r-testthat +) optdepends=( r-testthat ) source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz") +md5sums=('f7b8c1dae009101e6785febca66bb659') sha256sums=('ea9ca919fe615dce8770758ecc2fc88ac99074f66ff1cde3a0b95d40007f45c2') build() { - R CMD INSTALL ${_pkgname}_${_pkgver}.tar.gz -l "${srcdir}" + 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 -dm0755 "${pkgdir}/usr/lib/R/library" - cp -a --no-preserve=ownership "${_pkgname}" "${pkgdir}/usr/lib/R/library" - install -Dm644 "${_pkgname}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}" + 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" } -# vim:set ts=2 sw=2 et: diff --git a/BioArchLinux/r-cachem/lilac.py b/BioArchLinux/r-cachem/lilac.py index 620556bc87..b5cdb057c5 100644 --- a/BioArchLinux/r-cachem/lilac.py +++ b/BioArchLinux/r-cachem/lilac.py @@ -1,12 +1,14 @@ #!/usr/bin/env python3 from lilaclib import * +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}' - print(line) - update_pkgver_and_pkgrel(_G.newver.replace(':', '.').replace('-', '.')) + r_pre_build(_G) def post_build(): git_pkgbuild_commit() + update_aur_repo() diff --git a/BioArchLinux/r-cachem/lilac.yaml b/BioArchLinux/r-cachem/lilac.yaml index 2e169d3431..0623794f3d 100644 --- a/BioArchLinux/r-cachem/lilac.yaml +++ b/BioArchLinux/r-cachem/lilac.yaml @@ -1,12 +1,15 @@ build_prefix: extra-x86_64 maintainers: -- github: starsareintherose - email: kuoi@bioarchlinux.org +- github: pekkarr + email: pekkarr@protonmail.com repo_depends: - r-fastmap - r-rlang +repo_makedepends: +- r-testthat update_on: -- regex: cachem_([\d._-]+).tar.gz - source: regex - url: https://cran.r-project.org/package=cachem +- source: rpkgs + pkgname: cachem + repo: cran + md5: true - alias: r