diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index 20b17342..7d0b2a16 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -1420,7 +1420,7 @@ use_freebsd_pkg() { # check if FreeBSD if [ "FreeBSD" = "$(uname -s)" ]; then # use openssl if installed from Ports Collection - if [ -f /usr/local/include/openssl/ssl.h ]; then + if pkg info -e openssl; then package_option python configure --with-openssl="/usr/local" fi diff --git a/plugins/python-build/test/build.bats b/plugins/python-build/test/build.bats index 76a6b6a5..8a0dee1c 100644 --- a/plugins/python-build/test/build.bats +++ b/plugins/python-build/test/build.bats @@ -259,6 +259,38 @@ make install OUT } +@test "openssl is linked from Ports in FreeBSD if present" { + cached_tarball "Python-3.6.2" + + for i in {1..7}; do stub uname '-s : echo FreeBSD'; done + stub uname '-r : echo 11.0-RELEASE' + for i in {1..2}; do stub uname '-s : echo FreeBSD'; done + stub sysctl '-n hw.ncpu : echo 1' + + stub pkg "info -e openssl : true" + for in in {1..2}; do stub pkg false; done + + stub_make_install + + export -n MAKE_OPTS + run_inline_definition <