# Description: RStudio - an Interface for GNU R # URL: https://www.rstudio.com/ # Maintainer: Tim Biermann, tbier at posteo dot de # Depends on: ant boost hyphen libevent mathjax openjdk8 pandoc-bin qtwebengine r name=rstudio version=1.2.5042 release=2 # $SRC/$name-$version/dependencies/common/install-gwt _gwtver=2.8.1 _ginver=2.1.2 source=( https://github.com/rstudio/rstudio/archive/v$version/$name-$version.tar.gz https://s3.amazonaws.com/rstudio-buildtools/gin-$_ginver.zip https://s3.amazonaws.com/rstudio-buildtools/gwt-$_gwtver.zip https://s3.amazonaws.com/rstudio-dictionaries/core-dictionaries.zip # https://gitweb.gentoo.org/repo/gentoo.git/tree/sci-mathematics/rstudio/files rstudio-1.2.1335-boost-1.70.0_p1.patch rstudio-1.2.1335-boost-1.70.0_p2.patch rstudio-1.2.5042-boost-1.73.0.patch # https://github.com/rstudio/rstudio/commit/60dd6e3cd349cc208e33a12635378a1e338f8efc.patch r-nosave.patch) git=(https://github.com/rstudio/rstudio.git) unpack_source() { for file in ${source[@]}; do case ${file##*/} in rstudio-$version.tar.gz) bsdtar -p -o -C $SRC -xf $(get_filename $file) ;; #if you need a git based build, comment the line above and uncomment the line below #git clone $git $SRC/$name-$version ;; gwt-$_gwtver.zip) gwtdir=$SRC/$name-$version/src/gwt install -d $gwtdir/dictionaries install -d $gwtdir/lib/gwt install -d $gwtdir/lib/gwt/$_gwtver unzip -qd $gwtdir/lib/gwt/$_gwtver $(get_filename $file) # ;; mv $gwtdir/lib/gwt/$_gwtver/gwt-$_gwtver/* $gwtdir/lib/gwt/$_gwtver ;; gin-$_ginver.zip) gwtdir=$SRC/$name-$version/src/gwt install -d $gwtdir/lib/gin install -d $gwtdir/lib/gin/$_ginver unzip -qo $(get_filename $file) -d $gwtdir/lib/gin/$_ginver ;; *) cp $(get_filename $file) $SRC ;; esac done } build() { ## if you want your git snapshot to be a particular version ## uncomment below and change every occurance of $name-$version to $name #git checkout v$version $name patch -Np1 -d $name-$version -i $SRC/rstudio-1.2.1335-boost-1.70.0_p1.patch patch -Np1 -d $name-$version -i $SRC/rstudio-1.2.1335-boost-1.70.0_p2.patch patch -Np1 -d $name-$version -i $SRC/rstudio-1.2.5042-boost-1.73.0.patch sed -i 's/2009-12/2009-19/g' $name-$version/src/cpp/r/session/REmbeddedPosix.cpp patch -Np1 -d $name-$version -i $SRC/r-nosave.patch pushd $name-$version/dependencies/common install -d pandoc ln -sfT /usr/share/myspell/dicts dictionaries ln -sfT /usr/share/mathjax mathjax-26 ln -sfT /usr/bin/pandoc pandoc/pandoc ln -sfT /usr/bin/pandoc-citeproc pandoc/pandoc-citeproc bash install-packages popd export PATH="/usr/lib/java/openjdk8/jre/bin/:${PATH}" cmake -S$name-$version -Bbuild -GNinja\ -DCMAKE_INSTALL_PREFIX=/usr/lib/rstudio \ -DRSTUDIO_TARGET=Desktop \ -DCMAKE_BUILD_TYPE=Release \ -DRSTUDIO_USE_SYSTEM_BOOST=ON \ -DQT_QMAKE_EXECUTABLE=/usr/lib/qt5/bin/qmake \ -DBoost_NO_BOOST_CMAKE=ON \ -DRSTUDIO_BUNDLE_QT=FALSE \ -Wno-dev cmake --build build DESTDIR=$PKG cmake --build build --target install install -dm755 $PKG/usr/bin/ ln -s /usr/lib/$name/bin/$name $PKG/usr/bin/$name sed -i 's|/usr/lib/rstudio/bin/rstudio|/usr/bin/rstudio|g' $PKG/usr/share/applications/rstudio.desktop find $PKG \(\ -iname '*README*' -o \ -iname '*COPYING*' -o \ -iname 'INSTALL' \ \) -delete || true }