File: .travis.yml

package info (click to toggle)
fontforge 1:20190801~dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 71,404 kB
  • sloc: ansic: 590,896; python: 4,449; makefile: 1,265; sh: 529; perl: 315; xml: 259; cpp: 219
file content (180 lines) | stat: -rw-r--r-- 7,582 bytes parent folder | download
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
language: c
compiler: gcc
sudo: false
dist: xenial
osx_image: xcode9.2

branches:
  only:
    - master
    - travis
    - coverity_scan

env:
  global:
    - MAKEFLAGS="-j4"
    # For Coverity
    - secure: "MeTS1Pqa5gzx1nn/peW/9a5kq84bba3XYUljOfkCUqzuyGiERk/nmok+RW7skrgzboBlKxnNG8+ykKqHMwK9s9M83ezFxvEWXBcKEpmEQKkqXPI5hpMs6jGLTgpeuheSIzqHA3danV8iircp1GOiTLWA0pt/AOsNLZiaYBh0OiE="

matrix:
  include:
    - os: linux
      env: LINUX_NOX=true
    - 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
    # Temporary measure, expect this to be gone by the August 1 release
    - os: osx
      env:
        - OSX_ONLY=true
        - BINTRAY_DEPLOY=true
        - PYTHON=python

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, 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 && ./bootstrap --force && ./configure $FFCONFIG
    build_command: make -j4
    branch_pattern: coverity_scan
    notification_email: jtanx_blackhole@outlook.com

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 /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="--prefix=$PREFIX --enable-fontforge-extras --with-libspiro --with-libuninameslist"
    # Required for finding libuninameslist/libspiro properly...
    export LDFLAGS="$LDFLAGS -L$DEPSPREFIX/lib"

    if [ ! -z "$LINUX_FULL" ] ; then
      export FFCONFIG="$FFCONFIG --enable-code-coverage --enable-debug --enable-woff2"
    elif [ ! -z "$LINUX_NOX" ]; then
      export FFCONFIG="$FFCONFIG --without-x --disable-python-extension --disable-python-scripting"
    elif [ ! -z "$LINUX_RELEASE" ];then
      export FFCONFIG="$FFCONFIG --without-libzmq --enable-woff2"
    fi

    # For some inane reason Travis defines this to '-g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security'
    # This prevents pkg-config from setting the CFLAGS properly.
    unset PYTHON_CFLAGS

    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 --with-freetype-source=$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"

        pushd libspiro && autoreconf -fiv && ./configure --prefix=$DEPSPREFIX && make && make install && popd
        pushd libuninameslist && autoreconf -fiv && ./configure --enable-pscript --prefix=$DEPSPREFIX && make && 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
        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 FFCONFIG="$FFCONFIG --enable-gdk=gdk3 --enable-woff2"
      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
      brew install cairo coreutils fontconfig gettext giflib gtk+3 jpeg libpng libspiro libtiff libtool libuninameslist python@2 python@3 wget woff2
      # Pin pango to this version, because of issues, see #3343
      brew unlink pango || true
      brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/ad91e4df4a843764901811a965a17f650f34e2c1/Formula/pango.rb
      # 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

    export PYVER=$($PYTHON --version 2>&1 | cut -d' ' -f2 | cut -d. -f1-2)
    export PYTHONPATH=$PYTHONPATH:$PREFIX/lib/python$PYVER/site-packages

    # This is so terrible...
    # DO NOT SET LIBS OR FEATURE DETECTION WILL BE BROKEN
    export LIBSPIRO_CFLAGS=`pkg-config --cflags libspiro`
    export LIBUNINAMESLIST_CFLAGS=`pkg-config --cflags libuninameslist`

    set +e

script:
  - ./bootstrap
  - ./configure $FFCONFIG
  - make
  - make install
  - make check
  - if [ ! -z "$LINUX_FULL" ]; then make distcheck; fi
  - fontforge -version
  - if [ -z "$LINUX_NOX" ]; then $PYTHON travis-scripts/pyhook_smoketest.py; fi
  - if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then travis-scripts/ffosxbuild.sh $PREFIX $TRAVIS_COMMIT; fi
  - if [ ! -z "$LINUX_RELEASE" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then travis-scripts/ffappimagebuild.sh; fi

after_success:
  - if [ ! -z "$LINUX_FULL" ]; then coveralls --gcov-options '\-bulp' --gcov $(which $GCOV); fi

after_failure:
  - which python3
  - env
  - cat tests/testsuite.log || 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