Eric Anholt | 1c0ac19 | 2015-11-23 16:25:29 -0800 | [diff] [blame] | 1 | language: c |
| 2 | |
Emil Velikov | 7c38d7b | 2018-12-13 11:20:41 +0000 | [diff] [blame] | 3 | dist: xenial |
Eric Anholt | 1c0ac19 | 2015-11-23 16:25:29 -0800 | [diff] [blame] | 4 | |
| 5 | cache: |
Emil Velikov | 6431b98 | 2017-04-06 14:02:38 +0100 | [diff] [blame] | 6 | ccache: true |
Eric Anholt | 1c0ac19 | 2015-11-23 16:25:29 -0800 | [diff] [blame] | 7 | |
Eric Engestrom | 6e0effb | 2019-02-07 11:36:19 +0000 | [diff] [blame] | 8 | env: |
| 9 | global: |
| 10 | - PKG_CONFIG_PATH="$PKG_CONFIG_PATH" |
| 11 | |
Emil Velikov | 56ba252 | 2017-04-06 14:38:40 +0100 | [diff] [blame] | 12 | matrix: |
| 13 | include: |
| 14 | - env: |
Jon Turney | b3a1d95 | 2018-01-18 13:05:06 +0000 | [diff] [blame] | 15 | - LABEL="macOS make" |
| 16 | - BUILD=make |
Jon Turney | b3a1d95 | 2018-01-18 13:05:06 +0000 | [diff] [blame] | 17 | - DRI_LOADERS="--with-platforms=x11 --disable-egl" |
| 18 | os: osx |
Jon Turney | b5af199 | 2018-01-16 17:51:53 +0000 | [diff] [blame] | 19 | - env: |
| 20 | - LABEL="macOS meson" |
| 21 | - BUILD=meson |
Eric Engestrom | 44c420a | 2019-03-08 15:04:54 +0000 | [diff] [blame] | 22 | - DRI_LOADERS="-Dplatforms=x11" |
Eric Engestrom | b63fe65 | 2019-03-14 12:30:15 +0000 | [diff] [blame^] | 23 | - GALLIUM_DRIVERS=swrast |
Jon Turney | b5af199 | 2018-01-16 17:51:53 +0000 | [diff] [blame] | 24 | os: osx |
Jon Turney | b3a1d95 | 2018-01-18 13:05:06 +0000 | [diff] [blame] | 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 |
Eric Anholt | 1c0ac19 | 2015-11-23 16:25:29 -0800 | [diff] [blame] | 48 | |
| 49 | install: |
Andres Gomez | 7255201 | 2018-03-05 17:25:36 +0200 | [diff] [blame] | 50 | # Install a more modern meson from pip, since the version in the |
Emil Velikov | 7c38d7b | 2018-12-13 11:20:41 +0000 | [diff] [blame] | 51 | # ubuntu repos is often quite old. |
Dylan Baker | df82012 | 2017-09-27 10:37:28 -0700 | [diff] [blame] | 52 | - if test "x$BUILD" = xmeson; then |
Eric Engestrom | 3824c8e | 2018-07-17 15:12:32 +0100 | [diff] [blame] | 53 | pip3 install --user meson; |
Eric Engestrom | f976d22 | 2018-08-13 12:10:38 +0100 | [diff] [blame] | 54 | pip3 install --user mako; |
| 55 | fi |
| 56 | |
| 57 | # Install autotools build dependencies |
| 58 | - if test "x$BUILD" = xmake; then |
Emil Velikov | 4428eed | 2018-10-31 21:54:49 +0000 | [diff] [blame] | 59 | pip2 install --user mako; |
Dylan Baker | df82012 | 2017-09-27 10:37:28 -0700 | [diff] [blame] | 60 | fi |
| 61 | |
Eric Anholt | 1c0ac19 | 2015-11-23 16:25:29 -0800 | [diff] [blame] | 62 | # Install dependencies where we require specific versions (or where |
| 63 | # disallowed by Travis CI's package whitelisting). |
| 64 | |
Eric Anholt | 1c0ac19 | 2015-11-23 16:25:29 -0800 | [diff] [blame] | 65 | script: |
Eric Anholt | 18f8da7 | 2015-12-01 11:57:49 -0800 | [diff] [blame] | 66 | - if test "x$BUILD" = xmake; then |
Eric Engestrom | d246aa3 | 2017-10-04 13:54:14 +0100 | [diff] [blame] | 67 | export CFLAGS="$CFLAGS -isystem`pwd`"; |
Eric Engestrom | 08b70e1 | 2019-03-08 15:33:39 +0000 | [diff] [blame] | 68 | export MAKEFLAGS="-j4"; |
Emil Velikov | 7e2af37 | 2017-04-07 12:13:56 +0100 | [diff] [blame] | 69 | |
Eric Anholt | 3db39d84 | 2018-06-05 08:18:51 -0700 | [diff] [blame] | 70 | mkdir build && |
| 71 | cd build && |
Eric Engestrom | 41a0c00 | 2019-01-21 10:03:37 +0000 | [diff] [blame] | 72 | ../autogen.sh |
| 73 | --enable-autotools |
| 74 | --enable-debug |
Emil Velikov | 7e2af37 | 2017-04-07 12:13:56 +0100 | [diff] [blame] | 75 | $DRI_LOADERS |
Emil Velikov | 8479fd8 | 2017-04-06 18:01:19 +0100 | [diff] [blame] | 76 | --with-dri-drivers=$DRI_DRIVERS |
| 77 | --with-gallium-drivers=$GALLIUM_DRIVERS |
| 78 | --with-vulkan-drivers=$VULKAN_DRIVERS |
Eric Anholt | 78ab62b | 2016-08-18 14:10:57 -0700 | [diff] [blame] | 79 | --disable-llvm-shared-libs |
Emil Velikov | 7e2af37 | 2017-04-07 12:13:56 +0100 | [diff] [blame] | 80 | && |
Eric Engestrom | 08b70e1 | 2019-03-08 15:33:39 +0000 | [diff] [blame] | 81 | make && make check; |
Emil Velikov | abcfea2 | 2017-04-06 14:23:36 +0100 | [diff] [blame] | 82 | fi |
| 83 | |
Andres Gomez | b5b912d | 2018-02-28 23:18:59 +0200 | [diff] [blame] | 84 | - | |
| 85 | if test "x$BUILD" = xmeson; then |
Eric Engestrom | e12b0b5 | 2019-01-02 12:28:48 +0000 | [diff] [blame] | 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 |
Andres Gomez | b5b912d | 2018-02-28 23:18:59 +0200 | [diff] [blame] | 91 | |
Eric Engestrom | e12b0b5 | 2019-01-02 12:28:48 +0000 | [diff] [blame] | 92 | $LLVM_CONFIG --version |
| 93 | else |
| 94 | : > native.file |
| 95 | fi |
Emil Velikov | 81173fd | 2018-12-13 10:38:20 +0000 | [diff] [blame] | 96 | |
Andres Gomez | b5b912d | 2018-02-28 23:18:59 +0200 | [diff] [blame] | 97 | export CFLAGS="$CFLAGS -isystem`pwd`" |
Emil Velikov | 51318c3 | 2018-12-12 13:42:36 +0000 | [diff] [blame] | 98 | meson _build \ |
Dylan Baker | 31c162a | 2018-12-11 10:34:51 -0800 | [diff] [blame] | 99 | --native-file=native.file \ |
Emil Velikov | 266ae22 | 2018-12-12 13:18:54 +0000 | [diff] [blame] | 100 | -Dbuild-tests=true \ |
Emil Velikov | 51318c3 | 2018-12-12 13:42:36 +0000 | [diff] [blame] | 101 | ${DRI_LOADERS} \ |
Emil Velikov | 266ae22 | 2018-12-12 13:18:54 +0000 | [diff] [blame] | 102 | -Ddri-drivers=${DRI_DRIVERS:-[]} \ |
| 103 | -Dgallium-drivers=${GALLIUM_DRIVERS:-[]} \ |
| 104 | -Dvulkan-drivers=${VULKAN_DRIVERS:-[]} |
Emil Velikov | de72c1f | 2018-12-12 17:43:07 +0000 | [diff] [blame] | 105 | meson configure _build |
Andres Gomez | b5b912d | 2018-02-28 23:18:59 +0200 | [diff] [blame] | 106 | ninja -C _build |
Dylan Baker | 31c162a | 2018-12-11 10:34:51 -0800 | [diff] [blame] | 107 | ninja -C _build test |
Dylan Baker | df82012 | 2017-09-27 10:37:28 -0700 | [diff] [blame] | 108 | fi |