mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-02-28 11:11:37 +01:00
118 lines
3.0 KiB
Plaintext
118 lines
3.0 KiB
Plaintext
# Contributor: Nirosan <pnirosan@gmail.com>
|
|
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
|
|
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
|
|
pkgname=R
|
|
pkgver=3.3.1
|
|
pkgrel=0
|
|
pkgdesc="Language and environment for statistical computing"
|
|
url="https://www.r-project.org"
|
|
arch="x86_64 x86"
|
|
license="GPL-2 GPL-3 LGPL-2.1"
|
|
depends=""
|
|
depends_dev="gcc gfortran icu-dev libjpeg-turbo libpng-dev make openblas-dev
|
|
pcre-dev>=8.10 readline-dev xz-dev zlib-dev
|
|
"
|
|
makedepends="$depends_dev bzip2-dev cairo-dev curl-dev>=7.28 libxmu-dev
|
|
openjdk8-jre-base pango-dev perl tiff-dev tk-dev
|
|
"
|
|
install="$pkgname.post-install"
|
|
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() {
|
|
cd "$builddir"
|
|
|
|
# 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 \
|
|
--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 \
|
|
--disable-nls \
|
|
--enable-R-shlib \
|
|
--enable-java \
|
|
--without-recommended-packages \
|
|
--with-blas=openblas \
|
|
--with-cairo \
|
|
--with-ICU \
|
|
--with-jpeglib \
|
|
--with-lapack \
|
|
--with-libpng \
|
|
--with-libtiff \
|
|
--with-tcltk \
|
|
--with-x \
|
|
|| return 1
|
|
make || return 1
|
|
|
|
cd src/nmath/standalone
|
|
make shared
|
|
}
|
|
|
|
package() {
|
|
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
|
|
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"/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 -
|
|
}
|
|
|
|
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="f50a659738b73036e2f5635adbd229c5 R-3.3.1.tar.gz"
|
|
sha256sums="3dc59ae5831f5380f83c169bac2103ad052efe0ecec4ffa74bde4d85a0fda9e2 R-3.3.1.tar.gz"
|
|
sha512sums="d0ff85e99b9ec9cac672aa30d7d1a854778c6a610bcc5336e8c60c8c74f20856f2bfeae085af793fad646ff45cb4677d9d6dcbaa18212591f72f00a02339f4cd R-3.3.1.tar.gz"
|