summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0e4126daed4ac9c13d6149d5478959415b097b99 (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
85
86
87
88
89
90
91
# Maintainer: chendaniely
# code adapted from: Meow < a.li.devtty at gmail dot com >

pkgname=rstudio-desktop-preview-bin
pkgver=1.0.25
pkgrel=1
pkgdesc="A new integrated development environment (IDE) for R (binary version from RStudio official website)"
arch=('i686' 'x86_64')
license=('GPL')
url="http://www.rstudio.org/"
depends=('r' 'gstreamer0.10-base' 'hicolor-icon-theme' 'libxcomposite' 'libxslt' 'shared-mime-info' 'libxrandr' 'gtk2')
makedepends=('patchelf')
conflicts=('rstudio-desktop' 'rstudio-desktop-git' 'rstudio-desktop-bin')
optdepends=('pandoc-bin'
	    'pandoc-cabal'
	    'pandoc-static')
provides=("rstudio-desktop-preview=${pkgver}")
#options=(!strip)

_x86md5=c9e2b2d2fa4b4234498a51aaf2671806
_x64md5=a42928821bd9aee20e0e242cb3b61990

case "$CARCH" in
	'i686')
		_arch=i386
		md5sums=($_x86md5)
		;;
	'x86_64')
		_arch=amd64
		md5sums=($_x64md5)
		;;
esac

source=("https://s3.amazonaws.com/rstudio-dailybuilds/rstudio-${pkgver}-${_arch}.deb")
#source=("https://s3.amazonaws.com/rstudio-dailybuilds/rstudio-${pkgver}-amd64.deb")
install="$pkgname".install

package() {
  msg "Converting debian package..."

  cd "$srcdir"
  tar zxpf data.tar.gz -C "$pkgdir"
  install -dm755 "$pkgdir/usr/bin"

  #cd "$pkgdir/usr/lib/rstudio/bin"
  #ls lib*.so.* | grep -v libedit | grep -v libtinfo | tr \\n \\0 |xargs -0 rm
  #rm -rf plugins

  #cd "$pkgdir/usr/lib/rstudio/bin/rsclang"
  #ln -sf /usr/lib/libclang.so ./

  cd "$pkgdir/usr/lib/rstudio/bin"
  ln -sf /usr/lib/libncursesw.so.6 libtinfo.so.5
  ln -sf /usr/lib/libedit.so.0  libedit.so.2

  cd "$pkgdir/usr/lib/rstudio/bin/rsclang"
  patchelf --set-rpath '$ORIGIN/..' libclang.so

  cd "$pkgdir/usr/lib/rstudio/bin/plugins"
  ls */*.so | xargs -n1 patchelf --set-rpath '$ORIGIN/../..'

  find "$pkgdir/usr" -type d -print0 | xargs -0 chmod 755

  cd "$pkgdir/usr/bin"
  #ln -s -f ../lib/rstudio/bin/rstudio rstudio-bin
  echo '#!/bin/sh
export QT_DIR=/usr/lib/rstudio/bin
export QT_PLUGIN_PATH=$QT_DIR/plugins
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_PLUGIN_PATH/platforms
export KDEDIRS=/usr
exec /usr/lib/rstudio/bin/rstudio
' > "$pkgdir/usr/bin/rstudio-preview-bin"
  chmod 755 "$pkgdir/usr/bin/rstudio-preview-bin"

  sed -i 's|/usr/lib/rstudio/bin/rstudio|/usr/bin/rstudio-preview-bin|' "$pkgdir/usr/share/applications/rstudio.desktop"

  # pandoc fix
  ## uncomment double hashes for preview fix
  ##SYS_PANDOC=`which pandoc`
  ##SYS_PANDOC_CITEPROC=`which pandoc-citeproc`
   ##cd "$pkgdir/usr/lib/rstudio/bin/pandoc"
   ##mv pandoc pandoc_rstudio
   # ln -sf /usr/bin/pandoc pandoc
   # ln -sf $SYS_PANDOC pandoc
   ##ln -sf $SYS_PANDOC $pkgdir/usr/lib/rstudio/bin/pandoc/pandoc
   ##mv pandoc-citeproc pandoc-citeproc_rstudio
   # ln -sf /usr/bin/pandoc-citeproc pandoc-citeproc
   # ln -sf $SYS_PANDOC_CITEPROC pandoc-citeproc
   ##ln -sf $SYS_PANDOC_CITEPROC $pkgdir/usr/lib/rstudio/bin/pandoc/pandoc-citeproc
}
# vim:ft=sh tabstop=2 expandtab