Skip to content

Commit

Permalink
Fix dependencies build for RaspberryPi
Browse files Browse the repository at this point in the history
  • Loading branch information
misl6 committed Nov 3, 2024
1 parent 3b744c7 commit 2669c99
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions tools/build_linux_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ mkdir kivy-dependencies/dist
# Build the dependencies
pushd kivy-dependencies/build

IS_RPI=`python -c "import platform; print('1' if 'raspberrypi' in platform.uname() else '0')"`

echo "-- Build SDL2"
pushd $MANYLINUX__SDL2__FOLDER
cmake -S . -B build \
Expand All @@ -87,13 +89,20 @@ popd
echo "-- Build SDL2_mixer"
pushd $MANYLINUX__SDL2_MIXER__FOLDER
./external/download.sh;
cmake -B build -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DSDL2MIXER_MOD_XMP=ON \
-DSDL2MIXER_MOD_XMP_SHARED=OFF \
-DCMAKE_INSTALL_PREFIX=../../dist \
-DSDL2MIXER_VENDORED=ON \
-GNinja

SDL2_MIXER_BUILD_ARGS="-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DSDL2MIXER_MOD_XMP=ON \
-DSDL2MIXER_MOD_XMP_SHARED=OFF \
-DCMAKE_INSTALL_PREFIX=../../dist \
-DSDL2MIXER_VENDORED=ON -GNinja"

# if platform is rpi or cross-compiling for rpi, we need to set additional flags
if [ "$IS_RPI" = "1" ] || [ "$KIVY_CROSS_PLATFORM" = "rpi" ]; then
SDL2_MIXER_BUILD_ARGS="$SDL2_MIXER_BUILD_ARGS -DCMAKE_C_FLAGS=\"-mcpu=native -mfpu=auto\""
fi

cmake -B build $SDL2_MIXER_BUILD_ARGS
cmake --build build/ --config Release --parallel --verbose
cmake --install build/ --config Release
popd
Expand All @@ -103,7 +112,7 @@ pushd $MANYLINUX__SDL2_IMAGE__FOLDER
./external/download.sh;
# 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.
if [ "$KIVY_CROSS_PLATFORM" = "rpi" ]; then
if [ "$IS_RPI" = "1" ] || [ "$KIVY_CROSS_PLATFORM" = "rpi" ]; then
pushd external/libwebp
git checkout 1.2.4
popd
Expand Down

0 comments on commit 2669c99

Please sign in to comment.