summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPekka Ristola2022-02-21 13:37:54 +0200
committerPekka Ristola2022-02-21 13:37:54 +0200
commitb1b1e7ca529e3d8149329eec0fab744249bace4e (patch)
treee7d8fc9caa1f5eadb594a66f38ca7fa5adde227e
parent9b715b124f971e633ca700404b8d1e224ff125ec (diff)
downloadaur-b1b1e7ca529e3d8149329eec0fab744249bace4e.tar.gz
Add check() function
-rw-r--r--.SRCINFO2
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD13
3 files changed, 15 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 1651cc2f1238..1886e9abf9bd 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = r-testit
pkgdesc = A Simple Package for Testing R Packages
pkgver = 0.13
- pkgrel = 1
+ pkgrel = 2
url = https://cran.r-project.org/package=testit
arch = any
license = GPL3
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..018a3de08144
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*
+!PKGBUILD
+!.SRCINFO
+!.gitignore
diff --git a/PKGBUILD b/PKGBUILD
index 0e57281995c3..808b71ea4f31 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,3 +1,4 @@
+# Maintainer: Pekka Ristola <pekkarr [at] protonmail [dot] com>
# Contributor: Viktor Drobot (aka dviktor) linux776 [at] gmail [dot] com
# Contributor: Kibouo <csonka.mihaly@hotmail.com>
# Contributor: Alex Branham <branham@utexas.edu>
@@ -6,7 +7,7 @@ _cranname=testit
_cranver=0.13
pkgname=r-${_cranname,,}
pkgver=${_cranver//[:-]/.}
-pkgrel=1
+pkgrel=2
pkgdesc="A Simple Package for Testing R Packages"
arch=(any)
url="https://cran.r-project.org/package=${_cranname}"
@@ -17,11 +18,17 @@ source=("https://cran.r-project.org/src/contrib/${_cranname}_${_cranver}.tar.gz"
sha256sums=('90d47168ab6bdbd1274b600b457626ac07697ce09792c92b2043be5f5b678d80')
build() {
- R CMD INSTALL ${_cranname}_${_cranver}.tar.gz -l "${srcdir}"
+ mkdir -p build
+ R CMD INSTALL "${_cranname}" -l "${srcdir}/build"
+}
+
+check() {
+ cd "${_cranname}/tests"
+ R_LIBS="${srcdir}/build" _R_CHECK_PACKAGE_NAME_=false Rscript --vanilla test-all.R
}
package() {
install -dm0755 "${pkgdir}/usr/lib/R/library"
- cp -a --no-preserve=ownership "${_cranname}" "${pkgdir}/usr/lib/R/library"
+ cp -a --no-preserve=ownership "build/${_cranname}" "${pkgdir}/usr/lib/R/library"
}