Merge pull request #4373 from Ericson2314/ipi-pec
[cabal.git] / travis-install.sh
blob32f82dde9a8d66ff7616bc84ff11d489e8692516
1 #!/bin/sh
2 set -ex
4 . ./travis-common.sh
6 if [ "$GHCVER" = "none" ]; then
7 travis_retry sudo add-apt-repository -y ppa:hvr/ghc
8 travis_retry sudo apt-get update
9 travis_retry sudo apt-get install --force-yes ghc-$GHCVER
12 if [ -z ${STACKAGE_RESOLVER+x} ]; then
13 if [ "$TRAVIS_OS_NAME" = "linux" ]; then
14 travis_retry sudo add-apt-repository -y ppa:hvr/ghc
15 travis_retry sudo apt-get update
16 travis_retry sudo apt-get install --force-yes cabal-install-1.24 happy-1.19.5 alex-3.1.7 ghc-$GHCVER-prof ghc-$GHCVER-dyn
17 if [ "x$TEST_OTHER_VERSIONS" = "xYES" ]; then travis_retry sudo apt-get install --force-yes ghc-7.0.4-prof ghc-7.0.4-dyn ghc-7.2.2-prof ghc-7.2.2-dyn ghc-head-prof ghc-head-dyn; fi
19 elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
21 case $GHCVER in
22 8.0.2)
23 GHCURL=http://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-x86_64-apple-darwin.tar.xz;
24 GHCXZ=YES
26 8.0.1)
27 GHCURL=http://downloads.haskell.org/~ghc/8.0.1/ghc-8.0.1-x86_64-apple-darwin.tar.xz;
28 GHCXZ=YES
30 7.10.3)
31 GHCURL=http://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3b-x86_64-apple-darwin.tar.xz
32 GHCXZ=YES
34 7.8.4)
35 GHCURL=https://www.haskell.org/ghc/dist/7.8.4/ghc-7.8.4-x86_64-apple-darwin.tar.xz
36 GHCXZ=YES
38 7.6.3)
39 GHCURL=https://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-x86_64-apple-darwin.tar.bz2
41 7.4.2)
42 GHCURL=https://www.haskell.org/ghc/dist/7.4.2/ghc-7.4.2-x86_64-apple-darwin.tar.bz2
45 echo "Unknown GHC: $GHCVER"
46 false
48 esac
50 travis_retry curl -OL $GHCURL
51 if [ "$GHCXZ" = "YES" ]; then
52 tar -xJf ghc-*.tar.*;
53 else
54 tar -xjf ghc-*.tar.*;
57 cd ghc-*;
58 ./configure --prefix=$HOME/.ghc-install/$GHCVER
59 make install;
60 cd ..;
62 travis_retry curl -L https://www.haskell.org/cabal/release/cabal-install-1.24.0.2/cabal-install-1.24.0.2-x86_64-apple-darwin-yosemite.tar.gz -o cabal-install.tar.gz
63 TAR=$PWD/cabal-install.tar.gz
64 mkdir "${HOME}/bin"
65 (cd "${HOME}/bin" && tar -xzf "$TAR")
66 "${HOME}/bin/cabal" --version
68 else
69 echo "Not linux or osx: $TRAVIS_OS_NAME"
70 false
73 else # Stack-based builds
74 mkdir -p ~/.local/bin
75 travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 \
76 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
77 stack setup --resolver "$STACKAGE_RESOLVER"
81 git version