summaryrefslogtreecommitdiff
path: root/extra/r/PKGBUILD
blob: 4f8843606301480b9499d279df62ad98062f7099 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# $Id: PKGBUILD 177618 2013-02-08 07:48:31Z ronald $
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor: Damir Perisa <damir.perisa@bluewin.ch>
# Contributor: K. Piche <kpiche@rogers.com>

pkgname=r
pkgver=2.15.2
pkgrel=3
pkgdesc="Language and environment for statistical computing and graphics"
arch=('i686' 'x86_64' 'mips64el')
license=('GPL')
url=('http://www.r-project.org/')
depends=('blas' 'lapack' 'bzip2'  'libpng' 'libjpeg' 'libtiff'
         'ncurses' 'pcre' 'readline' 'zlib' 'perl' 'gcc-libs'
         'libxt' 'libxmu' 'pango' 'xz' 'desktop-file-utils')
makedepends=('openjdk6' 'gcc-fortran' 'tk>=8.6.0')
optdepends=('tk: tcl/tk interface' 'texlive-bin: latex sty files')
backup=('etc/R/Makeconf' 'etc/R/Renviron' 'etc/R/ldpaths' 'etc/R/repositories')
options=('!makeflags' '!emptydirs')
source=("http://cran.r-project.org/src/base/R-2/R-${pkgver}.tar.gz"
	'r.desktop'
	'r.png'
	'R.conf'
	'x11.patch')
install=r.install
sha1sums=('c80da687d66ee88d1e34fc1ae5c1bd525f9513dd'
          '13aa29219bcaa102e575de8c1c8e0833d233e836'
          'a69a07ec363440efc18ce0a7f2af103375dea978'
          '43668da6cfd1b4455a99f23e79e2059294dddac9'
          'a11b91d53645bd545fddc382c991096502e8ac67')

build() {
   cd "${srcdir}/R-${pkgver}"
   sed -i 's|#define NeedFunctionPrototypes 0|#define NeedFunctionPrototypes 1|g' src/modules/X11/dataentry.c

  # set texmf dir correctly in makefile
  sed -i 's|$(rsharedir)/texmf|${datarootdir}/texmf|' share/Makefile.in

  # upstream patch fixing empty plots FS#32597
  patch -Np0 -i ${srcdir}/x11.patch

   ./configure  --prefix=/usr \
		--libdir=/usr/lib \
		--sysconfdir=/etc/R \
		--datarootdir=/usr/share \
		  rsharedir=/usr/share/R/ \
		  rincludedir=/usr/include/R/ \
		  rdocdir=/usr/share/doc/R/ \
                --with-x \
		--enable-R-shlib \
                --with-lapack \
		--with-blas \
                F77=gfortran \
		LIBnn=lib
   make
}

package() {
   cd "${srcdir}/R-${pkgver}"
   make -j1 DESTDIR="${pkgdir}" install

   #  Fixup R wrapper scripts.
   sed -i "s|${pkgdir} ||" "${pkgdir}/usr/bin/R"
   rm "${pkgdir}/usr/lib/R/bin/R"
   cd "${pkgdir}/usr/lib/R/bin"
   ln -s ../../../bin/R

  # install some freedesktop.org compatibility
  install -Dm644 "${srcdir}/r.desktop" \
	"${pkgdir}/usr/share/applications/r.desktop"
  install -Dm644 "${srcdir}/r.png" \
	"${pkgdir}/usr/share/pixmaps/r.png"

  # move the config directory to /etc and create symlinks
  install -d "${pkgdir}/etc/R"
  cd "${pkgdir}/usr/lib/R/etc"
  for i in *; do
    mv -f ${i} "${pkgdir}/etc/R"
    ln -s /etc/R/${i} ${i}
  done

  # Install ld.so.conf.d file to ensure other applications access the shared lib
  install -Dm644 ${srcdir}/R.conf ${pkgdir}/etc/ld.so.conf.d/R.conf
}