Skip to content

Commit

Permalink
CI/darwin test: find installed openssl (homebrew)
Browse files Browse the repository at this point in the history
  • Loading branch information
ysbaddaden committed Jan 1, 2019
1 parent 865a3a7 commit c894e3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions bin/ci
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ format() {
prepare_build() {
on_linux verify_linux_environment

on_osx brew install crystal
on_osx brew install crystal pkg-config

# Make sure binaries from llvm are available in PATH
on_osx brew install jq
Expand All @@ -112,6 +112,9 @@ with_build_env() {
# Ensure non GMT timezone
export TZ="America/New_York"

# ensure to find recent openssl version (may be removed on macOS 10.13 ?):
on_osx export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

on_linux verify_linux_environment

export DOCKER_TEST_PREFIX="crystallang/crystal:0.27.0"
Expand All @@ -138,7 +141,6 @@ with_build_env() {
on_osx PATH="/usr/local/opt/llvm/bin:\$PATH" \
CRYSTAL_CACHE_DIR="/tmp/crystal" \
/bin/sh -c "'$command'"

}

usage() {
Expand Down
4 changes: 2 additions & 2 deletions src/openssl/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
CFLAGS=`command -v pkg-config > /dev/null && pkg-config --cflags --silence-errors $1 || true`

# extract version numbers from OpenSSL/LibreSSL C headers:
LIBRESSL_VERSION_NUMBER=$(printf "#include <openssl/opensslv.h>\nLIBRESSL_VERSION_NUMBER" | ${CC:-cc} $CFLAGS -E - 2> /dev/null | tail -n 1)
OPENSSL_VERSION_NUMBER=$(printf "#include <openssl/opensslv.h>\nOPENSSL_VERSION_NUMBER" | ${CC:-cc} $CFLAGS -E - 2> /dev/null | tail -n 1)
LIBRESSL_VERSION_NUMBER=$(printf "#include <openssl/opensslv.h>\nLIBRESSL_VERSION_NUMBER" | ${CC:-cc} $CFLAGS -E - | tail -n 1)
OPENSSL_VERSION_NUMBER=$(printf "#include <openssl/opensslv.h>\nOPENSSL_VERSION_NUMBER" | ${CC:-cc} $CFLAGS -E - | tail -n 1)

if [ $LIBRESSL_VERSION_NUMBER = LIBRESSL_VERSION_NUMBER ]; then
# detected OpenSSL:
Expand Down

0 comments on commit c894e3c

Please sign in to comment.