aboutsummaryrefslogtreecommitdiffstats
path: root/.travis/run.sh
blob: 23b9e89e03d5912f239534eb1e8ffcb0bbc0fe9d (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
#!/bin/bash

set -e
set -x

if [[ "$(uname -s)" == "Darwin" ]]; then
    # initialize our pyenv
    PYENV_ROOT="$HOME/.pyenv"
    PATH="$PYENV_ROOT/bin:$PATH"
    eval "$(pyenv init -)"

    # set our flags to use homebrew openssl
    # if the build is static we need different LDFLAGS
    if [[ "${CRYPTOGRAPHY_OSX_NO_LINK_FLAGS}" == "1" ]]; then
        export LDFLAGS="/usr/local/opt/openssl/lib/libssl.a /usr/local/opt/openssl/lib/libcrypto.a"
    else
        export LDFLAGS="-L/usr/local/opt/openssl/lib"
    fi
    export CFLAGS="-I/usr/local/opt/openssl/include"
else
    if [[ "${TOXENV}" == "pypy" ]]; then
        PYENV_ROOT="$HOME/.pyenv"
        PATH="$PYENV_ROOT/bin:$PATH"
        eval "$(pyenv init -)"
    fi
    if [[ "${OPENSSL}" == "0.9.8" ]]; then
      export PATH="$HOME/ossl-098l/bin:$PATH"
      export CFLAGS="-I$HOME/ossl-098l/include"
      export LDFLAGS="-L$HOME/ossl-098l/lib"
      export LD_LIBRARY_PATH="$HOME/ossl-098l/lib"
    fi
fi
source ~/.venv/bin/activate
tox -- $TOX_FLAGS
# Output information about linking of the OpenSSL library on OS X
if [[ "$(uname -s)" == "Darwin" ]]; then
    otool -L `find .tox -name _openssl*.so`
fi