-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_linux_dependencies.sh
executable file
·116 lines (101 loc) · 4.18 KB
/
build_linux_dependencies.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/bash
set -e -x
# manylinux SDL2
MANYLINUX__SDL2__VERSION="2.26.4"
MANYLINUX__SDL2__URL="https://github.com/libsdl-org/SDL/releases/download/release-$MANYLINUX__SDL2__VERSION/SDL2-$MANYLINUX__SDL2__VERSION.tar.gz"
MANYLINUX__SDL2__FOLDER="SDL2-$MANYLINUX__SDL2__VERSION"
# manylinux SDL2_image
MANYLINUX__SDL2_IMAGE__VERSION="2.6.3"
MANYLINUX__SDL2_IMAGE__URL="https://github.com/libsdl-org/SDL_image/releases/download/release-$MANYLINUX__SDL2_IMAGE__VERSION/SDL2_image-$MANYLINUX__SDL2_IMAGE__VERSION.tar.gz"
MANYLINUX__SDL2_IMAGE__FOLDER="SDL2_image-$MANYLINUX__SDL2_IMAGE__VERSION"
# manylinux SDL2_mixer
MANYLINUX__SDL2_MIXER__VERSION="2.6.3"
MANYLINUX__SDL2_MIXER__URL="https://github.com/libsdl-org/SDL_mixer/releases/download/release-$MANYLINUX__SDL2_MIXER__VERSION/SDL2_mixer-$MANYLINUX__SDL2_MIXER__VERSION.tar.gz"
MANYLINUX__SDL2_MIXER__FOLDER="SDL2_mixer-$MANYLINUX__SDL2_MIXER__VERSION"
# manylinux SDL2_ttf
MANYLINUX__SDL2_TTF__VERSION="2.20.2"
MANYLINUX__SDL2_TTF__URL="https://github.com/libsdl-org/SDL_ttf/releases/download/release-$MANYLINUX__SDL2_TTF__VERSION/SDL2_ttf-$MANYLINUX__SDL2_TTF__VERSION.tar.gz"
MANYLINUX__SDL2_TTF__FOLDER="SDL2_ttf-$MANYLINUX__SDL2_TTF__VERSION"
# Clean the dependencies folder
rm -rf kivy-dependencies
# Create the dependencies folder
mkdir kivy-dependencies
# Download the dependencies
echo "Downloading dependencies..."
mkdir kivy-dependencies/download
pushd kivy-dependencies/download
curl -L $MANYLINUX__SDL2__URL -o "${MANYLINUX__SDL2__FOLDER}.tar.gz"
curl -L $MANYLINUX__SDL2_IMAGE__URL -o "${MANYLINUX__SDL2_IMAGE__FOLDER}.tar.gz"
curl -L $MANYLINUX__SDL2_MIXER__URL -o "${MANYLINUX__SDL2_MIXER__FOLDER}.tar.gz"
curl -L $MANYLINUX__SDL2_TTF__URL -o "${MANYLINUX__SDL2_TTF__FOLDER}.tar.gz"
popd
# Extract the dependencies into build folder
echo "Extracting dependencies..."
mkdir kivy-dependencies/build
pushd kivy-dependencies/build
tar -xzf ../download/${MANYLINUX__SDL2__FOLDER}.tar.gz
tar -xzf ../download/${MANYLINUX__SDL2_IMAGE__FOLDER}.tar.gz
tar -xzf ../download/${MANYLINUX__SDL2_MIXER__FOLDER}.tar.gz
tar -xzf ../download/${MANYLINUX__SDL2_TTF__FOLDER}.tar.gz
popd
# Create distribution folder
echo "Creating distribution folder..."
mkdir kivy-dependencies/dist
# Build the dependencies
pushd kivy-dependencies/build
echo "-- Build SDL2"
pushd $MANYLINUX__SDL2__FOLDER
cmake -S . -B build \
-DCMAKE_INSTALL_PREFIX=../../dist \
-DCMAKE_BUILD_TYPE=Release \
-GNinja
cmake --build build/ --config Release --verbose --parallel
cmake --install build/ --config Release
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_MODPLUG=ON \
-DSDL2MIXER_MOD_MODPLUG_SHARED=OFF \
-DCMAKE_INSTALL_PREFIX=../../dist \
-DSDL2MIXER_VENDORED=ON \
-GNinja
cmake --build build/ --config Release --parallel --verbose
cmake --install build/ --config Release
popd
echo "-- Build SDL2_image"
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
pushd external/libwebp
git checkout 1.2.4
popd
fi
cmake -B build -DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DSDL2IMAGE_TIF=ON \
-DSDL2IMAGE_WEBP=ON \
-DSDL2IMAGE_TIF_SHARED=OFF \
-DSDL2IMAGE_WEBP_SHARED=OFF \
-DCMAKE_INSTALL_PREFIX=../../dist \
-DSDL2IMAGE_VENDORED=ON -GNinja
cmake --build build/ --config Release --parallel --verbose
cmake --install build/ --config Release
popd
echo "-- Build SDL2_ttf"
pushd $MANYLINUX__SDL2_TTF__FOLDER
cmake -B build-cmake \
-DBUILD_SHARED_LIBS=ON \
-DSDL2TTF_HARFBUZZ=ON \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=../../dist \
-DSDL2TTF_VENDORED=ON -GNinja
cmake --build build-cmake --config Release --verbose
cmake --install build-cmake/ --config Release --verbose
popd
popd