0dbb9f63752a04218d794545b64f688c11c3f87e
[mesa.git] / .travis.yml
1 language: c
2
3 dist: xenial
4
5 cache:
6 ccache: true
7
8 env:
9 global:
10 - PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
11
12 matrix:
13 include:
14 - env:
15 - LABEL="macOS make"
16 - BUILD=make
17 - DRI_LOADERS="--with-platforms=x11 --disable-egl"
18 os: osx
19 - env:
20 - LABEL="macOS meson"
21 - BUILD=meson
22 - DRI_LOADERS="-Dplatforms=x11"
23 - GALLIUM_DRIVERS=swrast
24 os: osx
25
26 before_install:
27 - |
28 if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
29 HOMEBREW_NO_AUTO_UPDATE=1 brew install python3 ninja expat gettext
30 # Set PATH for homebrew pip3 installs
31 PATH="$HOME/Library/Python/3.6/bin:${PATH}"
32 # Set PKG_CONFIG_PATH for keg-only expat
33 PKG_CONFIG_PATH="/usr/local/opt/expat/lib/pkgconfig:${PKG_CONFIG_PATH}"
34 # Set PATH for keg-only gettext
35 PATH="/usr/local/opt/gettext/bin:${PATH}"
36
37 # Install xquartz for prereqs ...
38 XQUARTZ_VERSION="2.7.11"
39 wget -nv https://dl.bintray.com/xquartz/downloads/XQuartz-${XQUARTZ_VERSION}.dmg
40 hdiutil attach XQuartz-${XQUARTZ_VERSION}.dmg
41 sudo installer -pkg /Volumes/XQuartz-${XQUARTZ_VERSION}/XQuartz.pkg -target /
42 hdiutil detach /Volumes/XQuartz-${XQUARTZ_VERSION}
43 # ... and set paths
44 PATH="/opt/X11/bin:${PATH}"
45 PKG_CONFIG_PATH="/opt/X11/share/pkgconfig:/opt/X11/lib/pkgconfig:${PKG_CONFIG_PATH}"
46 ACLOCAL="aclocal -I /opt/X11/share/aclocal -I /usr/local/share/aclocal"
47 fi
48
49 install:
50 # Install a more modern meson from pip, since the version in the
51 # ubuntu repos is often quite old.
52 - if test "x$BUILD" = xmeson; then
53 pip3 install --user meson;
54 pip3 install --user mako;
55 fi
56
57 # Install autotools build dependencies
58 - if test "x$BUILD" = xmake; then
59 pip2 install --user mako;
60 fi
61
62 # Install dependencies where we require specific versions (or where
63 # disallowed by Travis CI's package whitelisting).
64
65 script:
66 - if test "x$BUILD" = xmake; then
67 export CFLAGS="$CFLAGS -isystem`pwd`";
68 export MAKEFLAGS="-j4";
69
70 mkdir build &&
71 cd build &&
72 ../autogen.sh
73 --enable-autotools
74 --enable-debug
75 $DRI_LOADERS
76 --with-dri-drivers=$DRI_DRIVERS
77 --with-gallium-drivers=$GALLIUM_DRIVERS
78 --with-vulkan-drivers=$VULKAN_DRIVERS
79 --disable-llvm-shared-libs
80 &&
81 make && make check;
82 fi
83
84 - |
85 if test "x$BUILD" = xmeson; then
86 if test -n "$LLVM_CONFIG"; then
87 # We need to control the version of llvm-config we're using, so we'll
88 # generate a native file to do so. This requires meson >=0.49
89 #
90 echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file
91
92 $LLVM_CONFIG --version
93 else
94 : > native.file
95 fi
96
97 export CFLAGS="$CFLAGS -isystem`pwd`"
98 meson _build \
99 --native-file=native.file \
100 -Dbuild-tests=true \
101 ${DRI_LOADERS} \
102 -Ddri-drivers=${DRI_DRIVERS:-[]} \
103 -Dgallium-drivers=${GALLIUM_DRIVERS:-[]} \
104 -Dvulkan-drivers=${VULKAN_DRIVERS:-[]}
105 meson configure _build
106 ninja -C _build
107 ninja -C _build test
108 fi