Skip to content

Commit 5fde3a8

Browse files
author
Mitsutoshi Aoe
committed
travis: Add OSX builds
1 parent 299546b commit 5fde3a8

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

.travis.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ cache:
1414
directories:
1515
- $HOME/.cabal/packages
1616
- $HOME/.cabal/store
17+
- $HOME/Library/Caches/Homebrew
18+
- $HOME/cabal
1719

1820
before_cache:
1921
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
@@ -41,23 +43,46 @@ matrix:
4143
- compiler: "ghc-8.2.1"
4244
# env: TEST=--disable-tests BENCH=--disable-benchmarks
4345
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1,libgtk2.0-dev], sources: [hvr-ghc]}}
46+
- compiler: "ghc"
47+
os: osx
4448

4549
before_install:
4650
- HC=${CC}
4751
- unset CC
48-
- PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
52+
- PATH=$HOME/.cabal/bin:/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
4953
- PKGNAME='threadscope'
54+
- |
55+
if [ `uname` = "Darwin" ]; then
56+
brew install ghc gtk+ gtk-mac-integration
57+
pushd $HOME
58+
if [ -d cabal/.git ]; then
59+
cd cabal
60+
git fetch origin
61+
else
62+
git clone https://github.com/haskell/cabal.git
63+
fi
64+
cd $HOME/cabal/cabal-install
65+
git checkout 3751ec6
66+
NO_DOCUMENTATION=1 EXTRA_CONFIGURE_OPTS="" ./bootstrap.sh -j --sandbox
67+
mkdir -p $HOME/.cabal/bin
68+
cp -v .cabal-sandbox/bin/cabal $HOME/.cabal/bin/cabal
69+
popd
70+
fi
5071
5172
install:
5273
- cabal --version
5374
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
5475
- BENCH=${BENCH---enable-benchmarks}
5576
- TEST=${TEST---enable-tests}
5677
- travis_retry cabal update -v
57-
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
78+
- sed -i'.bak' 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
5879
- rm -fv cabal.project.local
5980
- "echo 'packages: .' > cabal.project"
6081
- rm -f cabal.project.freeze
82+
- |
83+
if [ `uname` = "Darwin" ]; then
84+
cabal new-configure --constraint="gtk +have-quartz-gtk"
85+
fi
6186
- cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
6287
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
6388

@@ -77,6 +102,10 @@ script:
77102
- "echo 'packages: .' > cabal.project"
78103
# this builds all libraries and executables (without tests/benchmarks)
79104
- rm -f cabal.project.freeze
105+
- |
106+
if [ `uname` = "Darwin" ]; then
107+
cabal new-configure --constraint="gtk +have-quartz-gtk"
108+
fi
80109
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
81110
# this builds all libraries and executables (including tests/benchmarks)
82111
# - rm -rf ./dist-newstyle

0 commit comments

Comments
 (0)