aboutsummaryrefslogtreecommitdiffstats
path: root/community/R/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/R/APKBUILD')
-rw-r--r--community/R/APKBUILD87
1 files changed, 67 insertions, 20 deletions
diff --git a/community/R/APKBUILD b/community/R/APKBUILD
index 2a65b534268..1539d0a2a34 100644
--- a/community/R/APKBUILD
+++ b/community/R/APKBUILD
@@ -2,18 +2,40 @@
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=R
-pkgver=4.0.5
+pkgver=4.4.0
pkgrel=0
pkgdesc="Language and environment for statistical computing"
url="https://www.r-project.org/"
-arch="all !mips !mips64"
-license="(GPL-2.0-only OR GPL-3.0-only) AND LGPL-2.1-or-later"
+# riscv64: blocked by java-jre-headless
+arch="all !riscv64"
+license="( GPL-2.0-only OR GPL-3.0-only ) AND LGPL-2.1-or-later"
depends="$pkgname-mathlib"
-depends_dev="gcc gfortran icu-dev libjpeg-turbo libpng-dev make openblas-dev>=0.3.0
- pcre2-dev readline-dev xz-dev zlib-dev bzip2-dev curl-dev>=7.28
+depends_dev="
+ bzip2-dev
+ curl-dev>=7.28
+ gcc
+ gfortran
+ icu-dev
+ libdeflate-dev
+ libjpeg-turbo
+ libpng-dev
+ make
+ musl-dev
+ openblas-dev>=0.3.0
+ pcre2-dev
+ readline-dev
+ xz-dev
+ zlib-dev
"
-makedepends="$depends_dev cairo-dev libxmu-dev openjdk8-jre-base pango-dev
- perl tiff-dev tk-dev
+makedepends="
+ $depends_dev
+ cairo-dev
+ java-jdk
+ libxmu-dev
+ pango-dev
+ perl
+ tiff-dev
+ tk-dev
"
install="$pkgname.post-install"
subpackages="$pkgname-mathlib $pkgname-dev:_dev $pkgname-doc"
@@ -23,10 +45,19 @@ _rhome="usr/lib/R"
ldpath="/$_rhome/lib"
build() {
+ # Performance is more important than size for R. Moreover, -O2 has
+ # only minimal impact on the R package size (less than 1 %).
+ export CFLAGS="${CFLAGS/-Os/-O2}"
+ export CPPFLAGS="${CPPFLAGS/-Os/-O2}"
+ export CXXFLAGS="${CXXFLAGS/-Os/-O2}"
+
# CXXFLAGS is propagated to /etc/R/Makeconf that is read when building
# additional R modules. -D__MUSL__ is needed for some modules like Rcpp.
# htps://github.com/RcppCore/Rcpp/issues/448
- CXXFLAGS="$CXXFLAGS -D__MUSL__" ./configure \
+ export CXXFLAGS="$CXXFLAGS -D__MUSL__"
+
+ r_cv_have_curl728=y \
+ ./configure \
--prefix=/usr \
--sysconfdir=/etc/R \
--localstatedir=/var \
@@ -38,6 +69,7 @@ build() {
--disable-nls \
--enable-R-shlib \
--enable-java \
+ --enable-lto \
--without-recommended-packages \
--with-blas=openblas \
--with-cairo \
@@ -49,14 +81,33 @@ build() {
--with-tcltk \
--with-x
- make -j1
- make -j1 -C src/nmath/standalone
+ make
+ make -C src/nmath/standalone
}
-# TODO: Run provided test suite.
check() {
- ./bin/R --version
- ./bin/R --slave --vanilla -e 'print("Hello, world!")'
+ # Try running R (and also aid debugging).
+ ./bin/R --vanilla -s -e 'sessionInfo(); R_compiled_by(); str(.Machine)'
+
+ case "$CARCH" in
+ # A (non-portable) numerical regression test currently (R 4.4.0)
+ # fails on the aarch64 and s390x runners.
+ # Run at least two basic test suites:
+ aarch64 | s390x)
+ make -C tests test-Examples && make -C tests test-Specific || {
+ tail -v -n 42 tests/*.fail; exit 1
+ }
+ ;;
+ *)
+ make check || {
+ tail -v -n 42 tests/*.fail; exit 1
+ }
+ ;;
+ esac
+
+ # NOTE: EST5EDT-related differences reported for datetime.Rout are known
+ # (see <https://mm.icann.org/pipermail/tz/2024-March/058740.html>
+ # or also <https://bugs.r-project.org/show_bug.cgi?id=16843#c12>)
}
package() {
@@ -86,12 +137,6 @@ package() {
mv "$f" "$pkgdir"/etc/R/ && ln -sf /etc/R/$f $f
done
cd -
-
- # Fix #8918
- # R expects iconv -l to return whitespace-separated list of
- # locales, our returns ', ' separated so it adds a , for every
- # locale
- sed -i 's/,//g' "$pkgdir"/usr/lib/R/library/utils/iconvlist
}
mathlib() {
@@ -106,4 +151,6 @@ _dev() {
default_dev
}
-sha512sums="6ff5b0f9cb6b17f66cde1f5585d1b33659dbae8919d34c2e593f68a0bff4d0425aa9704d99284d103702a9cd42f613311f3a87af6b939b1af65dcec80bf2ca8c R-4.0.5.tar.gz"
+sha512sums="
+8f44eac49c58db7f161732135be4d1757f65b18545f3f15c463d499794735d02f4a4cb9bacff90d16e80b624ead8aa0af16899cf7654b6cb91a46868e405bd17 R-4.4.0.tar.gz
+"