From 0c03077177be61dedfa056d57143f7a8e91d7a3d Mon Sep 17 00:00:00 2001
From: Moritz Maxeiner <mm@ucw.sh>
Date: Tue, 13 Aug 2019 00:59:48 +0200
Subject: [PATCH] ubuntu18.04: Upgrade to Qt 5.12

---
 ubuntu18.04/base/Dockerfile     | 13 +++++----
 ubuntu18.04/base/qtifwsilent.qs | 51 +++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 5 deletions(-)
 create mode 100644 ubuntu18.04/base/qtifwsilent.qs

diff --git a/ubuntu18.04/base/Dockerfile b/ubuntu18.04/base/Dockerfile
index 93e5e58..bef2dd5 100644
--- a/ubuntu18.04/base/Dockerfile
+++ b/ubuntu18.04/base/Dockerfile
@@ -6,6 +6,7 @@ LABEL authors="Moritz Maxeiner <moritz.maxeiner@fu-berlin.de>"
 ENV TZ=Europe/Berlin
 ENV DEBIAN_FRONTEND=noninteractive
 
+COPY qtifwsilent.qs /tmp/qtifwsilent.qs
 RUN apt-get update && \
     apt-get install -y --no-install-recommends software-properties-common && \
     add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@@ -33,10 +34,6 @@ RUN apt-get update && \
         graphviz \
         fuse \
         ffmpeg \
-        qt5-default \
-        qtbase5-dev \
-        qtmultimedia5-dev \
-        libqt5charts5-dev \
         libboost-all-dev \
         libopenblas-dev \
         liblapack-dev \
@@ -47,7 +44,6 @@ RUN apt-get update && \
         libglm-dev \
         libegl1-mesa-dev \
         libcgal-dev \
-        libcgal-qt5-dev \
         libjsoncpp-dev \
         libwebsocketpp-dev \
         libfreetype6-dev \
@@ -58,8 +54,15 @@ RUN apt-get update && \
         python3-pip \
         python3-setuptools \
         python3-distutils && \
+    cd /tmp && \
+    curl -sSLO https://download.qt.io/official_releases/qt/5.12/5.12.4/qt-opensource-linux-x64-5.12.4.run && \
+    chmod +x qt-opensource-linux-x64-5.12.4.run && \
+    env QT_INSTALL_DIR=/opt/qt5 ./qt-opensource-linux-x64-5.12.4.run --script qtifwsilent.qs -platform minimal && \
+    rm qt-opensource-linux-x64-5.12.4.run && \
+    rm qtifwsilent.qs && \
     curl -sSL -o /usr/local/bin/linuxdeployqt https://github.com/probonopd/linuxdeployqt/releases/download/5/linuxdeployqt-5-x86_64.AppImage && \
     chmod +x /usr/local/bin/linuxdeployqt
+ENV Qt5_DIR /opt/qt5/5.12.4/gcc_64/lib/cmake/Qt5
 
 RUN python3.7 -m pip --no-cache-dir install \
         graphviz \
diff --git a/ubuntu18.04/base/qtifwsilent.qs b/ubuntu18.04/base/qtifwsilent.qs
new file mode 100644
index 0000000..429a792
--- /dev/null
+++ b/ubuntu18.04/base/qtifwsilent.qs
@@ -0,0 +1,51 @@
+function Controller() {
+    installer.autoRejectMessageBoxes();
+    installer.installationFinished.connect(function() {
+        gui.clickButton(buttons.NextButton);
+    })
+}
+
+Controller.prototype.WelcomePageCallback = function() {
+    gui.clickButton(buttons.NextButton, 7000);
+}
+
+Controller.prototype.CredentialsPageCallback = function() {
+    gui.clickButton(buttons.NextButton);
+}
+
+Controller.prototype.IntroductionPageCallback = function() {
+    gui.clickButton(buttons.NextButton);
+}
+
+Controller.prototype.TargetDirectoryPageCallback = function() {
+    gui.currentPageWidget().TargetDirectoryLineEdit.setText(installer.environmentVariable("QT_INSTALL_DIR"));
+    gui.clickButton(buttons.NextButton);
+}
+
+Controller.prototype.ComponentSelectionPageCallback = function() {
+    var widget = gui.currentPageWidget();
+    widget.deselectAll();
+    widget.selectComponent("qt.qt5.5124.gcc_64");
+    widget.selectComponent("qt.qt5.5124.qtcharts");
+    gui.clickButton(buttons.NextButton);
+}
+
+Controller.prototype.LicenseAgreementPageCallback = function() {
+    gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
+    gui.clickButton(buttons.NextButton);
+}
+
+Controller.prototype.StartMenuDirectoryPageCallback = function() {
+    gui.clickButton(buttons.NextButton);
+}
+
+Controller.prototype.ReadyForInstallationPageCallback = function() {
+    gui.clickButton(buttons.NextButton);
+}
+
+Controller.prototype.FinishedPageCallback = function() {
+    var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm;
+    if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox)
+        checkBoxForm.launchQtCreatorCheckBox.checked = false;
+    gui.clickButton(buttons.FinishButton);
+}
-- 
GitLab