Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 145 lines (113 sloc) 4.21 KB
#! /bin/bash
PKG=rstudio
VERSION=1.4.1103
BUILD=0
QTPKG=/pkg/qt-5.12.7-0
BOOSTPKG=/pkg/boost-1.73.0-0
PREFIX=/pkg/$PKG-$VERSION-$BUILD
if [ -n "$TESTING" ]; then PREFIX=/dev/shm/$PKG-$VERSION-$BUILD ; fi
set -xe
umask 022
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp
test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; rm -rf $BUILD_TMPDIR )
mkdir -p $BUILD_TMPDIR/home
export TMPDIR=$BUILD_TMPDIR
export HOME=$BUILD_TMPDIR/home
mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH:/usr/local/package/bin
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH ; fi
EOF
. $PREFIX/profile
NPROC=$(( $(nproc) * 4 / 5 + 1 ))
BUILD=$PREFIX/build
DEP_COMMON=$BUILD/rstudio-$VERSION/dependencies/common
mkdir -p $BUILD
cd $BUILD
(
# orig: http://downloads.sourceforge.net/project/soci/soci/soci-4.0.1/soci-4.0.1.zip
BEEHIVE=https://beehive.molgen.mpg.de/10fd0309bdb2b0d9a2920f043a9acbfd/soci-4.0.1.zip
test -e soci-4.0.1.zip || wget -nv $BEEHIVE
test -d soci-4.0.1 || unzip -q soci-4.0.1.zip
cd soci-4.0.1
mkdir -p build
cd build
cmake \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DSOCI_LIBDIR=lib \
-DSOCI_CXX11=ON \
..
make -j $NPROC
make install
mv $PREFIX/cmake $PREFIX/lib
)
# orig: https://github.com/rstudio/rstudio/archive/v$VERSION.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/ad7cad843fa983f9ef6e9a9fdf03160f/rstudio-1.4.1103.tar.gz
test -e rstudio-$VERSION.tar.gz || wget -nv $BEEHIVE
test -d rstudio-$VERSION || tar -xf rstudio-$VERSION.tar.gz
cd rstudio-$VERSION
CWD=$(pwd)
# Do not trust dependencies/common/install-common, and handle required dependencies manually
# DEPS: dictionaries mathjax node pandoc, rstudio provides them via s3.amazonaws.com/rstudio-buildtools
cd $DEP_COMMON
test -e core-dictionaries.zip || wget -nv \
https://beehive.molgen.mpg.de/0e03798b8e53096c4a906bde05e32378/core-dictionaries.zip
mkdir -p dictionaries || unzip -qo core-dictionaries.zip -d dictionaries
test -e mathjax-27.zip || wget -nv \
https://beehive.molgen.mpg.de/87ebdade5a14e27061c61962e46180b7/mathjax-27.zip
unzip -qo mathjax-27.zip
# well, this is not the newest one ...
test -e node-v10.19.0-linux-x64.tar.gz || wget -nv \
https://beehive.molgen.mpg.de/441a8e19ab9cd9884cbd24f85840c7a6/node-v10.19.0-linux-x64.tar.gz
mkdir -p node/10.19.0
tar -xf node-v10.19.0-linux-x64.tar.gz -C node/10.19.0 --strip-components=1
mkdir -p pandoc
test -e pandoc-2.11.2-linux-amd64.tar.gz || wget -nv \
https://beehive.molgen.mpg.de/6cf042236ed5e5cf177ee6ae2e236a06/pandoc-2.11.2-linux-amd64.tar.gz
tar -xf pandoc-2.11.2-linux-amd64.tar.gz
test -d pandoc && rm -r pandoc
mv pandoc-2.11.2 pandoc
ln -s bin/pandoc pandoc/pandoc
touch pandoc/2.11.2 # needed to fool the cmake test later on ...
# DEPS: gwt gin
test -e gwt-2.8.2.zip || wget -nv \
https://beehive.molgen.mpg.de/c295406d68c5ef364e445068599aa6d4/gwt-2.8.2.zip
test -e gin-2.1.2.zip || wget -nv \
https://beehive.molgen.mpg.de/e2617189fe5c138945b8cc95f26bd476/gin-2.1.2.zip
cd $CWD
cd src/gwt
mkdir -p lib/gin/2.1.2 lib/gwt/2.8.2
unzip -qo $DEP_COMMON/gin-2.1.2.zip -d lib/gin/2.1.2
unzip -qo $DEP_COMMON/gwt-2.8.2.zip -d lib/gwt/2.8.2
cd lib/gwt/2.8.2
mv -v gwt-2.8.2/* . ; rmdir gwt-2.8.2
cd $CWD
# DEPS: done
mkdir build
cd build
IFS=. read -ra VER<<<$VERSION
export RSTUDIO_VERSION_MAJOR=${VER[0]}
export RSTUDIO_VERSION_MINOR=${VER[1]}
export RSTUDIO_VERSION_PATCH=${VER[2]}
export PACKAGE_OS='GenuineMariux'
cmake \
-DRSTUDIO_TARGET=Desktop \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_INSTALL_RPATH=$PREFIX/lib\;$BOOSTPKG/lib\;$QTPKG/lib \
-DQT_QMAKE_EXECUTABLE=$QTPKG/bin/qmake \
-DRSTUDIO_USE_SYSTEM_BOOST=true \
-DRSTUDIO_BOOST_SIGNALS_VERSION=2 \
-DBoost_INCLUDE_DIR=$BOOSTPKG/include \
-DCMAKE_PREFIX_PATH=$BOOSTPKG/lib/cmake \
-DCMAKE_CXX_FLAGS="-I $PREFIX/include" \
-DSOCI_CORE_LIB=$PREFIX/lib/libsoci_core.so.4.0 \
-DSOCI_POSTGRESQL_LIB=$PREFIX/lib/libsoci_postgresql.so.4.0 \
-DSOCI_SQLITE_LIB=$PREFIX/lib/libsoci_sqlite3.so.4.0 \
-DRSTUDIO_GIT_REVISION_HASH=MoronDoNotUseGit \
..
make -j $NPROC
make install
# alike to version 1.2
cp -a $DEP_COMMON/pandoc $PREFIX/bin
exit