aboutsummaryrefslogtreecommitdiffstats
path: root/.travis/install.sh
blob: 59f9769a09fa7cae8e365874028b753c56572876 (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
#!/bin/bash

set -e
set -x

if [[ "$(uname -s)" == 'Darwin' ]]; then
    brew update || brew update

    brew outdated openssl || brew upgrade openssl

    # install pyenv
    git clone https://github.com/yyuu/pyenv.git ~/.pyenv
    PYENV_ROOT="$HOME/.pyenv"
    PATH="$PYENV_ROOT/bin:$PATH"
    eval "$(pyenv init -)"

    case "${TOXENV}" in
        py26)
            curl -O https://bootstrap.pypa.io/get-pip.py
            python get-pip.py --user
            ;;
        py27)
            curl -O https://bootstrap.pypa.io/get-pip.py
            python get-pip.py --user
            ;;
        py33)
            pyenv install 3.3.6
            pyenv global 3.3.6
            ;;
        py34)
            pyenv install 3.4.4
            pyenv global 3.4.4
            ;;
        py35)
            pyenv install 3.5.1
            pyenv global 3.5.1
            ;;
        pypy)
            pyenv install pypy-4.0.1
            pyenv global pypy-4.0.1
            ;;
        pypy3)
            pyenv install pypy3-2.4.0
            pyenv global pypy3-2.4.0
            ;;
        docs)
            curl -O https://bootstrap.pypa.io/get-pip.py
            python get-pip.py --user
            ;;
    esac
    pyenv rehash
    python -m pip install --user virtualenv
else
    # temporary pyenv installation to get latest pypy before container infra upgrade
    # now using the -latest because of a segfault bug we're encountering in 2.6.1
    if [[ "${TOXENV}" == "pypy" ]]; then
        git clone https://github.com/yyuu/pyenv.git ~/.pyenv
        PYENV_ROOT="$HOME/.pyenv"
        PATH="$PYENV_ROOT/bin:$PATH"
        eval "$(pyenv init -)"
        pyenv install pypy-4.0.1
        pyenv global pypy-4.0.1
    fi
    if [[ "${OPENSSL}" == "0.9.8" ]]; then
      # download, compile, and install if it's not already present via travis cache
      if [[ ! -f "$HOME/ossl-098/bin/openssl" ]]; then
        curl -O https://www.openssl.org/source/openssl-0.9.8zh.tar.gz
        tar zxvf openssl-0.9.8zh.tar.gz
        cd openssl-0.9.8zh
        echo "OPENSSL_0.9.8ZH_CUSTOM {
            global:
              *;
        };" > openssl.ld
        ./config no-ssl2 -Wl,--version-script=openssl.ld -Wl,-Bsymbolic-functions -fPIC shared --prefix=$HOME/ossl-098
        make depend
        make install
      fi
      export PATH="$HOME/ossl-098/bin:$PATH"
      export CFLAGS="-I$HOME/ossl-098/include"
      export LDFLAGS="-L$HOME/ossl-098/lib"
      export LD_LIBRARY_PATH="$HOME/ossl-098/lib"
    fi
    pip install virtualenv
fi

python -m virtualenv ~/.venv
source ~/.venv/bin/activate
pip install tox codecov