-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·154 lines (110 loc) · 2.86 KB
/
build.sh
File metadata and controls
executable file
·154 lines (110 loc) · 2.86 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/usr/bin/env bash
if [[ -z $JOBS ]]; then
JOBS=$((`getconf _NPROCESSORS_ONLN` + 1))
fi
MAKE="make --jobs=$JOBS"
QMAKE=`pwd`/build/qtbase/bin/qmake
# Clean object dir and return the input error
function err(){
rm -rf $OUT_DIR
rmdir -p --ignore-fail-on-non-empty `dirname $OUT_DIR`
exit $1
}
# ICU
ICU_URL=http://download.icu-project.org/files/icu4c/56.1/icu4c-56_1-src.tgz
SRC_DIR=`pwd`/deps/icu
OUT_DIR=`pwd`/build/icu
if [[ ! -d $SRC_DIR ]]; then
mkdir -p $SRC_DIR &&
curl -L $ICU_URL | tar xzf - -C $SRC_DIR --strip-components=1 || exit 1
fi
if [[ ! -d $OUT_DIR ]]; then
rm -rf `pwd`/build/qtbase
rm -rf ${OUT_DIR}_obj &&
mkdir -p ${OUT_DIR}_obj || exit 3
(
cd ${OUT_DIR}_obj || exit 4
SRC_DIR=$SRC_DIR/source
$SRC_DIR/configure \
--prefix=$OUT_DIR \
--enable-static \
--disable-tests \
--disable-samples || exit 5
# --disable-shared \
# $MAKE || exit 6
$MAKE &&
make install || exit 6
) || err $?
rm -rf ${OUT_DIR}_obj || exit 7
fi
ICU_LIB=$OUT_DIR/lib
ICU_INC=$OUT_DIR/include
export LD_LIBRARY_PATH=$ICU_LIB
# qtbase
SRC_DIR=`pwd`/deps/qtbase
OUT_DIR=`pwd`/build/qtbase
if [[ ! -d $SRC_DIR ]]; then
git clone git://code.qt.io/qt/qtbase.git $SRC_DIR || exit 10
fi
if [[ ! -d $OUT_DIR ]]; then
rm -rf `pwd`/build/qtwebkit
mkdir -p $OUT_DIR || exit 11
(
cd $OUT_DIR || exit 12
$SRC_DIR/configure \
-prefix $OUT_DIR \
-opensource \
-confirm-license \
-static \
-no-sql-sqlite \
-no-pkg-config \
-qt-zlib \
-qt-libpng \
-qt-libjpeg \
-qt-freetype \
-qt-pcre \
-nomake examples \
-nomake tests \
-nomake tools \
-no-qml-debug \
-silent \
-no-fontconfig \
-no-dbus \
-icu -continue \
-L $ICU_LIB \
-I $ICU_INC \
-qt-xcb \
-linuxfb || exit 13
# -no-xcb \
$MAKE || exit 14
) || err $?
fi
export SQLITE3SRCDIR=$SRC_DIR/src/3rdparty/sqlite
export CMAKE_LIBRARY_PATH=$ICU_LIB
export CMAKE_INCLUDE_PATH=$ICU_INC
# qtwebengine
SRC_DIR=`pwd`/deps/qtwebengine
OUT_DIR=`pwd`/build/qtwebengine
if [[ ! -d $SRC_DIR ]]; then
git clone git://code.qt.io/qt/qtwebengine.git $SRC_DIR || exit 20
fi
if [[ ! -d $OUT_DIR ]]; then
rm -rf `pwd`/build/nogui
mkdir -p $OUT_DIR || exit 21
(
cd $OUT_DIR || exit 22
$QMAKE -config release $SRC_DIR || exit 23
$MAKE || exit 24
) || err $?
fi
# noGUI
SRC_DIR=`pwd`
OUT_DIR=`pwd`/build/nogui
#if [[ ! -d $OUT_DIR ]]; then
mkdir -p $OUT_DIR || exit 30
(
cd $OUT_DIR || exit 31
$QMAKE -config release $SRC_DIR || exit 32
$MAKE || exit 33
) || err $?
#fi