Skip to content

Commit

Permalink
travis-ci config and build scripts for Ubuntu 14.04 and macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwa committed Oct 13, 2016
1 parent 1658547 commit ebab9b6
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: cpp
matrix:
include:
- os: linux
dist: trusty
sudo: required
- os: osx
script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./travis-macos.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./travis-linux.sh; fi
32 changes: 32 additions & 0 deletions travis-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

set -o verbose

sudo apt-get -qq update
sudo apt-get -y install libgtk2.0-dev freeglut3 freeglut3-dev libglew-dev mesa-common-dev build-essential libglm-dev libxxf86vm-dev libfreeimage-dev pandoc cmake p7zip-full ninja-build xvfb

# Patch and build wxWidgets

wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.0/wxWidgets-3.1.0.7z
if [[ "daf03ed0006e41334f10ceeb3aa2d20c63aacd42" != $(sha1sum wxWidgets-3.1.0.7z | cut -f1 -d' ') ]] ; then exit 1 ; fi
7z x -o"wxWidgets" -y wxWidgets-3.1.0.7z > /dev/null
cd wxWidgets || exit 1
patch -p0 < ../patches/wxWidgets/*.patch || exit 1
mkdir build-debug
cd build-debug
../configure --quiet --enable-debug --with-opengl --with-gtk=2 --prefix=$(pwd)/install --disable-precomp-headers && make -j2 && make install
cd ..
cd ..

# Build TB

mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_PREFIX=$(pwd)/../wxWidgets/build-debug/install || exit 1
ninja TrenchBroom-Test || exit 1

# Run tests (wxgtk needs an X server running for the app to initialize)

Xvfb :10 &
export DISPLAY=:10
./TrenchBroom-Test
27 changes: 27 additions & 0 deletions travis-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -o verbose

brew update
brew install cmake ninja p7zip

# Patch and build wxWidgets

wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.0/wxWidgets-3.1.0.7z
if [[ "daf03ed0006e41334f10ceeb3aa2d20c63aacd42" != $(openssl sha1 wxWidgets-3.1.0.7z | cut -f2 -d' ') ]] ; then exit 1 ; fi
7z x -o"wxWidgets" -y wxWidgets-3.1.0.7z > /dev/null
cd wxWidgets || exit 1
patch -p0 < ../patches/wxWidgets/*.patch || exit 1
mkdir build-debug
cd build-debug
../configure --quiet --enable-debug --with-osx_cocoa --with-opengl --with-macosx-version-min=10.6 --prefix=$(pwd)/install --disable-precomp-headers && make -j2 && make install
cd ..
cd ..

# Build TB

mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_PREFIX=$(pwd)/../wxWidgets/build-debug/install || exit 1
ninja TrenchBroom-Test || exit 1
./TrenchBroom-Test

0 comments on commit ebab9b6

Please sign in to comment.