Fix dependencies build for Raspberry Pi 32-bit OSes (#8913)

This commit is contained in:
Mirko Galimberti 2024-11-09 14:44:58 +01:00 committed by GitHub
parent 3b744c7ed2
commit 6aa77eec1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 25 additions and 8 deletions

View File

@ -61,6 +61,13 @@ mkdir kivy-dependencies/dist
# Build the dependencies # Build the dependencies
pushd kivy-dependencies/build pushd kivy-dependencies/build
IS_RPI=`python -c "import platform; print('1' if 'raspberrypi' in platform.uname() else '0')"`
if [ "$(dpkg --print-architecture)" = "armhf" ]; then
IS_ARMHF=1
else
IS_ARMHF=0
fi
echo "-- Build SDL2" echo "-- Build SDL2"
pushd $MANYLINUX__SDL2__FOLDER pushd $MANYLINUX__SDL2__FOLDER
cmake -S . -B build \ cmake -S . -B build \
@ -87,13 +94,23 @@ popd
echo "-- Build SDL2_mixer" echo "-- Build SDL2_mixer"
pushd $MANYLINUX__SDL2_MIXER__FOLDER pushd $MANYLINUX__SDL2_MIXER__FOLDER
./external/download.sh; ./external/download.sh;
cmake -B build -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_BUILD_TYPE=Release \ sdl2_mixer_builds_args=(
-DSDL2MIXER_MOD_XMP=ON \ -DCMAKE_POSITION_INDEPENDENT_CODE="ON"
-DSDL2MIXER_MOD_XMP_SHARED=OFF \ -DCMAKE_BUILD_TYPE="Release"
-DCMAKE_INSTALL_PREFIX=../../dist \ -DSDL2MIXER_MOD_XMP="ON"
-DSDL2MIXER_VENDORED=ON \ -DSDL2MIXER_MOD_XMP_SHARED="OFF"
-DCMAKE_INSTALL_PREFIX="../../dist"
-DSDL2MIXER_VENDORED="ON"
-GNinja -GNinja
)
# if platform is rpi or cross-compiling for rpi, we need to set additional flags
if { [ "$IS_RPI" = "1" ] && [ "$IS_ARMHF" = "1" ]; } || [ "$KIVY_CROSS_PLATFORM" = "rpi" ]; then
sdl2_mixer_builds_args+=(-DCMAKE_C_FLAGS="-mfpu=neon-fp-armv8")
fi
cmake -B build "${sdl2_mixer_builds_args[@]}"
cmake --build build/ --config Release --parallel --verbose cmake --build build/ --config Release --parallel --verbose
cmake --install build/ --config Release cmake --install build/ --config Release
popd popd
@ -103,7 +120,7 @@ pushd $MANYLINUX__SDL2_IMAGE__FOLDER
./external/download.sh; ./external/download.sh;
# If KIVY_CROSS_PLATFORM is set to rpi, we need to build libwebp version 1.2.4, # If KIVY_CROSS_PLATFORM is set to rpi, we need to build libwebp version 1.2.4,
# as previous versions have issues with NEON and ARMv7. # as previous versions have issues with NEON and ARMv7.
if [ "$KIVY_CROSS_PLATFORM" = "rpi" ]; then if [ "$IS_RPI" = "1" ] || [ "$KIVY_CROSS_PLATFORM" = "rpi" ]; then
pushd external/libwebp pushd external/libwebp
git checkout 1.2.4 git checkout 1.2.4
popd popd