From 4da190355beb6c5ab1e4025304590ee05f8ee6d3 Mon Sep 17 00:00:00 2001 From: Mirko Galimberti Date: Mon, 30 Dec 2024 23:21:12 +0100 Subject: [PATCH] Add check (and add fallback) for `python3` cmd availability on linux dependencies build script (#8968) --- tools/build_linux_dependencies.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/build_linux_dependencies.sh b/tools/build_linux_dependencies.sh index 29534b28bf..46559646a9 100755 --- a/tools/build_linux_dependencies.sh +++ b/tools/build_linux_dependencies.sh @@ -61,7 +61,14 @@ mkdir kivy-dependencies/dist # Build the dependencies pushd kivy-dependencies/build -IS_RPI=$(python3 -c "import platform; print('1' if 'raspberrypi' in platform.uname() else '0')") +# Check if "python3" exists, otherwise use "python" as fallback (which is the case for manylinux) +if command -v python3 &> /dev/null; then + PYTHON_EXECUTABLE=python3 +else + PYTHON_EXECUTABLE=python +fi + +IS_RPI=$($PYTHON_EXECUTABLE -c "import platform; print('1' if 'raspberrypi' in platform.uname() else '0')") if [ "$(dpkg --print-architecture)" = "armhf" ]; then IS_ARMHF=1 else