archrelease: copy trunk to extra-x86_64
[arch-packages.git] / r / trunk / PKGBUILD
blob1c81a06bebfd4b71502389381a166296a5315e44
1 # Maintainer: Ronald van Haren <ronald.archlinux.org>
2 # Maintainer: Antonio Rojas <arojas@archlinux.org>
3 # Contributor: Damir Perisa <damir.perisa@bluewin.ch>
4 # Contributor: K. Piche <kpiche@rogers.com>
6 pkgname=r
7 pkgver=4.1.2
8 pkgrel=2
9 pkgdesc="Language and environment for statistical computing and graphics"
10 arch=('x86_64')
11 license=('GPL')
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')
20 options=('!emptydirs')
21 source=("https://cran.r-project.org/src/base/R-${pkgver%%.*}/R-${pkgver}.tar.gz"
22         'r.desktop'
23         'r.png'
24         'R.conf')
25 sha256sums=('2036225e9f7207d4ce097e54972aecdaa8b40d7d9911cd26491fac5a0fab38af'
26             '25b01ea93fa704884b65ba002d44d4e99725bd826997e8c73b6467df9f23c798'
27             '1580d06a737951f4f3c903cbd514247d9071fc6868eb9c2de94bb999cc195cb1'
28             'b7833166041b06f716b6a79095d27d4abd83549816dc53193213827139eae6ef')
30 prepare() {
31   cd R-${pkgver}
32   # set texmf dir correctly in makefile
33   sed -i 's|$(rsharedir)/texmf|${datarootdir}/texmf|' share/Makefile.in
36 build() {
37   cd R-$pkgver
38   ./configure  --prefix=/usr \
39                --libdir=/usr/lib \
40                --sysconfdir=/etc/R \
41                --datarootdir=/usr/share \
42                rsharedir=/usr/share/R/ \
43                rincludedir=/usr/include/R/ \
44                rdocdir=/usr/share/doc/R/ \
45                --with-x \
46                --enable-R-shlib \
47                --with-lapack \
48                --with-blas \
49                F77=gfortran \
50                LIBnn=lib
51   make
52   make pdf
54   cd src/nmath/standalone
55   make shared
58 package() {
59   cd R-$pkgver
60   make DESTDIR="$pkgdir" install install-pdf
62 # install libRmath.so
63   cd src/nmath/standalone
64   make DESTDIR="${pkgdir}" install
66 # Fixup R wrapper scripts.
67   sed -i "s|${pkgdir} ||" "${pkgdir}/usr/bin/R"
68   rm "${pkgdir}/usr/lib/R/bin/R"
69   cd "${pkgdir}/usr/lib/R/bin"
70   ln -s ../../../bin/R
72 # install some freedesktop.org compatibility
73   install -Dm644 "${srcdir}/r.desktop" -t "${pkgdir}/usr/share/applications"
74   install -Dm644 "${srcdir}/r.png" -t "${pkgdir}/usr/share/pixmaps"
76 # move the config directory to /etc and create symlinks
77   install -d "${pkgdir}/etc/R"
78   cd "${pkgdir}/usr/lib/R/etc"
79   for i in *; do
80     mv -f ${i} "${pkgdir}/etc/R"
81     ln -s /etc/R/${i} ${i}
82   done
84 # Install ld.so.conf.d file to ensure other applications access the shared lib
85   install -Dm644 "${srcdir}/R.conf" -t "${pkgdir}/etc/ld.so.conf.d"