r-exact2x2: use metadata checks

This commit is contained in:
Pekka Ristola 2023-10-08 08:10:14 +03:00
parent b6695179d5
commit ce40c834ce
No known key found for this signature in database
GPG key ID: 2C20BE716E05213E
3 changed files with 40 additions and 20 deletions

View file

@ -1,35 +1,44 @@
# Maintainer: Kiri <kiri@vern.cc>
# Maintainer: Pekka Ristola <pekkarr [at] protonmail [dot] com>
# Contributor: Kiri <kiri@vern.cc>
_pkgname=exact2x2
_pkgver=1.6.8
pkgname=r-${_pkgname,,}
pkgver=${_pkgver//[:-]/.}
pkgver=${_pkgver//-/.}
pkgrel=2
pkgdesc='Exact Tests and Confidence Intervals for 2x2 Tables'
arch=('any')
pkgdesc="Exact Tests and Confidence Intervals for 2x2 Tables"
arch=(any)
url="https://cran.r-project.org/package=${_pkgname}"
license=('GPL')
license=(GPL3)
depends=(
r
r-exactci
r-ssanv
)
checkdepends=(
r-exact
r-testthat
)
optdepends=(
r-exact
r-ggplot2
r-grid
r-gridextra
r-testthat
)
source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz")
md5sums=('8ad7aa8674eb114e77d9c3c811cf238c')
sha256sums=('9717933a5baa86b242e1a611860f984f660c089c7b3f765fe14ca582a07b98f1')
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:

View file

@ -0,0 +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():
r_pre_build(_G)
def post_build():
git_pkgbuild_commit()
update_aur_repo()

View file

@ -1,19 +1,16 @@
build_prefix: extra-x86_64
maintainers:
- github: kiri2002
- github: pekkarr
email: pekkarr@protonmail.com
repo_depends:
- r-exactci
- r-ssanv
pre_build_script: |
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('-', '.'))
post_build_script: |
git_pkgbuild_commit()
repo_makedepends:
- r-exact
- r-testthat
update_on:
- source: rpkgs
pkgname: exact2x2
repo: cran
md5: true
- alias: r