diff --git a/AArch64/build-all.sh b/AArch64/build-all.sh index 9bd2388..5493942 100644 --- a/AArch64/build-all.sh +++ b/AArch64/build-all.sh @@ -14,6 +14,7 @@ cd /image ./openssl.sh ./qt.sh ./sdl.sh +./sdl3.sh ./portaudio.sh ./jack.sh ../Linux/ysfx.sh \ No newline at end of file diff --git a/AArch64/sdl3.sh b/AArch64/sdl3.sh new file mode 100755 index 0000000..525eed7 --- /dev/null +++ b/AArch64/sdl3.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +source ./common.sh clang +source ../common/clone-sdl3.sh + +export CFLAGS="${CFLAGS:-} -DSDL_DYNAMIC_API=0" +export CXXFLAGS="${CXXFLAGS:-} -DSDL_DYNAMIC_API=0" + +cmake -S SDL3-$SDL3_VERSION -B sdl3-build \ + -GNinja \ + -DCMAKE_TOOLCHAIN_FILE="$CMAKE_TOOLCHAIN" \ + -DSDL_STATIC=1 \ + -DSDL_SHARED=0 \ + -DBUILD_SHARED_LIBS=0 \ + -DCMAKE_POSITION_INDEPENDENT_CODE=1 \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX/SDL3" \ + -DSDL_JOYSTICK=1 \ + -DSDL_HAPTIC=1 \ + -DSDL_HIDAPI=1 \ + -DSDL_HIDAPI_JOYSTICK=1 \ + -DSDL_POWER=1 \ + -DSDL_SENSOR=1 \ + -DSDL_AUDIO=0 \ + -DSDL_VIDEO=0 \ + -DSDL_RENDER=0 \ + -DSDL_CAMERA=0 \ + -DSDL_GPU=0 \ + -DSDL_DIALOG=0 \ + -DSDL_TRAY=0 \ + -DSDL_DBUS=0 \ + -DSDL_LIBUDEV=1 \ + -DSDL_OPENGL=0 \ + -DSDL_OPENGLES=0 \ + -DSDL_VULKAN=0 \ + -DSDL_PIPEWIRE=0 \ + -DSDL_PULSEAUDIO=0 \ + -DSDL_WAYLAND=0 \ + -DSDL_X11=0 \ + -DSDL_UNIX_CONSOLE_BUILD=1 \ + -DSDL_IBUS=0 \ + -DSDL_TEST_LIBRARY=0 \ + -DSDL_TESTS=0 \ + -DSDL_EXAMPLES=0 \ + -DSDL_INSTALL_CPACK=0 + +cmake --build sdl3-build +cmake --build sdl3-build --target install/strip diff --git a/Linux/build-all.sh b/Linux/build-all.sh index 3ddd3e2..efb6605 100755 --- a/Linux/build-all.sh +++ b/Linux/build-all.sh @@ -21,6 +21,7 @@ build_media() { ./ffmpeg.sh ./fftw.sh ./sdl.sh + ./sdl3.sh ./portaudio.sh ./jack.sh ./pipewire.sh diff --git a/Linux/sdl3.sh b/Linux/sdl3.sh new file mode 100755 index 0000000..06e2748 --- /dev/null +++ b/Linux/sdl3.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +source ./common.sh clang +source ./common/clone-sdl3.sh + +export CFLAGS="${CFLAGS:-} -DSDL_DYNAMIC_API=0" +export CXXFLAGS="${CXXFLAGS:-} -DSDL_DYNAMIC_API=0" + +cmake -S SDL3-$SDL3_VERSION -B sdl3-build \ +-GNinja \ +-DSDL_STATIC=1 \ +-DSDL_SHARED=0 \ +-DBUILD_SHARED_LIBS=0 \ +-DCMAKE_POSITION_INDEPENDENT_CODE=1 \ +-DCMAKE_BUILD_TYPE=Release \ +-DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX/SDL3" \ +-DSDL_JOYSTICK=1 \ +-DSDL_HAPTIC=1 \ +-DSDL_HIDAPI=1 \ +-DSDL_HIDAPI_JOYSTICK=1 \ +-DSDL_POWER=1 \ +-DSDL_SENSOR=1 \ +-DSDL_AUDIO=0 \ +-DSDL_VIDEO=0 \ +-DSDL_RENDER=0 \ +-DSDL_CAMERA=0 \ +-DSDL_GPU=0 \ +-DSDL_DIALOG=0 \ +-DSDL_TRAY=0 \ +-DSDL_DBUS=0 \ +-DSDL_LIBUDEV=1 \ +-DSDL_OPENGL=0 \ +-DSDL_OPENGLES=0 \ +-DSDL_VULKAN=0 \ +-DSDL_PIPEWIRE=0 \ +-DSDL_PULSEAUDIO=0 \ +-DSDL_WAYLAND=0 \ +-DSDL_X11=0 \ +-DSDL_UNIX_CONSOLE_BUILD=1 \ +-DSDL_IBUS=0 \ +-DSDL_TEST_LIBRARY=0 \ +-DSDL_TESTS=0 \ +-DSDL_EXAMPLES=0 \ +-DSDL_INSTALL_CPACK=0 + +cmake --build sdl3-build +cmake --build sdl3-build --target install/strip diff --git a/MSYS/all.sh b/MSYS/all.sh index 720997d..01e564c 100644 --- a/MSYS/all.sh +++ b/MSYS/all.sh @@ -32,6 +32,7 @@ build_media() { ./fftw.sh ./portaudio.sh ./sdl.sh + ./sdl3.sh ./faust.sh ./jack.sh ./dnssd.sh diff --git a/MSYS/sdl3.sh b/MSYS/sdl3.sh new file mode 100755 index 0000000..444e41b --- /dev/null +++ b/MSYS/sdl3.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +source ./common.sh +source ../common/clone-sdl3.sh + +rm -rf sdl3-build +mkdir sdl3-build + +export CFLAGS="${CFLAGS:-} -DSDL_DYNAMIC_API=0" +export CXXFLAGS="${CXXFLAGS:-} -DSDL_DYNAMIC_API=0" + +cmake -S SDL3-$SDL3_VERSION -B sdl3-build \ +-GNinja \ + -DSDL_STATIC=1 \ + -DSDL_SHARED=0 \ + -DBUILD_SHARED_LIBS=0 \ + -DCMAKE_POSITION_INDEPENDENT_CODE=1 \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX_CMAKE/SDL3 \ + -DSDL_JOYSTICK=1 \ + -DSDL_HAPTIC=1 \ + -DSDL_HIDAPI=1 \ + -DSDL_HIDAPI_JOYSTICK=1 \ + -DSDL_POWER=1 \ + -DSDL_SENSOR=1 \ + -DSDL_AUDIO=0 \ + -DSDL_VIDEO=1 \ + -DSDL_RENDER=0 \ + -DSDL_CAMERA=0 \ + -DSDL_GPU=0 \ + -DSDL_DIALOG=0 \ + -DSDL_TRAY=0 \ + -DSDL_OPENGL=0 \ + -DSDL_OPENGLES=0 \ + -DSDL_VULKAN=0 \ + -DSDL_TEST_LIBRARY=0 \ + -DSDL_TESTS=0 \ + -DSDL_EXAMPLES=0 \ + -DSDL_INSTALL_CPACK=0 + +cmake --build sdl3-build +cmake --build sdl3-build --target install/strip diff --git a/README.md b/README.md index 9572e87..e888678 100644 --- a/README.md +++ b/README.md @@ -10,5 +10,5 @@ The dependencies are built statically on every platform and very up-to-date - PortAudio - FFTW - JACK -- SDL +- SDL2 and SDL3 diff --git a/common/clone-sdl3.sh b/common/clone-sdl3.sh new file mode 100644 index 0000000..da9f62c --- /dev/null +++ b/common/clone-sdl3.sh @@ -0,0 +1,15 @@ +#!/bin/bash -eu + +source ../common/versions.sh + +if command -v gsed; then + SED=gsed +else + SED=sed +fi + +if [[ ! -d SDL3-$SDL3_VERSION ]]; then + curl -ksSLOJ "https://github.com/libsdl-org/SDL/releases/download/release-$SDL3_VERSION/SDL3-$SDL3_VERSION.tar.gz" + tar xzf SDL3-$SDL3_VERSION.tar.gz + $SED -i '/error Nope/d' "SDL3-$SDL3_VERSION/src/dynapi/SDL_dynapi.h" +fi diff --git a/common/versions.sh b/common/versions.sh index b27561a..4f1941d 100644 --- a/common/versions.sh +++ b/common/versions.sh @@ -1,4 +1,13 @@ +# SDL2 is transitional: libossia's joystick/game-controller/audio backends and +# its find_package(SDL2) still speak the SDL2 API, so an SDL3-only SDK would flip +# OSSIA_ENABLE_SDL off and drop the joystick protocol and the SDL audio engine +# from the releases -- silently, since score_assert_feature is a no-op today. +# Both SDLs are therefore installed side by side ($INSTALL_PREFIX/SDL2 and +# $INSTALL_PREFIX/SDL3) so an SDK tag stays consumable by today's score while the +# port happens in libossia. Drop SDL_VERSION and every sdl.sh once libossia is on +# SDL3. export SDL_VERSION=2.32.10 +export SDL3_VERSION=3.4.14 export FFMPEG_VERSION=8.1 # emsdk pin for the WASM SDK. Must match Qt's QT_EMCC_RECOMMENDED_VERSION for # $QT_VERSION (qtbase/cmake/QtPublicWasmToolchainHelpers.cmake); still 5.0.5 on diff --git a/macOS/all.sh b/macOS/all.sh index e08fd37..7b67d9d 100755 --- a/macOS/all.sh +++ b/macOS/all.sh @@ -20,6 +20,7 @@ build_media() { # ./sndfile.sh # ./portaudio.sh ./sdl.sh + ./sdl3.sh ./jack.sh ./faust.sh # needs llvm-config from the core's $INSTALL_PREFIX/llvm-libs ./ysfx.sh diff --git a/macOS/sdl3.sh b/macOS/sdl3.sh new file mode 100755 index 0000000..e3bce54 --- /dev/null +++ b/macOS/sdl3.sh @@ -0,0 +1,47 @@ +#!/bin/bash -eu + +source ./common.sh +source ../common/clone-sdl3.sh + +export CFLAGS="${CFLAGS:-} -fno-fast-math -DSDL_DYNAMIC_API=0" +export CXXFLAGS="${CXXFLAGS:-} -fno-fast-math -DSDL_DYNAMIC_API=0" + +xcrun cmake \ + -S SDL3-$SDL3_VERSION \ + -B sdl3-build \ + -GNinja \ + -DSDL_STATIC=1 \ + -DSDL_SHARED=0 \ + -DSDL_FRAMEWORK=0 \ + -DBUILD_SHARED_LIBS=0 \ + -DCMAKE_POSITION_INDEPENDENT_CODE=1 \ + -DCMAKE_DISABLE_PRECOMPILE_HEADERS=1 \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_OSX_SYSROOT=$MACOS_SYSROOT \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=$MACOS_VERSION \ + -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX/SDL3 \ + -DSDL_JOYSTICK=1 \ + -DSDL_HAPTIC=1 \ + -DSDL_HIDAPI=1 \ + -DSDL_HIDAPI_JOYSTICK=1 \ + -DSDL_POWER=1 \ + -DSDL_SENSOR=1 \ + -DSDL_AUDIO=0 \ + -DSDL_VIDEO=0 \ + -DSDL_RENDER=0 \ + -DSDL_CAMERA=0 \ + -DSDL_GPU=0 \ + -DSDL_DIALOG=0 \ + -DSDL_TRAY=0 \ + -DSDL_METAL=0 \ + -DSDL_OPENGL=0 \ + -DSDL_OPENGLES=0 \ + -DSDL_VULKAN=0 \ + -DSDL_TEST_LIBRARY=0 \ + -DSDL_TESTS=0 \ + -DSDL_EXAMPLES=0 \ + -DSDL_INSTALL_CPACK=0 \ + $CMAKE_ADDITIONAL_FLAGS + +xcrun cmake --build sdl3-build +xcrun cmake --build sdl3-build --target install/strip