-
-
Notifications
You must be signed in to change notification settings - Fork 87
/
.travis.yml
148 lines (129 loc) · 9.89 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
notifications:
email: false
os: osx
language: cpp
matrix:
include:
- os: linux
dist: xenial
sudo: required
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- os: osx
compiler: clang
osx_image: xcode9.3
install:
# (Linux) Prepare build environment
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository --yes ppa:beineri/opt-qt591-xenial; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt install cmake; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libgl-dev; fi
# (Linux) Install CGAL
# (Linux) First install a maybe old version CGAL to resolve dependencies
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libcgal-dev; fi
# (Linux) Build CGAL from source
- wget https://github.com/CGAL/cgal/releases/download/releases/CGAL-5.1-beta1/CGAL-5.1-beta1.zip
- unzip CGAL-5.1-beta1.zip
- cd CGAL-5.1-beta1
- mkdir build
- cd build
- cmake ../
- make
- sudo make install
- cd "$TRAVIS_BUILD_DIR"
# Build blosc
- cd thirdparty/blosc/c-blosc-1.18.1
- mkdir build
- cd build
- cmake -D "BUILD_SHARED=OFF" -D "BUILD_TESTS=OFF" -D "BUILD_BENCHMARKS=OFF" ../
- cmake --build . --config Release
- cd "$TRAVIS_BUILD_DIR"
# Build zlib
- cd thirdparty/zlib/zlib-1.2.11
- mkdir build
- cd build
- cmake ../
- cmake --build . --config Release
- cp "$TRAVIS_BUILD_DIR/thirdparty/zlib/zlib-1.2.11/build/zconf.h" "$TRAVIS_BUILD_DIR/thirdparty/zlib/zlib-1.2.11/zconf.h"
- cd "$TRAVIS_BUILD_DIR"
# Build openexr
- cd thirdparty/openexr/openexr-2.4.1
- mkdir build
- cd build
- cmake -D "BUILD_SHARED_LIBS=OFF" -D "PYILMBASE_ENABLE=0" -D "OPENEXR_VIEWERS_ENABLE=0" -D "ZLIB_INCLUDE_DIR=$TRAVIS_BUILD_DIR/thirdparty/zlib/zlib-1.2.11" -D "ZLIB_LIBRARY=$TRAVIS_BUILD_DIR/thirdparty/zlib/zlib-1.2.11/build/libz.a" ../
- cmake --build . --config Release
- cd "$TRAVIS_BUILD_DIR"
# Build tbb
- cd thirdparty/tbb
- mkdir build2
- cd build2
- cmake ../
- cmake --build . --config Release
- cd "$TRAVIS_BUILD_DIR"
# Build OpenVDB
- cd thirdparty/openvdb/openvdb-7.0.0
- mkdir build
- cd build
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake -D "OPENVDB_CORE_SHARED=OFF" -D "OPENVDB_BUILD_VDB_PRINT=OFF" -D "IlmBase_INCLUDE_DIR=$TRAVIS_BUILD_DIR/thirdparty/openexr/openexr-2.4.1" -D "IlmBase_Half_LIBRARY=$TRAVIS_BUILD_DIR/thirdparty/openexr/openexr-2.4.1/build/IlmBase/Half/libHalf-2_4.a" -D "Tbb_INCLUDE_DIR=$TRAVIS_BUILD_DIR/thirdparty/tbb/include" -D "Tbb_tbb_LIBRARY=$TRAVIS_BUILD_DIR/thirdparty/tbb/build2/libtbb_static.a" -D "Tbb_tbbmalloc_LIBRARY=$TRAVIS_BUILD_DIR/thirdparty/tbb/build2/libtbbmalloc_static.a" -D "Tbb_tbbmalloc_proxy_LIBRARY=$TRAVIS_BUILD_DIR/thirdparty/tbb/build2/libtbbmalloc_proxy_static.a" -D "ZLIB_INCLUDE_DIR=$TRAVIS_BUILD_DIR/thirdparty/zlib/zlib-1.2.11" -D "ZLIB_LIBRARY=$TRAVIS_BUILD_DIR/thirdparty/zlib/zlib-1.2.11/build/libz.a" -D "Blosc_INCLUDE_DIR=$TRAVIS_BUILD_DIR/thirdparty/blosc/c-blosc-1.18.1" -D "Blosc_LIBRARY=$TRAVIS_BUILD_DIR/thirdparty/blosc/c-blosc-1.18.1/build/blosc/libblosc.a" -D "BOOST_INCLUDEDIR=/usr/local/opt/boost/include" -D "OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING=ON" -D "CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES=/usr/local/opt/boost/include;$TRAVIS_BUILD_DIR/thirdparty/blosc/c-blosc-1.18.1/blosc;$TRAVIS_BUILD_DIR/thirdparty/zlib/zlib-1.2.11/build" ../; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -D "DISABLE_DEPENDENCY_VERSION_CHECKS=ON" -D "OPENVDB_CORE_SHARED=OFF" -D "OPENVDB_BUILD_VDB_PRINT=OFF" -D "IlmBase_INCLUDE_DIR=$TRAVIS_BUILD_DIR/thirdparty/openexr/openexr-2.4.1" -D "IlmBase_Half_LIBRARY=$TRAVIS_BUILD_DIR/thirdparty/openexr/openexr-2.4.1/build/IlmBase/Half/libHalf-2_4.a" -D "Tbb_INCLUDE_DIR=$TRAVIS_BUILD_DIR/thirdparty/tbb/include" -D "Tbb_tbb_LIBRARY=$TRAVIS_BUILD_DIR/thirdparty/tbb/build2/libtbb_static.a" -D "Tbb_tbbmalloc_LIBRARY=$TRAVIS_BUILD_DIR/thirdparty/tbb/build2/libtbbmalloc_static.a" -D "Tbb_tbbmalloc_proxy_LIBRARY=$TRAVIS_BUILD_DIR/thirdparty/tbb/build2/libtbbmalloc_proxy_static.a" -D "ZLIB_INCLUDE_DIR=$TRAVIS_BUILD_DIR/thirdparty/zlib/zlib-1.2.11" -D "ZLIB_LIBRARY=$TRAVIS_BUILD_DIR/thirdparty/zlib/zlib-1.2.11/build/libz.a" -D "Blosc_INCLUDE_DIR=$TRAVIS_BUILD_DIR/thirdparty/blosc/c-blosc-1.18.1" -D "Blosc_LIBRARY=$TRAVIS_BUILD_DIR/thirdparty/blosc/c-blosc-1.18.1/build/blosc/libblosc.a" -D "BOOST_INCLUDEDIR=/usr/local/include" -D "OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING=ON" -D "CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES=/usr/local/include;$TRAVIS_BUILD_DIR/thirdparty/blosc/c-blosc-1.18.1/blosc;$TRAVIS_BUILD_DIR/thirdparty/zlib/zlib-1.2.11/build" ../; fi
- cmake --build . --config Release
- cd "$TRAVIS_BUILD_DIR"
# (Mac) Install Qt5
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then HOMEBREW_VERBOSE_USING_DOTS=1 brew reinstall --verbose qt; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="/usr/local/opt/qt/bin:$(brew --prefix)/bin:$PATH"; fi
# (Linux) Install Qt5
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install qt59base qt59tools --force-yes; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then source /opt/qt59/bin/qt59-env.sh; fi
script:
# Build AutoRemesher
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then qmake -config release || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then qmake -config release || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make CXX="g++ -fext-numeric-literals" || travis_terminate 1; fi
# Prepare tag name
- export TAG="$TRAVIS_TAG"
- if [[ "$TAG" == "" ]]; then export TAG=unstable; fi
- export BRANCH="$TRAVIS_BRANCH"
- if [[ "$BRANCH" == "$TAG" ]]; then export BRANCH=master; fi
# (Mac) Prepare dmg
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mv autoremesher.app autoremesher-$TAG.app || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then macdeployqt autoremesher-$TAG.app -dmg || travis_terminate 1; fi
# (Linux) Prepare AppImage
# References:
# https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
# https://packages.ubuntu.com/search?suite=trusty&arch=amd64&mode=exactfilename&searchon=contents&keywords=libstdc%2B%2B.so.6
# https://github.com/darealshinji/AppImageKit-checkrt/issues/1
# https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/AppRun-patched-x86_64
# https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/exec-x86_64.so
# https://github.com/probonopd/audacity/blob/AppImage/.travis.yml
# https://discourse.appimage.org/t/im-a-big-fan-of-this-but-graphics-driver-libstdc-conflict/171
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p appdir/usr/share/metainfo || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p appdir/usr/share/applications || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p appdir/usr/bin || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p appdir/usr/optional/libstdc++ || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ldd --version; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ls /usr/lib/x86_64-linux-gnu/ | grep libstdc; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 appdir/usr/optional/libstdc++/libstdc++.so.6 || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/exec-x86_64.so appdir/usr/optional/exec.so || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/autoremesher.png appdir/autoremesher.png || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/autoremesher.appdata.xml appdir/usr/share/metainfo/autoremesher.appdata.xml || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./autoremesher appdir/usr/bin/autoremesher || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/autoremesher.desktop appdir/usr/share/applications/autoremesher.desktop || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then chmod a+x ./ci/linuxdeployqt.AppImage || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then unset QTDIR; unset QT_PLUGIN_PATH ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./ci/linuxdeployqt.AppImage appdir/usr/share/applications/autoremesher.desktop -bundle-non-qt-libs -verbose=2 || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then rm appdir/AppRun || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/AppRun-patched-x86_64 appdir/AppRun || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then chmod a+x appdir/AppRun || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./ci/linuxdeployqt.AppImage --appimage-extract || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH=$(readlink -f ./squashfs-root/usr/bin):$PATH || travis_terminate 1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then rm -v "./appdir/usr/lib/libxcb-dri2.so"* "./appdir/usr/lib/libxcb-dri3.so"*; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./squashfs-root/usr/bin/appimagetool -g ./appdir/ autoremesher-$TAG.AppImage || travis_terminate 1; fi
# Distribute
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then echo "No distribution on pull request"; fi
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then travis_terminate 0; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sh ci/upload-github-release-asset.sh github_api_token=${my_auth_token} branch=$BRANCH owner=huxingyi repo=autoremesher tag=$TAG filename=autoremesher-$TAG.dmg; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then bash ci/upload-github-release-asset.sh github_api_token=${my_auth_token} branch=$BRANCH owner=huxingyi repo=autoremesher tag=$TAG filename=autoremesher-$TAG.AppImage; fi