[aur-general] Packaging all CRAN packages for R

Alex Branham alex.branham at gmail.com
Wed May 30 18:40:33 UTC 2018


Thanks for your help. I've adopted a few R packages in the AUR[1] in the
meantime and updated them with the output of this automated script. I've
included an example of a current one below. Note that the r-cran-* stuff
isn't mine; they're packages other people have already uploaded to the
AUR.

I think I've managed to automate everything, the only exception being
that there's no way (as far as I can see, anyway) to tell if a package
has non-R dependencies (e.g. some packages need gcc-fortran to be
installed, but there's no way to tell that automatically I think).

Thanks again everyone for your help!
Alex

Footnotes:
[1]  https://aur.archlinux.org/packages/?K=jabranham&SeB=m

# Maintainer: Alex Branham <--address at hidden-->
_cranname=zoo
_cranver=1.8-1
_pkgtar=${_cranname}_${_cranver}.tar.gz
pkgname=r-zoo
pkgver=${_cranver//[:-]/.}
pkgrel=1
pkgdesc="S3 Infrastructure for Regular and Irregular Time Series (Zs Ordered Observations)"
arch=('any')
url="https://cran.r-project.org/web/packages/${_cranname}/index.html"
license=('GPL')
depends=('r' )

optdepends=('r-cran-coda' 'r-cran-chron' 'r-daag' 'r-fts' 'r-cran-ggplot2' 'r-mondate' 'r-cran-scales' 'r-strucchange' 'r-timedate' 'r-timeseries' 'r-tis' 'r-tseries' 'r-xts')

source=("https://cran.r-project.org/src/contrib/${_pkgtar}")
md5sums=('bf8789b3a448b5bed39e54e027ee7c6a')

build(){
    R CMD INSTALL ${_pkgtar} -l $srcdir
}
package() {
    install -d "$pkgdir/usr/lib/R/library"
    cp -r "$srcdir/$_cranname" "$pkgdir/usr/lib/R/library"
}


More information about the aur-general mailing list