FFmpeg-Builds/scripts.d/50-sdl.sh

40 lines
996 B
Bash
Raw Normal View History

2020-09-03 17:52:38 +00:00
#!/bin/bash
SDL_REPO="https://github.com/libsdl-org/SDL.git"
SDL_COMMIT="615f7b4453864d9475e8b20faa78ec67be357f1e"
2020-09-03 17:52:38 +00:00
ffbuild_enabled() {
return 0
}
ffbuild_dockerbuild() {
git-mini-clone "$SDL_REPO" "$SDL_COMMIT" sdl
2020-09-03 17:52:38 +00:00
cd sdl
mkdir build && cd build
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" \
-DSDL_SHARED=OFF -DSDL_STATIC=ON -DSDL_STATIC_PIC=ON -DSDL_X11_SHARED=OFF \
-DHAVE_XGENERICEVENT=TRUE -DSDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM=1 \
..
exit 1
2020-09-03 17:52:38 +00:00
ninja -j$(nproc)
ninja install
if [[ $TARGET == linux* ]]; then
sed -ri -e 's/ \-l\/.+?\.a//g' \
"$FFBUILD_PREFIX"/lib/pkgconfig/sdl2.pc
echo 'Requires: xxf86vm xscrnsaver xrandr xfixes xi xinerama xcursor' >> "$FFBUILD_PREFIX"/lib/pkgconfig/sdl2.pc
fi
2020-09-03 17:52:38 +00:00
}
ffbuild_configure() {
echo --enable-sdl2
}
ffbuild_unconfigure() {
echo --disable-sdl2
}