forked from d1vanov/quentier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
372 lines (359 loc) · 17.1 KB
/
.travis.yml
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
language: cpp
sudo: required
dist: xenial
services:
- xvfb
branches:
only:
- master
- development
matrix:
include:
- os: linux
env: QT_BASE=48 COMPILER=g++-5.4 CMAKE_BUILD_TYPE=Debug
- os: linux
env: QT_BASE=48 COMPILER=clang++ CMAKE_BUILD_TYPE=Debug
- os: linux
env: QT_BASE=551 COMPILER=g++-5.4 CMAKE_BUILD_TYPE=Debug
- os: linux
env: QT_BASE=551 COMPILER=clang++ CMAKE_BUILD_TYPE=Debug
- os: linux
env: QT_BASE=5123 COMPILER=g++-5.4 CMAKE_BUILD_TYPE=RelWithDebInfo
- os: linux
env: QT_BASE=5123 COMPILER=clang++ CMAKE_BUILD_TYPE=Debug
- os: osx
env: CMAKE_BUILD_TYPE=RelWithDebInfo
compiler: clang
before_install:
- |
export CHANGED_FILES=($(git diff --name-only ${TRAVIS_COMMIT_RANGE})) &&
echo "Changed files: ${CHANGED_FILES}" &&
export DETECTED_CHANGES_AFFECTING_BUILD=False &&
for CHANGED_FILE in ${CHANGED_FILES}; do
echo "Checking file ${CHANGED_FILE}" &&
if ! [[ ${CHANGED_FILE} =~ "*.md" ]] && [[ "${CHANGED_FILE}" != "COPYING" ]]; then
echo "Detected changes affecting build: file ${CHANGED_FILE}" &&
DETECTED_CHANGES_AFFECTING_BUILD=True &&
break
fi
done
- |
if [[ ${DETECTED_CHANGES_AFFECTING_BUILD} == False ]]; then
echo "No changes affecting build detected, exiting" &&
travis_terminate 0 &&
exit 1
fi
install:
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
export DISPLAY=:99.0 &&
wget http://www.cmake.org/files/v3.2/cmake-3.2.0-Linux-x86_64.tar.gz &&
tar -xzf cmake-3.2.0-Linux-x86_64.tar.gz &&
sudo cp -fR cmake-3.2.0-Linux-x86_64/* /usr &&
sudo apt-get -qq install libxml2-dev libboost-dev libboost-program-options-dev libssl-dev libhunspell-dev &&
sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test &&
if [ "${QT_BASE}" = "5123" ] && [ "${COMPILER}" = "g++-5.4" ]; then
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/5/linuxdeployqt-5-x86_64.AppImage" &&
sudo mv linuxdeployqt-5-x86_64.AppImage /usr/local/bin/linuxdeployqt
sudo chmod a+x /usr/local/bin/linuxdeployqt &&
wget https://nixos.org/releases/patchelf/patchelf-0.9/patchelf-0.9.tar.bz2 &&
tar xf patchelf-0.9.tar.bz2 &&
cd patchelf-0.9 &&
./configure &&
make &&
sudo make install &&
cd .. &&
sudo wget -c "https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" -O /usr/local/bin/appimagetool &&
sudo chmod a+x /usr/local/bin/appimagetool
fi
if [ "${QT_BASE}" = "551" ]; then
echo "Building for Qt 5.5.1" &&
sudo apt-get -qq install qtbase5-dev qttools5-dev qttools5-dev-tools libqt5webkit5-dev libqt5sql5-sqlite &&
if [ "${COMPILER}" = "clang++" ]; then
export CXX="clang++" &&
export CC="clang"
fi
elif [ "${QT_BASE}" = "5123" ]; then
echo "Building for Qt 5.12.3" &&
sudo apt-add-repository -y ppa:beineri/opt-qt-5.12.3-xenial &&
travis_wait 30 sudo apt-get -qq update &&
sudo apt-get -qq install qt512tools qt512base qt512webchannel qt512webengine qt512websockets qt512xmlpatterns qt512translations mesa-common-dev libgl1-mesa-dev &&
if [ "${COMPILER}" = "clang++" ]; then
export CXX="clang++" &&
export CC="clang"
fi
else
echo "Building for Qt 4.8" &&
travis_wait 30 sudo apt-get -qq update &&
sudo apt-get -qq install libqt4-dev libqt4-dev-bin libqt4-network libqt4-xml libqt4-xmlpatterns libqt4-sql libqt4-sql-sqlite libqt4-test libqt4-dbus libqtwebkit-dev &&
if [ "${COMPILER}" = "clang++" ]; then
export CXX="clang++" &&
export CC="clang"
fi
fi
else
brew update &&
brew unlink cmake &&
brew install cmake &&
brew link cmake &&
brew install qt5 &&
chmod -R 755 /usr/local/opt/qt5/* &&
brew install hunspell &&
brew install tidy-html5 &&
brew install p7zip
fi
- export QUENTIER_DIR=$(pwd) &&
echo "QUENTIER_DIR = $QUENTIER_DIR"
- cmake --version
- cd ..
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
echo "Building breakpad" &&
mkdir breakpad &&
git clone https://chromium.googlesource.com/breakpad/breakpad &&
cd breakpad &&
git checkout chrome_64 &&
git clone https://chromium.googlesource.com/linux-syscall-support src/third_party/lss &&
./configure --prefix=$(pwd)/installdir &&
make &&
make install &&
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/installdir/lib &&
cd ..
fi
- |
echo "Building qtkeychain" &&
mkdir qtkeychain &&
git clone https://github.com/frankosterfeld/qtkeychain.git qtkeychain &&
cd qtkeychain &&
git checkout v0.8.0 &&
mkdir build &&
cd build &&
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
if [ "${QT_BASE}" = "5123" ];then
source /opt/qt512/bin/qt512-env.sh &&
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir -DCMAKE_PREFIX_PATH=/opt/qt512 ..
elif [ "${QT_BASE}" = "551" ]; then
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir ..
else
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir -DBUILD_WITH_QT4=1 ..
fi
else
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 ..
fi
make &&
sudo make install &&
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/installdir/lib/x86_64-linux-gnu &&
cd ../..
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
echo "Building tidy-html5" &&
mkdir tidy-html5 &&
git clone https://github.com/htacg/tidy-html5.git tidy-html5 &&
cd tidy-html5 &&
git checkout 5.6.0 &&
mkdir build-tidy &&
cd build-tidy &&
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir .. &&
make &&
make install &&
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/installdir/lib &&
cd ../..
fi
- if [ "${QT_BASE}" = "48" ]; then
echo "Building qt4-mimetypes" &&
mkdir qt4-mimetypes &&
git clone https://github.com/d1vanov/qt4-mimetypes.git qt4-mimetypes &&
cd qt4-mimetypes &&
mkdir build &&
cd build &&
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir .. &&
make &&
make install &&
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/installdir/lib &&
cd ../..
;
fi
- |
echo "Building QEverCloud" &&
mkdir QEverCloud &&
git clone https://github.com/d1vanov/QEverCloud.git QEverCloud &&
cd QEverCloud &&
if [ "${TRAVIS_BRANCH}" = "development" ]; then
git checkout development
fi
mkdir build &&
cd build &&
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
if [ "${QT_BASE}" = "5123" ]; then
source /opt/qt512/bin/qt512-env.sh &&
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/qt512/lib &&
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir -DCMAKE_PREFIX_PATH=/opt/qt512 -DUSE_QT5=1 ..
elif [ "${QT_BASE}" = "551" ]; then
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir -DUSE_QT5=1 -DUSE_QT5_WEBKIT=1 ..
else
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir ..
fi
else
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 -DUSE_QT5=1 ..
fi
make &&
make check &&
make install &&
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/installdir/lib &&
cd ../..
- |
echo "Building libquentier" &&
mkdir libquentier &&
git clone https://github.com/d1vanov/libquentier.git libquentier &&
cd libquentier &&
if [ "${TRAVIS_BRANCH}" = "development" ]; then
git checkout development
fi
mkdir build &&
cd build &&
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
if [ "${QT_BASE}" = "5123" ]; then
source /opt/qt512/bin/qt512-env.sh &&
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/qt512/lib &&
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir \
-DQt5Keychain_DIR=$(pwd)/../../qtkeychain/build/installdir/lib/x86_64-linux-gnu/cmake/Qt5Keychain \
-DQEverCloud-qt5_DIR=$(pwd)/../../QEverCloud/build/installdir/lib/cmake/QEverCloud-qt5 \
-DTIDY_HTML5_INCLUDE_PATH=$(pwd)/../../tidy-html5/build-tidy/installdir/include \
-DTIDY_HTML5_LIB=$(pwd)/../../tidy-html5/build-tidy/installdir/lib/libtidy.so \
-DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PREFIX_PATH=/opt/qt512 -DUSE_QT5=1 ..
elif [ "${QT_BASE}" = "551" ]; then
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir \
-DQt5Keychain_DIR=$(pwd)/../../qtkeychain/build/installdir/lib/x86_64-linux-gnu/cmake/Qt5Keychain \
-DQEverCloud-qt5_DIR=$(pwd)/../../QEverCloud/build/installdir/lib/cmake/QEverCloud-qt5 \
-DTIDY_HTML5_INCLUDE_PATH=$(pwd)/../../tidy-html5/build-tidy/installdir/include \
-DTIDY_HTML5_LIB=$(pwd)/../../tidy-html5/build-tidy/installdir/lib/libtidy.so \
-DCMAKE_VERBOSE_MAKEFILE=ON -DUSE_QT5=1 -DUSE_QT5_WEBKIT=1 ..
else
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir \
-DQtKeychain_DIR=$(pwd)/../../qtkeychain/build/installdir/lib/x86_64-linux-gnu/cmake/QtKeychain \
-DQEverCloud-qt4_DIR=$(pwd)/../../QEverCloud/build/installdir/lib/cmake/QEverCloud-qt4 \
-DTIDY_HTML5_INCLUDE_PATH=$(pwd)/../../tidy-html5/build-tidy/installdir/include \
-DTIDY_HTML5_LIB=$(pwd)/../../tidy-html5/build-tidy/installdir/lib/libtidy.so \
-Dqt4-mimetypes_DIR=$(pwd)/../../qt4-mimetypes/build/installdir/lib/cmake/qt4-mimetypes \
-DCMAKE_VERBOSE_MAKEFILE=ON ..
fi
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/installdir/lib &&
echo "LD_LIBRARY_PATH = $LD_LIBRARY_PATH"
else
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir \
-DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 \
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \
-DQt5Keychain_DIR=$(pwd)/../../qtkeychain/build/installdir/lib/cmake/Qt5Keychain \
-DQEverCloud-qt5_DIR=$(pwd)/../../QEverCloud/build/installdir/lib/cmake/QEverCloud-qt5 \
-DTIDY_HTML5_INCLUDE_PATH=/usr/local/include \
-DTIDY_HTML5_LIB=/usr/local/lib/libtidy.dylib \
-DCMAKE_VERBOSE_MAKEFILE=ON -DUSE_QT5=1 ..
fi
make &&
make check &&
make lupdate &&
make lrelease &&
make install
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/installdir/lib
fi
script:
- |
echo "Building quentier" &&
cd $QUENTIER_DIR &&
mkdir build &&
cd build &&
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
if [ "${QT_BASE}" = "5123" ]; then
if [ "${COMPILER}" = "g++-5.4" ]; then
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_TRANSLATIONSDIR=$(pwd)/appdir/usr \
-DLibquentier-qt5_DIR=$(pwd)/../../libquentier/build/installdir/lib/cmake/Libquentier-qt5 \
-DQt5Keychain_DIR=$(pwd)/../../qtkeychain/build/installdir/lib/x86_64-linux-gnu/cmake/Qt5Keychain \
-DQEverCloud-qt5_DIR=$(pwd)/../../QEverCloud/build/installdir/lib/cmake/QEverCloud-qt5 \
-DTIDY_HTML5_INCLUDE_PATH=$(pwd)/../../tidy-html5/build-tidy/installdir/include \
-DTIDY_HTML5_LIB=$(pwd)/../../tidy-html5/build-tidy/installdir/lib/libtidy.so \
-DBREAKPAD_ROOT=$(pwd)/../../breakpad/installdir \
-DQUENTIER_PACKAGED_AS_APP_IMAGE=ON -DCMAKE_PREFIX_PATH=/opt/qt512 -DUSE_QT5=1 ..
else
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir \
-DLibquentier-qt5_DIR=$(pwd)/../../libquentier/build/installdir/lib/cmake/Libquentier-qt5 \
-DQt5Keychain_DIR=$(pwd)/../../qtkeychain/build/installdir/lib/x86_64-linux-gnu/cmake/Qt5Keychain \
-DQEverCloud-qt5_DIR=$(pwd)/../../QEverCloud/build/installdir/lib/cmake/QEverCloud-qt5 \
-DTIDY_HTML5_INCLUDE_PATH=$(pwd)/../../tidy-html5/build-tidy/installdir/include \
-DTIDY_HTML5_LIB=$(pwd)/../../tidy-html5/build-tidy/installdir/lib/libtidy.so \
-DBREAKPAD_ROOT=$(pwd)/../../breakpad/installdir \
-DCMAKE_PREFIX_PATH=/opt/qt512 -DUSE_QT5=1 ..
fi
elif [ "${QT_BASE}" = "551" ]; then
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir \
-DLibquentier-qt5_DIR=$(pwd)/../../libquentier/build/installdir/lib/cmake/Libquentier-qt5 \
-DQt5Keychain_DIR=$(pwd)/../../qtkeychain/build/installdir/lib/x86_64-linux-gnu/cmake/Qt5Keychain \
-DQEverCloud-qt5_DIR=$(pwd)/../../QEverCloud/build/installdir/lib/cmake/QEverCloud-qt5 \
-DTIDY_HTML5_INCLUDE_PATH=$(pwd)/../../tidy-html5/build-tidy/installdir/include \
-DTIDY_HTML5_LIB=$(pwd)/../../tidy-html5/build-tidy/installdir/lib/libtidy.so \
-DBREAKPAD_ROOT=$(pwd)/../../breakpad/installdir \
-DUSE_QT5=1 -DUSE_QT5_WEBKIT=1 ..
else
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir \
-DLibquentier-qt4_DIR=$(pwd)/../../libquentier/build/installdir/lib/cmake/Libquentier-qt4 \
-DQtKeychain_DIR=$(pwd)/../../qtkeychain/build/installdir/lib/x86_64-linux-gnu/cmake/QtKeychain \
-DQEverCloud-qt4_DIR=$(pwd)/../../QEverCloud/build/installdir/lib/cmake/QEverCloud-qt4 \
-DTIDY_HTML5_INCLUDE_PATH=$(pwd)/../../tidy-html5/build-tidy/installdir/include \
-DTIDY_HTML5_LIB=$(pwd)/../../tidy-html5/build-tidy/installdir/lib/libtidy.so \
-Dqt4-mimetypes_DIR=$(pwd)/../../qt4-mimetypes/build/installdir/lib/cmake/qt4-mimetypes \
-DBREAKPAD_ROOT=$(pwd)/../../breakpad/installdir ..
fi
else
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir \
-DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 \
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \
-DLibquentier-qt5_DIR=$(pwd)/../../libquentier/build/installdir/lib/cmake/Libquentier-qt5 \
-DQt5Keychain_DIR=$(pwd)/../../qtkeychain/build/installdir/lib/cmake/Qt5Keychain \
-DQEverCloud-qt5_DIR=$(pwd)/../../QEverCloud/build/installdir/lib/cmake/QEverCloud-qt5 \
-DTIDY_HTML5_INCLUDE_PATH=/usr/local/include \
-DTIDY_HTML5_LIB=/usr/local/lib/libtidy.dylib \
-DCMAKE_VERBOSE_MAKEFILE=ON -DUSE_QT5=1 ..
fi
- make
- make check
- make lupdate
- make lrelease
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${QT_BASE}" = "5123" ] && [ "${COMPILER}" = "g++-5.4" ]; then
unset QTDIR &&
unset QT_PLUGIN_PATH &&
if [ "${TRAVIS_BRANCH}" = "master" ] || [ "${TRAVIS_BRANCH}" = "development" ]; then
export VERSION=$TRAVIS_BRANCH
else
export VERSION=$(git rev-parse --short HEAD)
fi
make DESTDIR=appdir install &&
linuxdeployqt appdir/usr/share/applications/*.desktop -bundle-non-qt-libs -exclude-libs="libnss3.so,libnssutil3.so" &&
mkdir -p appdir/usr/share/libquentier/translations &&
cp -r ../../libquentier/build/installdir/share/libquentier/translations/*.qm appdir/usr/share/libquentier/translations/ &&
linuxdeployqt appdir/usr/share/applications/*.desktop -appimage -exclude-libs="libnss3.so,libnssutil3.so" &&
find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
else
make install
fi
after_success:
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${QT_BASE}" = "5123" ] && [ "${COMPILER}" = "g++-5.4" ]; then
if [ "${TRAVIS_BRANCH}" = "master" ] || [ "${TRAVIS_BRANCH}" = "development" ]; then
wget https://github.com/d1vanov/ciuploadtool/releases/download/continuous-master/ciuploadtool_linux.zip &&
unzip ciuploadtool_linux.zip &&
chmod 755 ciuploadtool &&
./ciuploadtool -suffix="$TRAVIS_BRANCH" $QUENTIER_DIR/build/Quentier*.AppImage*
fi
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
if [ "${TRAVIS_BRANCH}" = "master" ] || [ "${TRAVIS_BRANCH}" = "development" ]; then
cd $QUENTIER_DIR/build/installdir &&
wget https://github.com/d1vanov/ciuploadtool/releases/download/continuous-master/ciuploadtool_mac.zip &&
unzip ciuploadtool_mac.zip &&
chmod 755 ciuploadtool &&
7z a Quentier_mac_x86_64.zip quentier.app &&
./ciuploadtool -suffix="$TRAVIS_BRANCH" $QUENTIER_DIR/build/installdir/Quentier_mac_x86_64.zip
fi
fi