forked from fontforge/fontforge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
171 lines (153 loc) · 7.45 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
language: c
compiler: gcc
sudo: false
dist: xenial
osx_image: xcode10.1
branches:
only:
- master
- travis
- coverity_scan
env:
global:
- CMAKE=cmake
- CTEST_PARALLEL_LEVEL=100
# For Coverity
- secure: "MeTS1Pqa5gzx1nn/peW/9a5kq84bba3XYUljOfkCUqzuyGiERk/nmok+RW7skrgzboBlKxnNG8+ykKqHMwK9s9M83ezFxvEWXBcKEpmEQKkqXPI5hpMs6jGLTgpeuheSIzqHA3danV8iircp1GOiTLWA0pt/AOsNLZiaYBh0OiE="
# For Crowdin
- secure: "bvU1qkor+TQPr6LXxlQ6w2hwdLIXkEh+QWhipjmKLU0Aj59sGF4+U9uVLP/QbGNulDiwUanVCSV7QZhi1HKKB4rVDVlyhzOQvHU+67dQDB4CKDlezp4TKhVoHcpP7MerSdQ02wr45VbwOITAKpvicdBKwb5x/p1v8HsO25UbJlE="
matrix:
include:
- os: linux
env:
- LINUX_NOX=true
- CMAKE=/usr/bin/cmake # Make sure at least one build uses CMake 3.5
- os: linux
env: LINUX_FULL=true
- os: linux
env:
- LINUX_RELEASE=true
- BINTRAY_DEPLOY=true
- os: osx
env:
- OSX_ONLY=true
- BINTRAY_DEPLOY=true
- PYTHON=python3
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- deadsnakes
packages: [autoconf, automake, autotools-dev, bzip2, gcc-8, g++-8, libtool,
libjpeg-dev, libtiff5-dev, libpng12-dev, libfreetype6-dev, libgif-dev,
libx11-dev, libgtk-3-dev, libxml2-dev, libpango1.0-dev, libcairo2-dev, python3.7-dev,
libbrotli-dev, ninja-build, cmake, lcov]
coverity_scan:
project:
name: "fontforge/fontforge"
description: "Free (libre) font editor for Windows, Mac OS X and GNU+Linux"
build_command_prepend: cov-configure --comptype gcc --compiler $CC --template && mkdir build && pushd build && cmake $FFCONFIG .. && popd
build_command: make -C build -j4
branch_pattern: coverity_scan
notification_email: [email protected]
cache:
directories:
- $TRAVIS_BUILD_DIR/travisdeps
before_install:
- if [ ! -z "$LINUX_FULL" ]; then pip --quiet install --user cpp-coveralls -U ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" -- --force; sudo rm -rf ~/.rvm; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then git config --global protocol.version 1 && /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"; fi
install:
- |
set -e
export PREFIX=$TRAVIS_BUILD_DIR/target
export DEPSPREFIX=$TRAVIS_BUILD_DIR/travisdeps
export PATH=$PATH:$DEPSPREFIX/bin:$PREFIX/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DEPSPREFIX/lib:$PREFIX/lib
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$DEPSPREFIX/lib/pkgconfig
export FFCONFIG="-DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_FONTFORGE_EXTRAS=ON"
if [ ! -z "$LINUX_FULL" ] ; then
export FFCONFIG="$FFCONFIG -DENABLE_X11=ON -DENABLE_CODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug"
elif [ ! -z "$LINUX_NOX" ]; then
export FFCONFIG="$FFCONFIG -DENABLE_GUI=OFF -DENABLE_PYTHON_SCRIPTING=OFF"
fi
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
export FTVER=`dpkg -s libfreetype6-dev | perl -ne 'print $1 if /^Version: (\d+(?:\.\d+)+)/'`
export SFFTVER=`echo $FTVER | perl -ne 'print $1 if /^(\d+(?:\.\d+){1,2})/'`
export FFCONFIG="$FFCONFIG -DENABLE_FREETYPE_DEBUGGER=$DEPSPREFIX/freetype-$FTVER"
export CC=gcc-8
export CXX=g++-8
export GCOV=gcov-8
# This block only runs if the cache isn't present.
if [ ! "$(ls -A $DEPSPREFIX)" ]; then
mkdir -p work && pushd work
git clone --depth 1 https://github.com/fontforge/libspiro
git clone --depth 1 https://github.com/fontforge/libuninameslist
git clone --depth 1 --branch v1.0.2 https://github.com/google/woff2
wget --tries 1 "http://download.savannah.gnu.org/releases/freetype/freetype-$FTVER.tar.gz" || \
wget "https://sourceforge.net/projects/freetype/files/freetype2/$SFFTVER/freetype-$FTVER.tar.gz"
wget https://downloads.crowdin.com/cli/v2/crowdin-cli.zip
pushd libspiro && autoreconf -fiv && ./configure --prefix=$DEPSPREFIX && make -j4 && make install && popd
pushd libuninameslist && autoreconf -fiv && ./configure --enable-pscript --prefix=$DEPSPREFIX && make -j4 && make install && popd
pushd woff2 && mkdir build && cd build && cmake -GNinja .. -DCMAKE_INSTALL_PREFIX=$DEPSPREFIX -DCMAKE_INSTALL_LIBDIR=lib && ninja install && popd
tar -zxf freetype-$FTVER.tar.gz -C $DEPSPREFIX
mkdir crowdin && pushd crowdin && unzip ../crowdin-cli.zip && mv */* . && mv crowdin-cli.jar $DEPSPREFIX && popd
popd
fi
# These are FF-specific mods (set here so it runs also in Coverity)
export CFLAGS="$CFLAGS -fdiagnostics-color=always -Wall -Wno-switch -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion -Wshadow"
export PYTHON=python3.7
else
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig
export PATH="/usr/local/opt/ruby/bin:$PATH"
export HOMEBREW_NO_AUTO_UPDATE=1
# Disable fc-cache on fontconfig install. Because it's slow.
sed -i.bak '/fc-cache/d' "$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/fontconfig.rb"
# 10 billion years later...
brew install autoconf automake libtool pkg-config ruby cmake ninja
brew install cairo coreutils fontconfig gettext giflib gtk+3 jpeg libpng libspiro libtiff libtool libuninameslist python@3 wget woff2
# This *must* be linked or else gettext/intl will be disabled
brew link --force gettext
# Until Homebrew fixes their gtk
export CFLAGS="$CFLAGS -DGDK_WINDOWING_QUARTZ=1"
fi
# Don't specify the prefix in the prefix='' argument else you get different results...
export PYTHONPATH=$PREFIX/$($PYTHON -c "import distutils.sysconfig as sc; print(sc.get_python_lib(prefix='', plat_specific=True,standard_lib=False))")
if [ "$TRAVIS_OS_NAME" == "osx" ]; then set +e; fi
script:
- $CMAKE --version
- mkdir build && pushd build && $CMAKE -GNinja $FFCONFIG .. && popd
- ninja -C build install
- ninja -C build check
- if [ ! -z "$LINUX_FULL" ]; then ninja -C build dist; fi
- if [ -z "$LINUX_NOX" ]; then $PYTHON travis-scripts/pyhook_smoketest.py; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ninja -C build macbundle; fi
- |
if [ ! -z "$LINUX_RELEASE" ]; then
ninja -C build potfiles
DESTDIR=build/appdir $CMAKE -DCMAKE_INSTALL_PREFIX=/usr -P build/cmake_install.cmake
travis-scripts/ffappimagebuild.sh build/appdir $TRAVIS_COMMIT
fi
after_success:
- if [ ! -z "$LINUX_FULL" ]; then coveralls -b build --gcov-options '\-bulp' --gcov $(which $GCOV); fi
- if [ ! -z "$LINUX_RELEASE" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then java -jar $DEPSPREFIX/crowdin-cli.jar -c .crowdin.yml upload; fi
after_failure:
- which $PYTHON
- env
- cat build/CMakeCache.txt || true
- cat build/CMakeFiles/CMakeOutput.log || true
- cat build/Testing/Temporary/LastTest.log || true
- cat build/build.ninja || true
deploy:
provider: bintray
file: "travis-scripts/bintray_descriptor.json"
user: "fontforge-ci-bot"
dry-run: false
skip_cleanup: true
key:
secure: "YBvK5QLZ4LNE3WQPXjDYalLsTgmiGyRGYY87ep5knQ0YGyt3Q9OiBCtQ3GvhHNKOa2L2QlctJi2VWcUu+ftrS72mi5j2tvse9wRF3V8EVFIPb3bxjnN6E11FjXtLIqU8WR7HlAHJpOL2bhO+RleIhSVZm0MsiSjekFOoA5tfll4="
on:
condition: '"$BINTRAY_DEPLOY" = "true"'
branch:
- master
#- travis