Skip to content

Commit

Permalink
setting envionment variables via matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
lordofhyphens committed Jul 12, 2018
1 parent 3097a07 commit 1fd6558
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 36 deletions.
13 changes: 9 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
os:
- linux
- osx
language: c++
before_install:
- sh package/linux/travis-decrypt-key
install:
Expand Down Expand Up @@ -51,6 +47,15 @@ notifications:
dist: trusty
env:
matrix:
include:
- os: linux
language: c++
env: CXX=g++-7
env: CX=gcc-7
env: WXVERSION=pkg
- os: osx
language: c++
env: WXVERSION=pkg
global:
- secure: eEVRZNMv7FM6jrOU9iAFkDhWxFQ1WtHBEaObImcvtFUxy6vWSt3ehFFeTRouj3uHQAnbvUzziDyvPPm8/95alv5g/du8ML6YzzqKBKfazM0xQ7SF6R2DQL8lfFIp+RSV7T02byEP1f1g7Zva7xH9szIlDcSfU0pXW4KWbkBFMd8=
- secure: gj338h+qHGccTD/VQFmEJkqdg2McIe2pO0iZ4Ae9BvY5vxkIML4BpoYZQXQTqiAOETnUjlcknY9lx0hI/PfkDD9MSJc5BC/3fMYRCu3SgAclEwklWf9vvtodUeT69mtnZuw1zze1nTbExuOw2mepbqFjxKKMl+9l5oCz4O54fXU=
Expand Down
64 changes: 32 additions & 32 deletions package/linux/travis-setup.sh
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
#!/bin/bash
# Script to configure travis environment prior to build
WXVERSION=302
CACHE=$HOME/cache
mkdir -p $CACHE
if [ $TRAVIS_OS_NAME == "linux" ]; then
export WXDIR=$HOME/wx${WXVERSION}
if [ ! -e $CACHE/boost-compiled.tar.bz2 ]; then
echo "Downloading http://www.siusgs.com/slic3r/buildserver/boost_1_63_0.built.gcc-4.9.4-buildserver.tar.bz2 => $CACHE/boost-compiled.tar.bz2"
curl -L "http://www.siusgs.com/slic3r/buildserver/boost_1_63_0.built.gcc-4.9.4-buildserver.tar.bz2" -o $CACHE/boost-compiled.tar.bz2
fi
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [[ "$WXVERSION" -neq "pkg" ]]; then
export WXDIR=$HOME/wx${WXVERSION}
if [ ! -e $CACHE/boost-compiled.tar.bz2 ]; then
echo "Downloading http://www.siusgs.com/slic3r/buildserver/boost_1_63_0.built.gcc-4.9.4-buildserver.tar.bz2 => $CACHE/boost-compiled.tar.bz2"
curl -L "http://www.siusgs.com/slic3r/buildserver/boost_1_63_0.built.gcc-4.9.4-buildserver.tar.bz2" -o $CACHE/boost-compiled.tar.bz2
fi

if [ ! -e $CACHE/wx${WXVERSION}.tar.bz2 ]; then
echo "Downloading http://www.siusgs.com/slic3r/buildserver/wx${WXVERSION}-libs.tar.bz2 => $CACHE/wx${WXVERSION}.tar.bz2"
curl -L "http://www.siusgs.com/slic3r/buildserver/wx${WXVERSION}-libs.tar.bz2" -o $CACHE/wx${WXVERSION}.tar.bz2
if [ ! -e $CACHE/wx${WXVERSION}.tar.bz2 ]; then
echo "Downloading http://www.siusgs.com/slic3r/buildserver/wx${WXVERSION}-libs.tar.bz2 => $CACHE/wx${WXVERSION}.tar.bz2"
curl -L "http://www.siusgs.com/slic3r/buildserver/wx${WXVERSION}-libs.tar.bz2" -o $CACHE/wx${WXVERSION}.tar.bz2
fi

tar -C$HOME -xjf $CACHE/boost-compiled.tar.bz2
tar -C$HOME -xjf $CACHE/wx${WXVERSION}.tar.bz2
fi

tar -C$HOME -xjf $CACHE/boost-compiled.tar.bz2
tar -C$HOME -xjf $CACHE/wx${WXVERSION}.tar.bz2

# Set some env variables specific to Travis Linux
export CXX=g++-7
export CC=gcc-7
elif [ $TRAVIS_OS_NAME == "osx" ]; then
WXVERSION=311
WXVER_EXPANDED=${WXVERSION:0:1}.${WXVERSION:1:1}.${WXVERSION:2:1}
export WXDIR=$HOME/wx${WXVERSION}
if [ ! -e $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2 ]; then
curl -L "https://github.com/wxWidgets/wxWidgets/releases/download/v${WXVER_EXPANDED}/wxWidgets-${WXVER_EXPANDED}.tar.bz2" -o $HOME/wx${WXVERSION}-src.tar.bz2
tar -C$HOME -xjf $HOME/wx${WXVERSION}-src.tar.bz2
mkdir $WXDIR
cd $HOME/$WXDIR && cmake $HOME/wxWidgets-${WXVER_EXPANDED} -DwxBUILD_SHARED=OFF
cmake --build . --target -- -j4
tar -C$HOME -cjf $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2 $(basename ${WXDIR})
else
tar -C$HOME -xjf $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ "$WXVERSION" -neq "pkg" ]]; then
WXVER_EXPANDED=${WXVERSION:0:1}.${WXVERSION:1:1}.${WXVERSION:2:1}
export WXDIR=$HOME/wx${WXVERSION}
if [ ! -e $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2 ]; then
curl -L "https://github.com/wxWidgets/wxWidgets/releases/download/v${WXVER_EXPANDED}/wxWidgets-${WXVER_EXPANDED}.tar.bz2" -o $HOME/wx${WXVERSION}-src.tar.bz2
tar -C$HOME -xjf $HOME/wx${WXVERSION}-src.tar.bz2
mkdir $WXDIR
cd $HOME/$WXDIR && cmake $HOME/wxWidgets-${WXVER_EXPANDED} -DwxBUILD_SHARED=OFF
cmake --build . --target -- -j4
tar -C$HOME -cjf $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2 $(basename ${WXDIR})
else
tar -C$HOME -xjf $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2
fi
export PATH=${PATH}:${WXDIR}
cd $TRAVIS_BUILD_DIR # go back to the build dir
else
brew install wxmac # install via homebrew
fi
export PATH=${PATH}:${WXDIR}
cd $TRAVIS_BUILD_DIR # go back to the build dir
brew install wxmac # install via homebrew
fi

0 comments on commit 1fd6558

Please sign in to comment.