1 # Maintainer: Antonio Rojas <arojas@archlinux.org>
2 # Contributor: Ronald van Haren <ronald.archlinux.org>
3 # Contributor: Damir Perisa <damir.perisa@bluewin.ch>
4 # Contributor: K. Piche <kpiche@rogers.com>
9 pkgdesc='Language and environment for statistical computing and graphics'
12 url='https://www.r-project.org/'
13 depends=(lapack libtiff pcre2 perl libxmu pango zip unzip curl icu which)
14 makedepends=(jdk-openjdk gcc-fortran tk texlive-core)
15 optdepends=('tk: tcl/tk interface'
16 'texlive-bin: latex sty files'
17 'gcc-fortran: needed to compile some CRAN packages'
18 'openblas: faster linear algebra')
19 backup=('etc/R/Makeconf' 'etc/R/Renviron' 'etc/R/ldpaths' 'etc/R/repositories' 'etc/R/javaconf')
21 source=(https://cran.r-project.org/src/base/R-${pkgver%%.*}/R-$pkgver.tar.gz
25 sha256sums=('45dcc48b6cf27d361020f77fde1a39209e997b81402b3663ca1c010056a6a609'
26 '25b01ea93fa704884b65ba002d44d4e99725bd826997e8c73b6467df9f23c798'
27 '1580d06a737951f4f3c903cbd514247d9071fc6868eb9c2de94bb999cc195cb1'
28 'b7833166041b06f716b6a79095d27d4abd83549816dc53193213827139eae6ef')
32 # set texmf dir correctly in makefile
33 sed -i 's|$(rsharedir)/texmf|${datarootdir}/texmf|' share/Makefile.in
38 # -ffat-lto-objects is needed for third-party packages shipping static libraries
39 CFLAGS+=" -ffat-lto-objects" \
40 CXXFLAGS+=" -ffat-lto-objects" \
41 ./configure --prefix=/usr \
44 --datarootdir=/usr/share \
45 rsharedir=/usr/share/R/ \
46 rincludedir=/usr/include/R/ \
47 rdocdir=/usr/share/doc/R/ \
50 --enable-memory-profiling \
58 cd src/nmath/standalone
64 make DESTDIR="$pkgdir" install install-pdf install-info
67 cd src/nmath/standalone
68 make DESTDIR="$pkgdir" install
70 # Fixup R wrapper scripts.
71 sed -i "s|$pkgdir ||" "${pkgdir}/usr/bin/R"
72 rm "$pkgdir"/usr/lib/R/bin/R
73 cd "$pkgdir"/usr/lib/R/bin
76 # install some freedesktop.org compatibility
77 install -Dm644 "$srcdir"/r.desktop -t "$pkgdir"/usr/share/applications
78 install -Dm644 "$srcdir"/r.png -t "$pkgdir"/usr/share/pixmaps
80 # move the config directory to /etc and create symlinks
81 install -d "$pkgdir"/etc/R
82 cd "$pkgdir"/usr/lib/R/etc
84 mv -f $_i "$pkgdir"/etc/R
88 # Install ld.so.conf.d file to ensure other applications access the shared lib
89 install -Dm644 "$srcdir"/R.conf -t "$pkgdir"/etc/ld.so.conf.d
91 # Add provides for bundled packages
92 for _f in "$pkgdir"/usr/lib/R/library/*/DESCRIPTION; do
93 _pkg=$(grep Package: $_f | cut -d' ' -f2 | tr '[:upper:]' '[:lower:]')
94 _ver=$(grep Version $_f | cut -d' ' -f2)
95 _prov="r-$_pkg=${_ver/-/.}"