diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2019-02-25 13:32:05 +0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2019-02-25 00:32:05 -0500 |
commit | 76c784340c3851f402abc38dff8fa5f008cdc4d4 (patch) | |
tree | b08f245978f3ec2e5ffa8b1ace388944500c8650 /.travis | |
parent | 01a517919ce16cc9dd75db9d02dae00a4cc390bb (diff) | |
download | cryptography-76c784340c3851f402abc38dff8fa5f008cdc4d4.tar.gz cryptography-76c784340c3851f402abc38dff8fa5f008cdc4d4.tar.bz2 cryptography-76c784340c3851f402abc38dff8fa5f008cdc4d4.zip |
support NO_ENGINE (#4763)
* support OPENSSL_NO_ENGINE
* support some new openssl config args
* sigh
Diffstat (limited to '.travis')
-rwxr-xr-x | .travis/install.sh | 6 | ||||
-rwxr-xr-x | .travis/openssl_config.sh | 13 | ||||
-rwxr-xr-x | .travis/run.sh | 11 |
3 files changed, 24 insertions, 6 deletions
diff --git a/.travis/install.sh b/.travis/install.sh index a4bc3c97..ed69e468 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -3,6 +3,8 @@ set -e set -x +SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}") + shlib_sed() { # modify the shlib version to a unique one to make sure the dynamic # linker doesn't load the system one. @@ -14,12 +16,12 @@ shlib_sed() { # download, compile, and install if it's not already present via travis # cache if [ -n "${OPENSSL}" ]; then - OPENSSL_DIR="ossl-2/${OPENSSL}" + . "$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 shared no-ssl2 no-ssl3 -fPIC --prefix="$HOME/$OPENSSL_DIR" + ./config $OPENSSL_CONFIG_FLAGS -fPIC --prefix="$HOME/$OPENSSL_DIR" shlib_sed make depend make -j"$(nproc)" diff --git a/.travis/openssl_config.sh b/.travis/openssl_config.sh new file mode 100755 index 00000000..83f16d2b --- /dev/null +++ b/.travis/openssl_config.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e +set -x + +DEFAULT_CONFIG_FLAGS="shared no-ssl2 no-ssl3" +if [ -n "${OPENSSL_CONFIG_FLAGS}" ]; then + OPENSSL_CONFIG_FLAGS="$DEFAULT_CONFIG_FLAGS $OPENSSL_CONFIG_FLAGS" +else + OPENSSL_CONFIG_FLAGS=$DEFAULT_CONFIG_FLAGS +fi +CONFIG_HASH=$(echo "$OPENSSL_CONFIG_FLAGS" | sha1sum | sed 's/ .*$//') +OPENSSL_DIR="ossl-2/${OPENSSL}${CONFIG_HASH}" diff --git a/.travis/run.sh b/.travis/run.sh index 8f8dd687..ab12ac3c 100755 --- a/.travis/run.sh +++ b/.travis/run.sh @@ -1,18 +1,21 @@ #!/bin/bash -ex +SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}") + if [[ "${TOXENV}" == "pypy" ]]; then PYENV_ROOT="$HOME/.pyenv" PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init -)" fi if [ -n "${LIBRESSL}" ]; then - OPENSSL=$LIBRESSL - export CFLAGS="-Werror -Wno-error=deprecated-declarations -Wno-error=discarded-qualifiers -Wno-error=unused-function" + LIBRESSL_DIR="ossl-2/${LIBRESSL}" + export CFLAGS="-Werror -Wno-error=deprecated-declarations -Wno-error=discarded-qualifiers -Wno-error=unused-function -I$HOME/$LIBRESSL_DIR/include" + export PATH="$HOME/$LIBRESSL_DIR/bin:$PATH" + export LDFLAGS="-L$HOME/$LIBRESSL_DIR/lib -Wl,-rpath=$HOME/$LIBRESSL_DIR/lib" fi if [ -n "${OPENSSL}" ]; then - OPENSSL_DIR="ossl-2/${OPENSSL}" - + . "$SCRIPT_DIR/openssl_config.sh" export PATH="$HOME/$OPENSSL_DIR/bin:$PATH" export CFLAGS="${CFLAGS} -I$HOME/$OPENSSL_DIR/include" # rpath on linux will cause it to use an absolute path so we don't need to |