summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 079b3dc6b538528aaeff449ca6d6731e5861c824 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Maintainer: Pekka Ristola <pekkarr [at] protonmail [dot] com>
# Contributor: peippo <christoph+aur@christophfink.com>

_pkgname=pkgsearch
_pkgver=3.1.4
pkgname=r-${_pkgname,,}
pkgver=${_pkgver//-/.}
pkgrel=1
pkgdesc="Search and Query CRAN R Packages"
arch=(any)
url="https://cran.r-project.org/package=$_pkgname"
license=('MIT')
depends=(
  r-curl
  r-jsonlite
)
checkdepends=(
  r-mockery
  r-pingr
  r-testthat
)
optdepends=(
  r-covr
  r-memoise
  r-mockery
  r-pillar
  r-pingr
  r-rstudioapi
  r-shiny
  r-shinyjs
  r-shinywidgets
  r-testthat
  r-whoami
  r-withr
)
source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz"
        "fix-tests.patch")
md5sums=('92c5529afb1e1373e6c120ba9c02d561'
         'b107e365dd7f7e32cc1e21b4d0cb3db9')
b2sums=('782b5dd1265b2a5137ce9efcb70949955fbaf01b7ce7ee5d9860207f709669697087354056001713acc6c2515c3f89faa4ee1e63afea30d4b6870614be94fbd4'
        '940785dd4867c9c823c76b0ef8123c61b2404b0ba69a6f67380c9684840e6ae98fe68c58f74ea8c5bf64a2e924292e45bd528baf521eed988419a43306f3dddf')

prepare() {
  # skip failing tests
  patch -Np1 -i fix-tests.patch
}

build() {
  mkdir build
  R CMD INSTALL -l build "$_pkgname"
}

check() {
  cd "$_pkgname/tests"
  R_LIBS="$srcdir/build" NOT_CRAN=true Rscript --vanilla testthat.R
}

package() {
  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"
}