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 69 lines (51 sloc) 1.66 KB
#! /bin/bash
PKG=rstudio
VERSION=1.2.5019
BUILD=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
exec </dev/null
mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:/usr/local/package/bin:\$PATH
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} ; fi
EOF
. $PREFIX/profile
export MAKEFLAGS="-j $(nproc)"
BUILD=$PREFIX/build
mkdir -p $BUILD
cd $BUILD
mkdir -p disable-sudo
echo 'exec "$@"' >disable-sudo/sudo
chmod +x disable-sudo/sudo
PATH=$BUILD/disable-sudo:$PATH
QTPREFIX=/usr/local/qt5
test -e v$VERSION.tar.gz || wget https://github.com/rstudio/rstudio/archive/v$VERSION.tar.gz
test -d rstudio-$VERSION || tar xf v$VERSION.tar.gz
cd rstudio-$VERSION
# fix BOOST_DIR for pkg install
perl -pi -e "s(/opt/rstudio-tools)($PREFIX/rstudio-tools)g" dependencies/common/install-boost src/cpp/CMakeLists.txt
( cd dependencies/common; ./install-common )
IFS=. read -ra VER<<<$VERSION
export RSTUDIO_VERSION_MAJOR=${VER[0]}
export RSTUDIO_VERSION_MINOR=${VER[1]}
export RSTUDIO_VERSION_PATCH=${VER[2]}
mkdir cmake_build
cd cmake_build
cmake .. \
-DRSTUDIO_TARGET=Desktop \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DQT_QMAKE_EXECUTABLE=${QTPREFIX}/bin/qmake \
-DCMAKE_INSTALL_RPATH=$PREFIX/lib\;$QTPREFIX/lib \
-DRSTUDIO_GIT_REVISION_HASH=ARSCH
make -j $(nproc)
make install
exit