-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·126 lines (113 loc) · 3.24 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/bash
set -o errexit -o nounset -o pipefail
command -v shellcheck > /dev/null && (shellcheck -x "$0" || shellcheck "$0")
QT_SOURCEDIR=$(realpath "$1")
source "./_includes.sh"
BUILDDIR="$WORKSPACE/tmp/qt-build-$USER"
OUTFILE="$OUTDIR/kullo_qt${QT_VERSION}_${OS_NAME}.tar.gz"
INSTALL_SRC="$INSTALL_ROOT/src"
if [ ! -w "$INSTALL_ROOT" ] ; then
echo "Can not write to directory '$INSTALL_ROOT'"
exit 1
fi
if ! mkdir -p "$(dirname "$OUTFILE")"; then
echo "Could not create parent directory for outfile '$OUTFILE'"
exit 1
fi
# Clear Qt installation dir
echo "Clearing Qt installation dir ..."
rm -rf "${INSTALL_ROOT:?}/"*
# Install Qt sources
if ! mkdir -p "$INSTALL_SRC"; then
echo "Could not create source directory '$INSTALL_SRC'"
exit 1
fi
echo "Copying Qt sources to '$INSTALL_SRC' ..."
time rsync --archive "$QT_SOURCEDIR/" "$INSTALL_SRC"
# Build Qt
#
# Modules to be skipped are top-level directories in the source tree:
# http://code.qt.io/cgit/qt/qt5.git/tree/
for MODE in debug release; do
PREFIX="$INSTALL_ROOT/$MODE"
mkdir -p "$PREFIX"
rm -rf "$BUILDDIR"
mkdir -p "$BUILDDIR"
(
cd "$BUILDDIR"
"$INSTALL_SRC/configure" \
-opensource \
-confirm-license \
-nomake examples \
-platform linux-clang-libc++ \
-prefix "$PREFIX" \
-c++std c++11 \
-no-icu \
-no-mtdev \
-no-openssl \
-no-sql-sqlite \
-no-sql-sqlite2 \
-no-gstreamer \
--zlib=qt \
--libpng=qt \
--libjpeg=qt \
-xcb \
-xcb-xinput \
-xkbcommon \
-gtk \
-pulseaudio \
-alsa \
-$MODE \
-cups \
-skip qt3d \
-skip qtactiveqt \
-skip qtandroidextras \
-skip qtcanvas3d \
-skip qtcharts \
-skip qtconnectivity \
-skip qtdatavis3d \
-skip qtdoc \
-skip qtgamepad \
-skip qtlocation \
-skip qtmacextras \
-skip qtnetworkauth \
-skip qtpurchasing \
-skip qtremoteobjects \
-skip qtscript \
-skip qtscxml \
-skip qtsensors \
-skip qtserialbus \
-skip qtserialport \
-skip qtspeech \
-skip qttranslations \
-skip qtvirtualkeyboard \
-skip qtwayland \
-skip qtwebchannel \
-skip qtwebengine \
-skip qtwebglplugin \
-skip qtwebsockets \
-skip qtwebview \
-skip qtwinextras \
-skip qtx11extras \
-skip qtxmlpatterns \
-shared
cp config.summary "$PREFIX"
# Build
time CCACHE_DISABLE=1 make -j "$CORES"
make install
)
done
# Export
(
cd "$INSTALL_PARENT"
echo "Exporting to $OUTFILE ..."
time tar -cv \
--use-compress-program="$GZIP_COMPRESSOR" \
-f "$OUTFILE" \
"$INSTALL_FOLDERNAME"
)
# Next step
echo "#####################"
echo "# Use this command to download from build machine:"
echo "# scp $USER@$PRIMARY_IP:$OUTFILE ."
echo "#####################"