From f55c4ebf12eb9d5853733ecd17bd894a1710f66a Mon Sep 17 00:00:00 2001 From: Pekka Ristola Date: Wed, 11 Oct 2023 14:39:00 +0300 Subject: [PATCH] r-lazyeval: use metadata checks --- BioArchLinux/r-lazyeval/PKGBUILD | 33 ++++++++++++++++++++++-------- BioArchLinux/r-lazyeval/lilac.py | 11 +++++----- BioArchLinux/r-lazyeval/lilac.yaml | 13 +++++++----- 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/BioArchLinux/r-lazyeval/PKGBUILD b/BioArchLinux/r-lazyeval/PKGBUILD index 22da2b5e87..fa6525d292 100644 --- a/BioArchLinux/r-lazyeval/PKGBUILD +++ b/BioArchLinux/r-lazyeval/PKGBUILD @@ -1,17 +1,26 @@ -# Maintainer: Guoyi Zhang +# Maintainer: Pekka Ristola +# Contributor: Guoyi Zhang +# Contributor: peippo +# Contributor: Grey Christoforo +# Contributor: Viktor Drobot (aka dviktor) linux776 [at] gmail [dot] com +# Contributor: Matt Frichtl +# Contributor: wagnerflo _pkgname=lazyeval _pkgver=0.2.2 pkgname=r-${_pkgname,,} -pkgver=0.2.2 +pkgver=${_pkgver//-/.} pkgrel=9 -pkgdesc='Lazy (Non-Standard) Evaluation' -arch=('x86_64') +pkgdesc="Lazy (Non-Standard) Evaluation" +arch=(x86_64) url="https://cran.r-project.org/package=${_pkgname}" -license=('GPL') +license=(GPL3) depends=( r ) +checkdepends=( + r-testthat +) optdepends=( r-covr r-knitr @@ -19,14 +28,20 @@ optdepends=( r-testthat ) source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz") +md5sums=('1de725fe0cd496a2535020867458641a') sha256sums=('d6904112a21056222cfcd5eb8175a78aa063afe648a562d9c42c6b960a8820d4') 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 -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-lazyeval/lilac.py b/BioArchLinux/r-lazyeval/lilac.py index 620556bc87..9244fd6914 100644 --- a/BioArchLinux/r-lazyeval/lilac.py +++ b/BioArchLinux/r-lazyeval/lilac.py @@ -1,12 +1,13 @@ #!/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() diff --git a/BioArchLinux/r-lazyeval/lilac.yaml b/BioArchLinux/r-lazyeval/lilac.yaml index 7b53a5cf70..960f17a5fd 100644 --- a/BioArchLinux/r-lazyeval/lilac.yaml +++ b/BioArchLinux/r-lazyeval/lilac.yaml @@ -1,9 +1,12 @@ build_prefix: extra-x86_64 maintainers: -- github: starsareintherose - email: kuoi@bioarchlinux.org +- github: pekkarr + email: pekkarr@protonmail.com +repo_makedepends: +- r-testthat update_on: -- regex: lazyeval_([\d._-]+).tar.gz - source: regex - url: https://cran.r-project.org/package=lazyeval +- source: rpkgs + pkgname: lazyeval + repo: cran + md5: true - alias: r