Travis: Improve Python configuration on macOS
We now only add the configuration for the Python bindings if both
`python2` and `python3` are available.
@@ -246,7 +246,7 @@ before_script:
- mkdir build
- cd build
- |
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$HASKELL" != "ON" ]]; then
+ if [[ "$TRAVIS_OS_NAME" == "osx" ]] && which -s python2 && which -s python3; then
python2_ver=$(python2 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))') && \
CMAKE_OPT+=("-DPYTHON2_INCLUDE_DIR:PATH=$(python2-config --prefix)/include/python${python2_ver}") && \
CMAKE_OPT+=("-DPYTHON2_LIBRARY:FILEPATH=$(python2-config --prefix)/lib/libpython${python2_ver}.dylib") && \
