PY_SITE_PACKAGES_PATH=$(python$PY_MAJOR_VER-c'import os,site,re;print([path for path in site.getsitepackages() if re.match(".*"+os.path.sep+"site-packages$", path) and os.path.exists(path) ][0])')
# on fedora python package path are suffixed by site-packages, on ubuntu it's rather dist-packages (TODO: on centos ? on debian ?)
PY_SITE_PACKAGES_PATH=$(python$PY_MAJOR_VER-c'import os,site,re;print([path for path in site.getsitepackages() if (re.match(".*"+os.path.sep+"site-packages$", path) or re.match(".*"+os.path.sep+"dist-packages$", path)) and os.path.exists(path) ][0])')
[[!-d${PY_SITE_PACKAGES_PATH}]]&&echo-e"\033[1mWARNING\033[0m: couldn't link the Faust py wrapper for python$PY_MAJOR_VER to your system. Either python$PY_MAJOR_VER is not installed on your system and that's pretty normal or it failed for another reason and you'll have to add Faust to your PYTHONPATH manually for using it (see the documentation).">&2 &&return 1
[[!"$PY_MAJOR_MINOR_VER"= 3.$SUPPORTED_PY3]]&&echo-e"\033[1mWARNING\033[0m: your python3 version ($PY_MAJOR_MINOR_VER) is not supported by Faust (only 3.$SUPPORTED_PY3 is supported). Please rely on Faust for python2."&&return 2 || PYFILES+=" ${FAUST_PY_WRAPPER_PATH}/FaustCorePy.cpython-3${SUPPORTED_PY3}m-x86_64-linux-gnu.so"
[[$PYLINKS_FAIL_COUNT= 0 ]]&&echo-e"\033[1mNOTICE\033[0m: Linked py wrapper for python$PY_MAJOR_VER into ${PY_SITE_PACKAGES_PATH}. Installation's ok for python$PY_MAJOR_MINOR_VER."
}
for V in 2 3
...
...
@@ -28,5 +45,5 @@ do
which python$V 2>&1 > /dev/null && link_py_files $V
done
exit 0# to avoid exit failure result when only one version of py is found (or it'll make the macOS installer fail)