chiark / gitweb /
common: use python instead of calling out to 'rm'
[fdroidserver.git] / buildserver / provision-qt-sdk
1 #!/bin/bash
2
3 set -e
4
5 QT_DIR=$1
6
7 test -e $QT_DIR || mkdir -p $QT_DIR
8
9 cat << EOF > $QT_DIR/5.7.0-installer.qs
10 // Bases on script from http://stackoverflow.com/a/34032216
11
12 function Controller() {
13     installer.autoRejectMessageBoxes();
14     installer.installationFinished.connect(function() {
15         gui.clickButton(buttons.NextButton);
16     })
17 }
18
19 Controller.prototype.WelcomePageCallback = function() {
20     gui.clickButton(buttons.NextButton);
21 }
22
23 Controller.prototype.CredentialsPageCallback = function() {
24     gui.clickButton(buttons.NextButton);
25 }
26
27 Controller.prototype.IntroductionPageCallback = function() {
28     gui.clickButton(buttons.NextButton);
29 }
30
31 Controller.prototype.TargetDirectoryPageCallback = function()
32 {
33     gui.currentPageWidget().TargetDirectoryLineEdit.setText("$QT_DIR/5.7.0");
34     gui.clickButton(buttons.NextButton);
35 }
36
37 Controller.prototype.ComponentSelectionPageCallback = function() {
38     var widget = gui.currentPageWidget();
39
40     // You can get these component names by running the installer with the
41     // --verbose flag. It will then print out a resource tree.
42
43     widget.deselectAll();
44     widget.selectComponent("qt.55.gcc_64");
45     widget.selectComponent("qt.57.qtwebengine.gcc_64");
46     widget.selectComponent("qt.57.android_x86");
47     widget.selectComponent("qt.57.android_armv7");
48
49     // widget.deselectComponent("...");
50
51     gui.clickButton(buttons.NextButton);
52 }
53
54 Controller.prototype.LicenseAgreementPageCallback = function() {
55     gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
56     gui.clickButton(buttons.NextButton);
57 }
58
59 Controller.prototype.StartMenuDirectoryPageCallback = function() {
60     gui.clickButton(buttons.NextButton);
61 }
62
63 Controller.prototype.ReadyForInstallationPageCallback = function()
64 {
65     gui.clickButton(buttons.NextButton);
66 }
67
68 Controller.prototype.FinishedPageCallback = function() {
69 var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm
70 if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) {
71     checkBoxForm.launchQtCreatorCheckBox.checked = false;
72 }
73     gui.clickButton(buttons.FinishButton);
74 }
75 EOF
76
77 if [ ! -e $QT_DIR/5.7.0 ]; then
78     echo "Installing Qt SDK 5.7.0 to $QT_DIR/5.7.0 ..."
79     /vagrant/cache/qt-opensource-linux-x64-android-5.7.0.run --platform minimal --script $QT_DIR/5.7.0-installer.qs --verbose
80     echo "Qt SDK 5.7.0 installation done."
81 fi
82
83 rm $QT_DIR/5.7.0-installer.qs