Skip to content

Commit

Permalink
Merge branch 'fix-brew-autodetection'
Browse files Browse the repository at this point in the history
* fix-brew-autodetection:
  ci: fix cmake build w/o OPENSSL_ROOT_DIR
  ci: remove separate build for BREW_AUTODETECT_OPENSSL (use it by default)
  autotools: fix autodetection of openssl location via brew
  • Loading branch information
azat committed Jul 9, 2022
2 parents d881d06 + a9441ed commit 8bcbec7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
- TEST_EXPORT_STATIC
- TEST_EXPORT_SHARED
- OPENSSL_1_1
- BREW_AUTODETECT_OPENSSL

steps:
- uses: actions/[email protected]
Expand All @@ -53,12 +52,10 @@ jobs:
- name: Build
shell: bash
run: |
if [ "${{ matrix.EVENT_MATRIX }}" == "BREW_AUTODETECT_OPENSSL" ]; then
# use autodetection via brew
:
elif [ "${{ matrix.EVENT_MATRIX }}" == "OPENSSL_1_1" ]; then
if [ "${{ matrix.EVENT_MATRIX }}" == "OPENSSL_1_1" ]; then
export OPENSSL_ROOT_DIR=/usr/local/opt/[email protected]
else
# NOTE: cmake does not support autodetection of OPENSSL_ROOT_DIR via brew
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl
fi
Expand Down Expand Up @@ -132,7 +129,6 @@ jobs:
- DISABLE_DEBUG_MODE
- DISABLE_MM_REPLACEMENT
- OPENSSL_1_1
- BREW_AUTODETECT_OPENSSL

steps:
- uses: actions/[email protected]
Expand All @@ -149,13 +145,8 @@ jobs:
- name: Build
shell: bash
run: |
if [ "${{ matrix.EVENT_MATRIX }}" == "BREW_AUTODETECT_OPENSSL" ]; then
# use autodetection via brew
:
elif [ "${{ matrix.EVENT_MATRIX }}" == "OPENSSL_1_1" ]; then
if [ "${{ matrix.EVENT_MATRIX }}" == "OPENSSL_1_1" ]; then
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig:$PKG_CONFIG_PATH"
else
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH"
fi
export CPPFLAGS="-I/usr/local/opt/mbedtls@2/include"
export LDFLAGS="-L/usr/local/opt/mbedtls@2/lib"
Expand Down
7 changes: 7 additions & 0 deletions m4/libevent_openssl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ AC_DEFUN([LIBEVENT_OPENSSL], [
m4_ifndef([PKG_PROG_PKG_CONFIG], [AC_MSG_ERROR([PKG_PROG_PKG_CONFIG not found. Please install pkg-config and re-run autogen.sh])])
PKG_PROG_PKG_CONFIG([0.15.0])
AC_PROG_GREP
case "$host_os" in
darwin*)
Expand All @@ -14,6 +15,12 @@ case "$host_os" in
AC_CHECK_PROG([BREW],brew, brew)
if test x$BREW = xbrew; then
openssl_prefix=$($BREW --prefix openssl 2>/dev/null)
dnl CI workers has only [email protected],
dnl while default is openssl@3, see
dnl https://github.com/Homebrew/brew/issues/12879
if ! test -d $openssl_prefix; then
openssl_prefix=$($BREW --prefix $($BREW list | $GREP -m1 openssl) 2>/dev/null)
fi
if test x$openssl_prefix != x; then
OPENSSL_LIBS=`$PKG_CONFIG --libs openssl 2>/dev/null`
case "$OPENSSL_LIBS" in
Expand Down

0 comments on commit 8bcbec7

Please sign in to comment.