From dda597efb3a6f3a429a5c06579848e9db1b4e499 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 16 Mar 2019 21:17:43 +0100 Subject: [PATCH] macOS: prefer homebrew openssl 1.1.x over 1.0.x, see #839 previously, it was not possibly to compile a python with homebrew openssl 1.1 because the code always queried "openssl" and ignored "openssl@1.1". now, if 1.1 is installed, it is used to compile python and only if it is not, 1.0 is checked and used. --- plugins/python-build/bin/python-build | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index 5560a560..4dc56d84 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -1492,15 +1492,20 @@ has_broken_mac_openssl() { } use_homebrew_openssl() { - local ssldir="$(brew --prefix openssl 2>/dev/null || true)" - if [ -d "$ssldir" ]; then - echo "python-build: use openssl from homebrew" - export PKG_CONFIG_PATH="$ssldir/lib/pkgconfig/:${PKG_CONFIG_PATH}" - export CPPFLAGS="-I$ssldir/include ${CPPFLAGS}" - export LDFLAGS="-L$ssldir/lib ${LDFLAGS}" + local ssl11dir="$(brew --prefix openssl@1.1 2>/dev/null || true)" + local ssl10dir="$(brew --prefix openssl 2>/dev/null || true)" + if [ -d "$ssl11dir" ]; then + echo "python-build: use openssl 1.1 from homebrew" + local ssldir=$ssl11dir + elif [ -d "$ssl10dir" ]; then + echo "python-build: use openssl 1.0 from homebrew" + local ssldir=$ssl10dir else return 1 fi + export PKG_CONFIG_PATH="$ssldir/lib/pkgconfig/:${PKG_CONFIG_PATH}" + export CPPFLAGS="-I$ssldir/include ${CPPFLAGS}" + export LDFLAGS="-L$ssldir/lib ${LDFLAGS}" } build_package_mac_openssl() {