Guest User

Untitled

a guest
Jul 10th, 2017
191
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Maintainer: Meow < leon.tty1 at gmail dot com >
  2.  
  3. # Get download links and md5 sums for latest version of RStudio desktop
  4. ## R code #############
  5. #
  6. #  require(XML)
  7. #  page = htmlTreeParse("http://www.rstudio.com/products/rstudio/download/",useInternalNodes = T)
  8. #  links = sapply(getNodeSet(page,'//table[@class="downloads"]/thead/tr/th[text()="Installers"]/../../..//a[contains(@href,".deb")]'),xmlGetAttr,'href')
  9. #  md5sums = sapply(getNodeSet(page,'//table[@class="downloads"]/thead/tr/th[text()="Installers"]/../../..//a[contains(@href,".deb")]/../..//code'),xmlValue)
  10. #  print(cbind(links,md5sums))
  11. #
  12. #######################
  13.  
  14. pkgname=rstudio-desktop-bin
  15. pkgver=1.0.147
  16. pkgrel=1
  17. pkgdesc="A new integrated development environment (IDE) for R (binary version from RStudio official website)"
  18. arch=('i686' 'x86_64')
  19. license=('GPL')
  20. url="http://www.rstudio.org/"
  21. depends=('r' 'gstreamer' 'gst-plugins-base' 'hicolor-icon-theme' 'libxcomposite' 'libxslt' 'shared-mime-info' 'libxrandr' 'pandoc' 'pandoc-citeproc')
  22. #makedepends=('patchelf')
  23. conflicts=('rstudio-desktop' 'rstudio-desktop-git' 'rstudio-desktop-preview-bin')
  24. provides=("rstudio-desktop=${pkgver}")
  25. options=(!strip)
  26.  
  27. _x86md5=21ca14bffcdc1a2361ead2d763d0313d
  28. _x64md5=ba0434ec9acd04a9bb2b91aa29b0cca5
  29.  
  30. case "$CARCH" in
  31.     'i686')
  32.         _arch=i386
  33.     _archx=
  34.         md5sums=($_x86md5)
  35.         ;;
  36.     'x86_64')
  37.         _arch=amd64
  38.     _archx=64
  39.         md5sums=($_x64md5)
  40.         ;;
  41. esac    
  42. source=("https://s3.amazonaws.com/rstudio-dailybuilds/rstudio-xenial-${pkgver}-${_arch}.deb")
  43. install="$pkgname".install
  44.  
  45. package() {
  46.  
  47.     shopt -s extglob
  48.  
  49.   msg "Converting debian package..."
  50.  
  51.   cd "$srcdir"
  52.   tar xpf data.tar.gz -C "$pkgdir"
  53.   install -dm755 "$pkgdir/usr/bin"
  54.  
  55.   #cd "$pkgdir/usr/lib/rstudio/bin"
  56.   #ln -sf /usr/lib/libncursesw.so.6 libtinfo.so.5
  57.   #ln -sf /usr/lib/libedit.so.0  libedit.so.2
  58.  
  59. #  cd "$pkgdir/usr/lib/rstudio/bin/rsclang"
  60. #  patchelf --set-rpath '$ORIGIN/..' libclang.so
  61.  
  62.   cd "$pkgdir/usr/lib/rstudio/bin/pandoc"
  63.   ln -sf /usr/bin/pandoc ./
  64.   ln -sf /usr/bin/pandoc-citeproc ./
  65.  
  66. #  cd "$pkgdir/usr/lib/rstudio/bin/plugins"
  67. #  ls */*.so | xargs -n1 patchelf --set-rpath '$ORIGIN/../..'
  68.  
  69.   find "$pkgdir/usr" -type d -print0 | xargs -0 chmod 755
  70.   find "$pkgdir/usr" -type f -name '*.so.*' -print0 | xargs -0 chmod 644
  71.  
  72.   cd "$pkgdir/usr/lib/rstudio/bin"
  73.   ls libQt*.so.*| grep '\.[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}$'|
  74.   while read x;do
  75.     if [[ ! -e "${x%.+([0-9]).+([0-9])}" ]];then
  76.       ln -s "$x" "${x%.+([0-9]).+([0-9])}"
  77.     fi
  78.   done
  79.   ls lib*.so.* | grep '\.so\.[0-9]\{1,\}\.[0-9]\{1,\}$'|
  80.   while read x;do
  81.     if [[ ! -e "${x%.+([0-9])}" ]];then
  82.       ln -s "$x" "${x%.+([0-9])}"
  83.     fi
  84.   done
  85.  
  86.   cd "$pkgdir/usr/bin"
  87.   #ln -s -f ../lib/rstudio/bin/rstudio rstudio-bin
  88.   echo '#!/bin/sh
  89. export QT_DIR=/usr/lib/rstudio/bin
  90. export QT_PLUGIN_PATH=$QT_DIR/plugins
  91. export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_PLUGIN_PATH/platforms
  92. export KDEDIRS=/usr
  93. exec /usr/lib/rstudio/bin/rstudio "$@"
  94. ' > "$pkgdir/usr/bin/rstudio-bin"
  95.   chmod 755 "$pkgdir/usr/bin/rstudio-bin"
  96.  
  97.   sed -i 's|/usr/lib/rstudio/bin/rstudio|/usr/bin/rstudio-bin|' "$pkgdir/usr/share/applications/rstudio.desktop"
  98. }
  99. # vim:ft=sh tabstop=2 expandtab
RAW Paste Data