summaryrefslogtreecommitdiffstats
path: root/.travis.yml
blob: 382c2efcf76bdd1a2aad1228d742c5bfdef0d837 (plain)
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
language: c

dist: xenial

cache:
  ccache: true

env:
  global:
    - PKG_CONFIG_PATH="$PKG_CONFIG_PATH"

matrix:
  include:
    - env:
        - LABEL="macOS make"
        - BUILD=make
        - DRI_LOADERS="--with-platforms=x11 --disable-egl"
      os: osx
    - env:
        - LABEL="macOS meson"
        - BUILD=meson
        - DRI_LOADERS="-Dplatforms=x11"
      os: osx

before_install:
  - |
    if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
      HOMEBREW_NO_AUTO_UPDATE=1 brew install python3 ninja expat gettext
      # Set PATH for homebrew pip3 installs
      PATH="$HOME/Library/Python/3.6/bin:${PATH}"
      # Set PKG_CONFIG_PATH for keg-only expat
      PKG_CONFIG_PATH="/usr/local/opt/expat/lib/pkgconfig:${PKG_CONFIG_PATH}"
      # Set PATH for keg-only gettext
      PATH="/usr/local/opt/gettext/bin:${PATH}"

      # Install xquartz for prereqs ...
      XQUARTZ_VERSION="2.7.11"
      wget -nv https://dl.bintray.com/xquartz/downloads/XQuartz-${XQUARTZ_VERSION}.dmg
      hdiutil attach XQuartz-${XQUARTZ_VERSION}.dmg
      sudo installer -pkg /Volumes/XQuartz-${XQUARTZ_VERSION}/XQuartz.pkg -target /
      hdiutil detach /Volumes/XQuartz-${XQUARTZ_VERSION}
      # ... and set paths
      PATH="/opt/X11/bin:${PATH}"
      PKG_CONFIG_PATH="/opt/X11/share/pkgconfig:/opt/X11/lib/pkgconfig:${PKG_CONFIG_PATH}"
      ACLOCAL="aclocal -I /opt/X11/share/aclocal -I /usr/local/share/aclocal"
    fi

install:
  # Install a more modern meson from pip, since the version in the
  # ubuntu repos is often quite old.
  - if test "x$BUILD" = xmeson; then
      pip3 install --user meson;
      pip3 install --user mako;
    fi

  # Install autotools build dependencies
  - if test "x$BUILD" = xmake; then
      pip2 install --user mako;
    fi

  # Install dependencies where we require specific versions (or where
  # disallowed by Travis CI's package whitelisting).

script:
  - if test "x$BUILD" = xmake; then
      export CFLAGS="$CFLAGS -isystem`pwd`";
      export MAKEFLAGS="-j4";

      mkdir build &&
      cd build &&
      ../autogen.sh
        --enable-autotools
        --enable-debug
        $DRI_LOADERS
        --with-dri-drivers=$DRI_DRIVERS
        --with-gallium-drivers=$GALLIUM_DRIVERS
        --with-vulkan-drivers=$VULKAN_DRIVERS
        --disable-llvm-shared-libs
        &&
      make && make check;
    fi

  - |
    if test "x$BUILD" = xmeson; then
      if test -n "$LLVM_CONFIG"; then
        # We need to control the version of llvm-config we're using, so we'll
        # generate a native file to do so. This requires meson >=0.49
        #
        echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file

        $LLVM_CONFIG --version
      else
        : > native.file
      fi

      export CFLAGS="$CFLAGS -isystem`pwd`"
      meson _build \
                   --native-file=native.file \
                   -Dbuild-tests=true \
                   ${DRI_LOADERS} \
                   -Ddri-drivers=${DRI_DRIVERS:-[]} \
                   -Dgallium-drivers=${GALLIUM_DRIVERS:-[]} \
                   -Dvulkan-drivers=${VULKAN_DRIVERS:-[]}
      meson configure _build
      ninja -C _build
      ninja -C _build test
    fi