Skip to content

Commit

Permalink
rstudio: Repack rstudio 1.2.5019 to use Qt5 from /pkg
Browse files Browse the repository at this point in the history
The former rstudio build uses QT5/Qt-WebKit from the system,
but can not handle an updated Qt version.

A clean rebuild fails caused by too old dependencies, thus
the old build gets copied, and a suitable path to the Qt
libraries is patched into the executables.

The required older Qt5 package is build too.
thomas committed Feb 10, 2021
1 parent 01ad6a6 commit 268a3e2
Showing 2 changed files with 99 additions and 0 deletions.
61 changes: 61 additions & 0 deletions qt-5.12.7-0.build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#! /bin/bash

PKG=qt
VERSION=5.12.7
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:\$PATH
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

mkdir -p $BUILD
cd $BUILD
# orig: https://download.qt.io/archive/qt/5.12/5.12.7/single/qt-everywhere-src-5.12.7.tar.xz
BEEHIVE=https://beehive.molgen.mpg.de/ce2c5661c028b9de6183245982d7c120/qt-everywhere-src-5.12.7.tar.xz
test -e qt-everywhere-src-5.12.7.tar.xz || wget -nv $BEEHIVE
test -d qt-everywhere-src-5.12.7 || tar -xf qt-everywhere-src-5.12.7.tar.xz
cd qt-everywhere-src-5.12.7

# use bundled libevent
sed -e '/webengine-system-libevent/ s/=true\s*$/=false/' -i ./qtwebengine/src/core/config/linux.pri

./configure \
-opensource \
-confirm-license \
-prefix ${PREFIX} \
-R ${PREFIX}/lib \
-nomake examples \
-nomake tests \
-nomake tools \
-no-strip \
-no-pch \
-xcb \
-qpa xcb \
-opengl \
-verbose

make -j $NPROC
make install

exit
38 changes: 38 additions & 0 deletions rstudio-1.2.5019-1.build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#! /bin/bash

PKG=rstudio
VERSION=1.2.5019
BUILD=1

QTPKG=/pkg/qt-5.12.7-0

PREFIX=/pkg/$PKG-$VERSION-$BUILD
OLDPREFIX=/pkg/$PKG-$VERSION-0

if [ -n "$TESTING" ]; then PREFIX=/dev/shm/$PKG-$VERSION-$BUILD ; fi

set -xe
umask 022

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


# salvage the former build
cd $OLDPREFIX

cp -a R bin resources www www-symbolmaps $PREFIX
mkdir -p $PREFIX/doc
cp -a [A-Z]?* $PREFIX/doc

# fix rpath
cd $PREFIX/bin
for BINARY in diagnostics rpostback rsession rstudio; do
patchelf --set-rpath $QTPKG/lib $BINARY
done

exit

0 comments on commit 268a3e2

Please sign in to comment.