aboutsummaryrefslogtreecommitdiffstats
path: root/.travis/install.sh
diff options
context:
space:
mode:
Diffstat (limited to '.travis/install.sh')
-rwxr-xr-x.travis/install.sh104
1 files changed, 50 insertions, 54 deletions
diff --git a/.travis/install.sh b/.travis/install.sh
index a046a5d8..599eee0d 100755
--- a/.travis/install.sh
+++ b/.travis/install.sh
@@ -3,66 +3,62 @@
set -e
set -x
-if [[ "$(uname -s)" == 'Darwin' ]]; then
- brew update || brew update
+SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
- if [[ "${OPENSSL}" != "0.9.8" ]]; then
- brew outdated openssl || brew upgrade openssl
- fi
+shlib_sed() {
+ # modify the shlib version to a unique one to make sure the dynamic
+ # linker doesn't load the system one.
+ sed -i "s/^SHLIB_MAJOR=.*/SHLIB_MAJOR=100/" Makefile
+ sed -i "s/^SHLIB_MINOR=.*/SHLIB_MINOR=0.0/" Makefile
+ sed -i "s/^SHLIB_VERSION_NUMBER=.*/SHLIB_VERSION_NUMBER=100.0.0/" Makefile
+}
- if which pyenv > /dev/null; then
- eval "$(pyenv init -)"
+# download, compile, and install if it's not already present via travis
+# cache
+if [ -n "${OPENSSL}" ]; then
+ . "$SCRIPT_DIR/openssl_config.sh"
+ if [[ ! -f "$HOME/$OPENSSL_DIR/bin/openssl" ]]; then
+ curl -O "https://www.openssl.org/source/openssl-${OPENSSL}.tar.gz"
+ tar zxf "openssl-${OPENSSL}.tar.gz"
+ pushd "openssl-${OPENSSL}"
+ ./config $OPENSSL_CONFIG_FLAGS -fPIC --prefix="$HOME/$OPENSSL_DIR"
+ shlib_sed
+ make depend
+ make -j"$(nproc)"
+ # avoid installing the docs
+ # https://github.com/openssl/openssl/issues/6685#issuecomment-403838728
+ make install_sw install_ssldirs
+ popd
+ fi
+elif [ -n "${LIBRESSL}" ]; then
+ LIBRESSL_DIR="ossl-2/${LIBRESSL}"
+ if [[ ! -f "$HOME/$LIBRESSL_DIR/bin/openssl" ]]; then
+ curl -O "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${LIBRESSL}.tar.gz"
+ tar zxf "libressl-${LIBRESSL}.tar.gz"
+ pushd "libressl-${LIBRESSL}"
+ ./config -Wl -Wl,-Bsymbolic-functions -fPIC shared --prefix="$HOME/$LIBRESSL_DIR"
+ shlib_sed
+ make -j"$(nproc)" install
+ popd
fi
+fi
- 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)
- brew outdated pyenv || brew upgrade pyenv
- pyenv install 3.3.6
- pyenv global 3.3.6
- ;;
- py34)
- brew outdated pyenv || brew upgrade pyenv
- pyenv install 3.4.2
- pyenv global 3.4.2
- ;;
- pypy)
- brew outdated pyenv || brew upgrade pyenv
- pyenv install pypy-2.6.0
- pyenv global pypy-2.6.0
- ;;
- pypy3)
- brew outdated pyenv || brew upgrade pyenv
- 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 pypy-2.6 before container infra upgrade
- 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-2.6.0
- pyenv global pypy-2.6.0
+if [ -n "${DOCKER}" ]; then
+ if [ -n "${OPENSSL}" ] || [ -n "${LIBRESSL}" ]; then
+ echo "OPENSSL and LIBRESSL are not allowed when DOCKER is set."
+ exit 1
fi
- pip install virtualenv
+ docker pull "$DOCKER" || docker pull "$DOCKER" || docker pull "$DOCKER"
fi
+if [ -z "${DOWNSTREAM}" ]; then
+ git clone --depth=1 https://github.com/google/wycheproof "$HOME/wycheproof"
+fi
+
+pip install -U pip
+pip install virtualenv
+
python -m virtualenv ~/.venv
source ~/.venv/bin/activate
-pip install tox coveralls
+# If we pin coverage it must be kept in sync with tox.ini and .github/workflows/ci.yml
+pip install tox coverage