Last active
August 27, 2022 15:44
-
-
Save satmandu/a450a6a97259f8fd5597ccdf351023ea to your computer and use it in GitHub Desktop.
COMPLETELY UNSUPPORTED way to build rstudio from the v1.3-patches branch with QT 5.15 for ubuntu/20.04 focal & R 4.0. Put both files in the same directory. Note a docker install is needed for this to work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
git_branch="v1.3-patch" | |
git_base="https://github.com/rstudio/rstudio" | |
QT_VERSION=5.15.0 | |
now=$(date +"%m%d%Y%H%M") | |
#docker build --pull --no-cache -f Dockerfile.focal-amd64 -t rstudio:focal-amd64 . | |
# following from https://stackoverflow.com/a/246128 | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | |
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | |
done | |
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" | |
if [[ -e "rstudio" ]]; then | |
cd rstudio | |
git pull | |
git reset --hard | |
patch -p1 --forward --force <"$DIR"/rstudio-1.3.patch || true | |
echo "updated git" | |
else | |
git clone -b $git_branch --depth=1 $git_base | |
cd rstudio | |
patch -p1 --forward --force <"$DIR"/rstudio-1.3.patch || true | |
echo "recreated git" | |
fi | |
#QT_VERSION=$(grep -oP '(?<=QT_VERSION=)(\s+)?\K([^ ]*)' rstudio/docker/jenkins/Dockerfile.focal-amd64) | |
sed -i "s/\bQT_VERSION=[^ ]*/QT_VERSION=$QT_VERSION/" "$DIR"/rstudio/docker/jenkins/Dockerfile.focal-amd64 | |
sed -i "s/QT_CANDIDATES 5/QT_CANDIDATES $QT_VERSION 5/g" "$DIR"/rstudio/src/cpp/desktop/CMakeLists.txt | |
cd "$DIR"/rstudio/docker | |
./docker-compile.sh focal-amd64 desktop 1.3."$now" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff '--exclude=.git' -Npaur a/dependencies/common/install-common b/dependencies/common/install-common | |
--- a/dependencies/common/install-common 2020-05-11 22:11:46.193261644 -0400 | |
+++ b/dependencies/common/install-common 2020-05-11 22:13:49.039501487 -0400 | |
@@ -19,7 +19,7 @@ set -e | |
./install-dictionaries | |
./install-mathjax | |
-./install-boost | |
+#./install-boost | |
./install-pandoc | |
./install-packages | |
./install-sentry-cli | |
diff '--exclude=.git' -Npaur a/dependencies/common/install-qt.sh b/dependencies/common/install-qt.sh | |
--- a/dependencies/common/install-qt.sh 2020-05-11 22:11:46.194261629 -0400 | |
+++ b/dependencies/common/install-qt.sh 2020-05-11 22:13:49.039501487 -0400 | |
@@ -208,7 +208,7 @@ function compute_url(){ | |
if [[ "${COMPONENT}" =~ "qtcreator" ]]; then | |
REMOTE_BASE="tools_qtcreator/qt.tools.qtcreator" | |
- REMOTE_PATH="$(${CURL} ${BASE_URL}/${REMOTE_BASE}/ | grep -o -E "${VERSION}[0-9\-]*${COMPONENT}\.7z" | tail -1)" | |
+ REMOTE_PATH="$(${CURL} ${BASE_URL}/${REMOTE_BASE}/ | grep -o -E "${VERSION}[0-9\-]*${COMPONENT}\.7z" | head -1)" | |
if [ ! -z "${REMOTE_PATH}" ]; then | |
echo "${BASE_URL}/${REMOTE_BASE}/${REMOTE_PATH}" | |
@@ -232,9 +232,9 @@ function compute_url(){ | |
if [[ "${HOST_OS}" == "linux_x64" && "${VERSION}" == "5.12.8" ]]; then | |
# Qt 5.12.8 Linux release has multiple files in release folders; install the correct one! | |
# https://github.com/rstudio/rstudio/issues/6782 | |
- REMOTE_PATH="$(${CURL} ${BASE_URL}/${REMOTE_BASE}/ | grep -o -E "5\.12\.8\-0\-20200405[[:alnum:]_.\-]*7z" | grep "${COMPONENT}" | tail -1)" | |
+ REMOTE_PATH="$(${CURL} ${BASE_URL}/${REMOTE_BASE}/ | grep -o -E "5\.12\.8\-0\-20200405[[:alnum:]_.\-]*7z" | grep "${COMPONENT}" | head -1)" | |
else | |
- REMOTE_PATH="$(${CURL} ${BASE_URL}/${REMOTE_BASE}/ | grep -o -E "[[:alnum:]_.\-]*7z" | grep "${COMPONENT}" | tail -1)" | |
+ REMOTE_PATH="$(${CURL} ${BASE_URL}/${REMOTE_BASE}/ | grep -o -E "[[:alnum:]_.\-]*7z" | grep "${COMPONENT}" | head -1)" | |
fi | |
if [ ! -z "${REMOTE_PATH}" ]; then | |
echo "${BASE_URL}/${REMOTE_BASE}/${REMOTE_PATH}" | |
diff '--exclude=.git' -Npaur a/docker/jenkins/Dockerfile.focal-amd64 b/docker/jenkins/Dockerfile.focal-amd64 | |
--- a/docker/jenkins/Dockerfile.focal-amd64 1969-12-31 19:00:00.000000000 -0500 | |
+++ b/docker/jenkins/Dockerfile.focal-amd64 2020-05-11 22:13:49.040501473 -0400 | |
@@ -0,0 +1,114 @@ | |
+FROM ubuntu:focal | |
+ | |
+ARG AWS_REGION=us-east-1 | |
+ | |
+# install needed packages. replace httpredir apt source with cloudfront | |
+RUN set -x \ | |
+ && sed -i "s/archive.ubuntu.com/$AWS_REGION.ec2.archive.ubuntu.com/" /etc/apt/sources.list \ | |
+ && export DEBIAN_FRONTEND=noninteractive \ | |
+ && apt-get update \ | |
+ && apt-get install -y gnupg \ | |
+ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0x51716619e084dab9 \ | |
+ && echo 'deb http://cran.rstudio.com/bin/linux/ubuntu focal-cran40/' >> /etc/apt/sources.list \ | |
+ && apt-get update | |
+ | |
+# add ppa repository so we can install java 8 (not in any official repo for bionic) | |
+RUN apt-get update \ | |
+ && apt-get install -y software-properties-common \ | |
+ && add-apt-repository ppa:openjdk-r/ppa | |
+ | |
+RUN apt-get update && \ | |
+ export DEBIAN_FRONTEND=noninteractive && \ | |
+ apt-get install -y \ | |
+ ant \ | |
+ autoconf \ | |
+ build-essential \ | |
+ clang \ | |
+ cmake \ | |
+ curl \ | |
+ debsigs \ | |
+ dpkg-sig \ | |
+ expect \ | |
+ fakeroot \ | |
+ git-core \ | |
+ libattr1-dev \ | |
+ libacl1-dev \ | |
+ libboost-all-dev \ | |
+ libbz2-dev \ | |
+ libcap-dev \ | |
+ libcurl4-openssl-dev \ | |
+ libfuse2 \ | |
+ libgpg-error0 \ | |
+ libgtk-3-0 \ | |
+ libgl1-mesa-dev \ | |
+ libegl1-mesa \ | |
+ libpam-dev \ | |
+ libpango1.0-dev \ | |
+ libuser1-dev \ | |
+ libssl1.1 libssl-dev \ | |
+ libxslt1-dev \ | |
+ lsof \ | |
+ openjdk-11-jdk \ | |
+ patchelf \ | |
+ p7zip-full \ | |
+ pkg-config \ | |
+ python \ | |
+ r-base \ | |
+ sudo \ | |
+ unzip \ | |
+ uuid-dev \ | |
+ valgrind \ | |
+ wget \ | |
+ yarnpkg \ | |
+ zlib1g-dev | |
+ | |
+# ensure we use the java 11 compiler | |
+#RUN update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/jre/bin/java | |
+ | |
+## build patchelf | |
+#RUN cd /tmp \ | |
+# && wget https://github.com/NixOS/patchelf/archive/0.10.tar.gz \ | |
+# && mv 0.10.tar.gz patchelf-0.10.tar.gz \ | |
+# && tar xzvf patchelf-0.10.tar.gz \ | |
+# && cd patchelf-0.10 \ | |
+# && ./bootstrap.sh \ | |
+# && ./configure \ | |
+# && make \ | |
+# && make install | |
+ | |
+## run install-boost twice - boost exits 1 even though it has installed good enough for our uses. | |
+## https://github.com/rstudio/rstudio/blob/master/vagrant/provision-primary-user.sh#L12-L15 | |
+#COPY dependencies/common/install-boost /tmp/ | |
+#RUN bash /tmp/install-boost || bash /tmp/install-boost | |
+RUN mkdir /opt/rstudio-tools | |
+ | |
+# set github login from build argument if defined | |
+ARG GITHUB_LOGIN | |
+ENV RSTUDIO_GITHUB_LOGIN=$GITHUB_LOGIN | |
+ | |
+# install cmake | |
+COPY package/linux/install-dependencies /tmp/ | |
+RUN /bin/bash /tmp/install-dependencies | |
+ | |
+# install crashpad and its dependencies | |
+COPY dependencies/common/install-crashpad /tmp/ | |
+RUN bash /tmp/install-crashpad bionic | |
+ | |
+# install common dependencies | |
+RUN mkdir -p /opt/rstudio-tools/dependencies/common | |
+COPY dependencies/common/ /opt/rstudio-tools/dependencies/common/ | |
+RUN cd /opt/rstudio-tools/dependencies/common && /bin/bash ./install-common | |
+ | |
+# install Qt SDK | |
+COPY dependencies/common/install-qt.sh /tmp/ | |
+COPY dependencies/linux/install-qt-linux /tmp/ | |
+RUN export QT_VERSION=5.14.2 && \ | |
+ cd /tmp && /bin/bash ./install-qt-linux | |
+ | |
+# create jenkins user, make sudo. try to keep this toward the bottom for less cache busting | |
+ARG JENKINS_GID=999 | |
+ARG JENKINS_UID=999 | |
+RUN groupadd -g $JENKINS_GID jenkins && \ | |
+ useradd -m -d /var/lib/jenkins -u $JENKINS_UID -g jenkins jenkins && \ | |
+ echo "jenkins ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | |
+ | |
diff '--exclude=.git' -Npaur a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt | |
--- a/src/cpp/CMakeLists.txt 2020-05-11 22:11:46.238260988 -0400 | |
+++ b/src/cpp/CMakeLists.txt 2020-05-11 22:13:49.040501473 -0400 | |
@@ -272,7 +272,7 @@ endif() | |
# allow opt-in to using Boost.Signals2 | |
# TODO: remove this in RStudio v1.3 and port to signals2 | |
if(NOT RSTUDIO_BOOST_SIGNALS_VERSION) | |
- if (Boost_VERSION LESS 106900) | |
+ if (BOOST_VERSION LESS 106900) | |
set(RSTUDIO_BOOST_SIGNALS_VERSION 1) | |
else() | |
set(RSTUDIO_BOOST_SIGNALS_VERSION 2) | |
diff '--exclude=.git' -Npaur a/src/cpp/desktop/install/LinuxInstallQt.sh.in b/src/cpp/desktop/install/LinuxInstallQt.sh.in | |
--- a/src/cpp/desktop/install/LinuxInstallQt.sh.in 2020-05-11 22:11:46.290260231 -0400 | |
+++ b/src/cpp/desktop/install/LinuxInstallQt.sh.in 2020-05-11 22:14:37.932815314 -0400 | |
@@ -17,13 +17,13 @@ COMPONENTS=( | |
lib/libQt5Positioning.so.5 | |
lib/libQt5PrintSupport.so.5 | |
lib/libQt5Qml.so.5 | |
+ lib/libQt5QmlModels.so.5 | |
lib/libQt5Quick.so.5 | |
lib/libQt5QuickWidgets.so.5 | |
lib/libQt5Sensors.so.5 | |
lib/libQt5Sql.so.5 | |
lib/libQt5Svg.so.5 | |
lib/libQt5WaylandClient.so.5 | |
- lib/libQt5WaylandCompositor.so.5 | |
lib/libQt5WebChannel.so.5 | |
lib/libQt5WebEngine.so.5 | |
lib/libQt5WebEngineCore.so.5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment