contrib/rstudio/Pkgfile

81 lines
2.7 KiB
Plaintext

# 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.5033
_gwtver=2.8.1
_ginver=2.1.2
release=1
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
217ce0962734ae85621fd82f0eed86129c991a79.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() {
cd $name-$version
#if you want your git snapshot to be a particular version
#git checkout v$version
patch -Np1 -i $SRC/217ce0962734ae85621fd82f0eed86129c991a79.patch
pushd 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
mkdir build
pushd build
export PATH="/usr/lib/java/openjdk8/jre/bin/:${PATH}"
cmake -DRSTUDIO_TARGET=Desktop \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/lib/rstudio \
-DRSTUDIO_USE_SYSTEM_BOOST=yes \
-DBoost_NO_BOOST_CMAKE=ON \
-DRSTUDIO_BUNDLE_QT=FALSE \
-DQT_QMAKE_EXECUTABLE=/usr/lib/qt5/bin/qmake \
..
make DESTDIR=$PKG install
install -dm755 $PKG/usr/bin/
ln -s /usr/lib/$name/bin/$name $PKG/usr/bin/$nam
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
}