diff options
-rw-r--r-- | testing/R/APKBUILD | 123 |
1 files changed, 95 insertions, 28 deletions
diff --git a/testing/R/APKBUILD b/testing/R/APKBUILD index d26ab0c496..7bbb2fd351 100644 --- a/testing/R/APKBUILD +++ b/testing/R/APKBUILD @@ -1,47 +1,114 @@ # Contributor: Nirosan <pnirosan@gmail.com> -# Maintainer: Nirosan <pnirosan@gmail.com> +# Contributor: Jakub Jirutka <jakub@jirutka.cz> +# Maintainer: Jakub Jirutka <jakub@jirutka.cz> pkgname=R pkgver=3.3.0 -pkgrel=0 -pkgdesc="R-3.2.4 project for Statistical Computing" +pkgrel=1 +pkgdesc="Language and environment for statistical computing" url="https://www.r-project.org" -arch="all" -license="MIT" -depends="gfortran readline-dev xz-dev zlib-dev bzip2-dev pcre-dev curl-dev perl" -depends_dev="" -makedepends="$depends_dev" -install="" -subpackages="$pkgname-doc" -source="https://cran.r-project.org/src/base/R-3/$pkgname-$pkgver.tar.gz" - -_builddir="$srcdir"/$pkgname-$pkgver -prepare() { - local i - cd "$_builddir" - for i in $source; do - case $i in - *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; - esac - done -} +arch="x86_64 x86" +license="GPL-2 GPL-3 LGPL-2.1" +depends="" +makedepends="bzip2-dev curl-dev>=7.28 gfortran lapack-dev pcre-dev>=8.10 perl + readline-dev xz-dev zlib-dev + " +subpackages=" + $pkgname-mathlib + $pkgname-mathlib-dev:mathlib_dev + $pkgname-dev + $pkgname-doc + " +source="https://cran.r-project.org/src/base/R-${pkgver%%.*}/$pkgname-$pkgver.tar.gz" +builddir="$srcdir/$pkgname-$pkgver" + +_rhome="usr/lib/R" +ldpath="/$_rhome/lib" build() { - export LD_LIBRARY_PATH="$pkgdir"/lib64/R/lib:$LD_LIBRARY_PATH - cd "$_builddir" + cd "$builddir" + ./configure \ --prefix=/usr \ + --sysconfdir=/etc/R \ + --localstatedir=/var \ --mandir=/usr/share/man \ + --libdir=/usr/lib \ + rdocdir=/usr/share/doc/R/ \ + rincludedir=/usr/include/R/ \ + rsharedir=/usr/share/R/ \ + --enable-R-shlib \ + --disable-java \ + --disable-nls \ + --with-blas \ + --with-lapack \ + --without-tcltk \ + --without-cairo \ + --without-libpng \ + --without-jpeglib \ + --without-libtiff \ + --without-recommended-packages \ + --without-ICU \ --without-x \ || return 1 make || return 1 -# make check || return 1 + + cd src/nmath/standalone + make shared } package() { - cd "$_builddir" + local destdir="$pkgdir/$_rhome" + + cd "$builddir" + + make DESTDIR="$pkgdir" install || return 1 + + # Install libRmath.so. + cd src/nmath/standalone make DESTDIR="$pkgdir" install || return 1 - ln -s "$pkgdir"/bin/R R - ln -s "$pkgdir"/bin/Rscript Rscript + cd - + + # Fixup R wrapper script (taken from Arch). + rm "$destdir"/bin/R + ln -sf /usr/bin/R "$destdir"/bin/R + + # Remove some useless files (COPYING is duplicated, it will be + # in -doc, don't worry). + rm "$destdir"/etc/javaconf "$destdir"/COPYING "$destdir"/SVN-REVISION + + mkdir -p "$pkgdir"/etc/R + + # R apparently ignores --sysconfdir, so we must manually move configs + # to /etc/R and make symlinks. + cd "$destdir"/etc || return 1 + local f; for f in *; do + mv "$f" "$pkgdir"/etc/R/ && ln -sf /etc/R/$f $f || return 1 + done + cd - + + # Some R packages needs that... + mkdir -p "$pkgdir"/etc/profile.d + cat > "$pkgdir"/etc/profile.d/$pkgname.sh <<-EOF + export R_HOME="$_rhome" + EOF +} + +mathlib() { + pkgdesc="$pkgdesc (libRmath)" + + install -D "$pkgdir"/usr/lib/libRmath.so \ + "$subpkgdir"/usr/lib/libRmath.so +} + +mathlib_dev() { + pkgdesc="$pkgdesc (libRmath, development files)" + depends="$pkgname-mathlib" + + local path + for path in usr/lib/libRmath.so usr/lib/pkgconfig/libRmath.pc; do + mkdir -p "$subpkgdir"/$(dirname $path) + mv "$pkgdir"/$path "$subpkgdir"/$path || return 1 + done } md5sums="5a7506c8813432d1621c9725e86baf7a R-3.3.0.tar.gz" |