blob: 0dbb9f63752a04218d794545b64f688c11c3f87e [file] [log] [blame]
Eric Anholt1c0ac192015-11-23 16:25:29 -08001language: c
2
Emil Velikov7c38d7b2018-12-13 11:20:41 +00003dist: xenial
Eric Anholt1c0ac192015-11-23 16:25:29 -08004
5cache:
Emil Velikov6431b982017-04-06 14:02:38 +01006 ccache: true
Eric Anholt1c0ac192015-11-23 16:25:29 -08007
Eric Engestrom6e0effb2019-02-07 11:36:19 +00008env:
9 global:
10 - PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
11
Emil Velikov56ba2522017-04-06 14:38:40 +010012matrix:
13 include:
14 - env:
Jon Turneyb3a1d952018-01-18 13:05:06 +000015 - LABEL="macOS make"
16 - BUILD=make
Jon Turneyb3a1d952018-01-18 13:05:06 +000017 - DRI_LOADERS="--with-platforms=x11 --disable-egl"
18 os: osx
Jon Turneyb5af1992018-01-16 17:51:53 +000019 - env:
20 - LABEL="macOS meson"
21 - BUILD=meson
Eric Engestrom44c420a2019-03-08 15:04:54 +000022 - DRI_LOADERS="-Dplatforms=x11"
Eric Engestromb63fe652019-03-14 12:30:15 +000023 - GALLIUM_DRIVERS=swrast
Jon Turneyb5af1992018-01-16 17:51:53 +000024 os: osx
Jon Turneyb3a1d952018-01-18 13:05:06 +000025
26before_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
Eric Anholt1c0ac192015-11-23 16:25:29 -080048
49install:
Andres Gomez72552012018-03-05 17:25:36 +020050 # Install a more modern meson from pip, since the version in the
Emil Velikov7c38d7b2018-12-13 11:20:41 +000051 # ubuntu repos is often quite old.
Dylan Bakerdf820122017-09-27 10:37:28 -070052 - if test "x$BUILD" = xmeson; then
Eric Engestrom3824c8e2018-07-17 15:12:32 +010053 pip3 install --user meson;
Eric Engestromf976d222018-08-13 12:10:38 +010054 pip3 install --user mako;
55 fi
56
57 # Install autotools build dependencies
58 - if test "x$BUILD" = xmake; then
Emil Velikov4428eed2018-10-31 21:54:49 +000059 pip2 install --user mako;
Dylan Bakerdf820122017-09-27 10:37:28 -070060 fi
61
Eric Anholt1c0ac192015-11-23 16:25:29 -080062 # Install dependencies where we require specific versions (or where
63 # disallowed by Travis CI's package whitelisting).
64
Eric Anholt1c0ac192015-11-23 16:25:29 -080065script:
Eric Anholt18f8da72015-12-01 11:57:49 -080066 - if test "x$BUILD" = xmake; then
Eric Engestromd246aa32017-10-04 13:54:14 +010067 export CFLAGS="$CFLAGS -isystem`pwd`";
Eric Engestrom08b70e12019-03-08 15:33:39 +000068 export MAKEFLAGS="-j4";
Emil Velikov7e2af372017-04-07 12:13:56 +010069
Eric Anholt3db39d842018-06-05 08:18:51 -070070 mkdir build &&
71 cd build &&
Eric Engestrom41a0c002019-01-21 10:03:37 +000072 ../autogen.sh
73 --enable-autotools
74 --enable-debug
Emil Velikov7e2af372017-04-07 12:13:56 +010075 $DRI_LOADERS
Emil Velikov8479fd82017-04-06 18:01:19 +010076 --with-dri-drivers=$DRI_DRIVERS
77 --with-gallium-drivers=$GALLIUM_DRIVERS
78 --with-vulkan-drivers=$VULKAN_DRIVERS
Eric Anholt78ab62b2016-08-18 14:10:57 -070079 --disable-llvm-shared-libs
Emil Velikov7e2af372017-04-07 12:13:56 +010080 &&
Eric Engestrom08b70e12019-03-08 15:33:39 +000081 make && make check;
Emil Velikovabcfea22017-04-06 14:23:36 +010082 fi
83
Andres Gomezb5b912d2018-02-28 23:18:59 +020084 - |
85 if test "x$BUILD" = xmeson; then
Eric Engestrome12b0b52019-01-02 12:28:48 +000086 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
Andres Gomezb5b912d2018-02-28 23:18:59 +020091
Eric Engestrome12b0b52019-01-02 12:28:48 +000092 $LLVM_CONFIG --version
93 else
94 : > native.file
95 fi
Emil Velikov81173fd2018-12-13 10:38:20 +000096
Andres Gomezb5b912d2018-02-28 23:18:59 +020097 export CFLAGS="$CFLAGS -isystem`pwd`"
Emil Velikov51318c32018-12-12 13:42:36 +000098 meson _build \
Dylan Baker31c162a2018-12-11 10:34:51 -080099 --native-file=native.file \
Emil Velikov266ae222018-12-12 13:18:54 +0000100 -Dbuild-tests=true \
Emil Velikov51318c32018-12-12 13:42:36 +0000101 ${DRI_LOADERS} \
Emil Velikov266ae222018-12-12 13:18:54 +0000102 -Ddri-drivers=${DRI_DRIVERS:-[]} \
103 -Dgallium-drivers=${GALLIUM_DRIVERS:-[]} \
104 -Dvulkan-drivers=${VULKAN_DRIVERS:-[]}
Emil Velikovde72c1f2018-12-12 17:43:07 +0000105 meson configure _build
Andres Gomezb5b912d2018-02-28 23:18:59 +0200106 ninja -C _build
Dylan Baker31c162a2018-12-11 10:34:51 -0800107 ninja -C _build test
Dylan Bakerdf820122017-09-27 10:37:28 -0700108 fi