From 130ad077b7522b35aa780c6b171711159b1cfca5 Mon Sep 17 00:00:00 2001 From: Edu Meneses Date: Thu, 6 Aug 2026 09:42:55 -0400 Subject: [PATCH 1/3] sdl: consume SDL3 from the SDK Points the SDK prefix paths at $OSSIA_SDK/SDL3 (see ossia/sdk#27), renames the ossia::sdl2 link target to ossia::sdl3, moves the Emscripten link option to -sUSE_SDL=3, and bumps libossia to the branch carrying the API port. The libossia bump also picks up the 13 commits of master the submodule was behind; none of them touch SDL. avendish is deliberately untouched. avendish.ossia.cmake and avendish.standalone.cmake do reference a bare SDL2 link target, but every one of those references sits behind either the `if(1)` short-circuit at the top of avendish.ossia.cmake or an `if(TARGET ossia::ossia)` that score's build does not enter -- no link.txt in a configured score build mentions SDL2, and the only libSDL2.so left in build.ninja comes from system ffmpeg's avdevice pkg-config ldflags, which is unrelated. Verified on linux-x86_64 against SDL3 3.4.14: JoystickDevice.cpp, JoystickProtocolFactory.cpp, JoystickProtocolSettingsWidget.cpp, JoystickSpecificSettingsSerialization.cpp and score_plugin_audio.cpp (which is what pulls in Audio/SDLInterface.hpp) all compile clean under this build's own flags and warnings. joystick_info keeps its index-based API, so the enumeration loops in JoystickDevice and JoystickProtocolFactory and the (id, index) pair in JoystickSpecificSettings needed no change and existing save files keep loading. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01TTUi76cnUWh7dGZC64LqbZ --- 3rdparty/libossia | 2 +- CMakeLists.txt | 6 +++--- cmake/ScoreExternalAddon.developer.cmake | 4 ++-- src/app/CMakeLists.txt | 2 +- src/plugins/score-plugin-audio/CMakeLists.txt | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/3rdparty/libossia b/3rdparty/libossia index 01050d1860..18637c2334 160000 --- a/3rdparty/libossia +++ b/3rdparty/libossia @@ -1 +1 @@ -Subproject commit 01050d1860f71107db666b2c7b53004bb50efee2 +Subproject commit 18637c23348b6f10247e1206690e0e0d2b1af2f6 diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d46c84025..e463b5e317 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ if(OSSIA_SDK) set(CMAKE_PREFIX_PATH "${OSSIA_SDK}" - "${OSSIA_SDK}/SDL2" + "${OSSIA_SDK}/SDL3" "${OSSIA_SDK}/qt6-static-debug" "${OSSIA_SDK}/qt6-static" "${OSSIA_SDK}/llvm" @@ -49,8 +49,8 @@ if(OSSIA_SDK) "${OSSIA_SDK}/sysroot/lib/cmake/Snappy" "${OSSIA_SDK}/sysroot/lib/cmake/zstd" - "${OSSIA_SDK}/SDL2/lib64" - "${OSSIA_SDK}/SDL2/lib64/cmake/SDL2" + "${OSSIA_SDK}/SDL3/lib64" + "${OSSIA_SDK}/SDL3/lib64/cmake/SDL3" "${OSSIA_SDK}/qt6-static-debug/lib64" "${OSSIA_SDK}/qt6-static/lib64" "${OSSIA_SDK}/llvm-libs/lib64" diff --git a/cmake/ScoreExternalAddon.developer.cmake b/cmake/ScoreExternalAddon.developer.cmake index 1936cd37ea..342f01c063 100644 --- a/cmake/ScoreExternalAddon.developer.cmake +++ b/cmake/ScoreExternalAddon.developer.cmake @@ -25,7 +25,7 @@ list(APPEND CMAKE_PREFIX_PATH "${CMAKE_MODULE_PATH}") set(CMAKE_PREFIX_PATH "${OSSIA_SDK}" - "${OSSIA_SDK}/SDL2" + "${OSSIA_SDK}/SDL3" "${OSSIA_SDK}/qt6-static-debug" "${OSSIA_SDK}/qt6-static" "${OSSIA_SDK}/llvm" @@ -50,7 +50,7 @@ set(CMAKE_PREFIX_PATH "${OSSIA_SDK}/sysroot/lib/cmake/Snappy" "${OSSIA_SDK}/sysroot/lib/cmake/zstd" - "${OSSIA_SDK}/SDL2/lib64" + "${OSSIA_SDK}/SDL3/lib64" "${OSSIA_SDK}/qt6-static-debug/lib64" "${OSSIA_SDK}/qt6-static/lib64" "${OSSIA_SDK}/llvm-libs/lib64" diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index e5067e9e94..2f88cb07c9 100755 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -17,7 +17,7 @@ endif() if(CMAKE_SYSTEM_NAME MATCHES Emscripten) add_link_options("SHELL:-sASSERTIONS=0") add_link_options("SHELL:-sSAFE_HEAP=0") - add_link_options("SHELL:-sUSE_SDL=2") + add_link_options("SHELL:-sUSE_SDL=3") add_link_options("SHELL:-sSTACK_OVERFLOW_CHECK=0") #add_link_options("SHELL:--source-map-base http://127.0.0.1:8000/") add_link_options("SHELL:-sFETCH=1") diff --git a/src/plugins/score-plugin-audio/CMakeLists.txt b/src/plugins/score-plugin-audio/CMakeLists.txt index 42d35474c3..aabac29010 100644 --- a/src/plugins/score-plugin-audio/CMakeLists.txt +++ b/src/plugins/score-plugin-audio/CMakeLists.txt @@ -98,7 +98,7 @@ if(OSSIA_ENABLE_PIPEWIRE) endif() if(OSSIA_ENABLE_SDL) - target_link_libraries(${PROJECT_NAME} PRIVATE $) + target_link_libraries(${PROJECT_NAME} PRIVATE $) list(APPEND SCORE_FEATURES_LIST sdl) endif() From 2a97b29ccf84ae5a7c35238784470e20447ef9a0 Mon Sep 17 00:00:00 2001 From: Edu Meneses Date: Thu, 6 Aug 2026 09:50:22 -0400 Subject: [PATCH 2/3] sdl: get SDL3 to the packaging targets that build against system libraries The prefix-path change only covers builds that consume $OSSIA_SDK. The flatpak and the distro legs resolve SDL from elsewhere, and find_package(SDL3) finds nothing there, which silently turns OSSIA_ENABLE_SDL off and drops the joystick protocol and the SDL audio engine from those artefacts. The flatpak had no SDL module at all: it was picking SDL2 up from the org.kde.Platform runtime. Every other non-runtime dependency in that manifest is bundled (portaudio, boost, faust, ysfx, ...), so SDL3 is bundled the same way, built with the same subsystem set the SDK uses. For the distro legs, libsdl3 exists in Debian trixie (3.2.10) and sid (3.4.14) and in Ubuntu plucky (3.2.8) and questing (3.2.20), so those move to libsdl3-dev/libsdl3-0, and nix moves to the SDL3 attribute. Ubuntu jammy, noble, lunar and oracular are deliberately left alone: none of those releases ship libsdl3 at all, so there is nothing to point them at. They will build without the joystick protocol until someone decides whether to build SDL3 from source in their deps scripts. Debian bookworm/bullseye/trixie already had their libsdl2 lines commented out, so nothing changes for them. Note this is a silent downgrade rather than a build failure, despite score_assert_feature(sdl) and SCORE_DEPLOYMENT_BUILD=1 being set on those legs: score_assert_feature is currently a no-op. It does list(APPEND SCORE_MISSING_FEATURES ...) inside a function() with no PARENT_SCOPE, so the variable the FATAL_ERROR tests is always empty, and it also passes a dereferenced "${SCORE_FEATURES_LIST}" to IN_LIST, which expects the list's name. Left as-is here on purpose - fixing it belongs in its own change, and would turn several legs red at once. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01TTUi76cnUWh7dGZC64LqbZ --- ci/debian.trixie-system.deps.sh | 4 +-- ci/nix.build.nix | 4 +-- ci/ubuntu.2604.deps.sh | 2 +- ci/ubuntu.plucky.deps.sh | 2 +- .../Linux/Flatpak/io.ossia.score.yml | 1 + .../Linux/Flatpak/modules/sdl3.yaml | 32 +++++++++++++++++++ 6 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 cmake/Deployment/Linux/Flatpak/modules/sdl3.yaml diff --git a/ci/debian.trixie-system.deps.sh b/ci/debian.trixie-system.deps.sh index 4b4cb94106..9f1c90a4dd 100755 --- a/ci/debian.trixie-system.deps.sh +++ b/ci/debian.trixie-system.deps.sh @@ -10,7 +10,7 @@ source ci/common.setup.sh export CLANG_VERSION=19 -# libsdl2-dev libsdl2-2.0-0 +# libsdl3-dev libsdl3-0 $SUDO apt-get update -qq $SUDO apt-get install -qq --force-yes \ ${PACKAGES:=} \ @@ -51,7 +51,7 @@ $SUDO apt-get install -qq --force-yes \ libonnxruntime-dev \ faust \ libgps-dev \ - libsdl2-dev \ + libsdl3-dev \ glslang-dev glslang-tools \ libzita-alsa-pcmi-dev \ libvst3sdk-dev \ diff --git a/ci/nix.build.nix b/ci/nix.build.nix index fe17e697af..8702e3414d 100644 --- a/ci/nix.build.nix +++ b/ci/nix.build.nix @@ -34,7 +34,7 @@ , re2 , rubberband , snappy -, SDL2 +, SDL3 , spdlog , suil , udev @@ -89,7 +89,7 @@ clangStdenv.mkDerivation (finalAttrs: { re2 rubberband snappy - SDL2 + SDL3 spdlog suil udev diff --git a/ci/ubuntu.2604.deps.sh b/ci/ubuntu.2604.deps.sh index b5488d2fa8..67cf832760 100755 --- a/ci/ubuntu.2604.deps.sh +++ b/ci/ubuntu.2604.deps.sh @@ -33,7 +33,7 @@ $SUDO apt install -y \ qt6-websockets-dev \ qt6-serialport-dev \ qt6-shadertools-dev \ - libbluetooth-dev libsdl2-dev libsdl2-2.0-0 \ + libbluetooth-dev libsdl3-dev libsdl3-0 \ libglu1-mesa-dev libglu1-mesa libgles2-mesa-dev \ libavahi-compat-libdnssd-dev libsamplerate0-dev \ portaudio19-dev \ diff --git a/ci/ubuntu.plucky.deps.sh b/ci/ubuntu.plucky.deps.sh index bf53bd6fdd..5f57329dd0 100755 --- a/ci/ubuntu.plucky.deps.sh +++ b/ci/ubuntu.plucky.deps.sh @@ -34,7 +34,7 @@ $SUDO apt-get install -y \ libqt6websockets6-dev \ qt6-serialport-dev \ qt6-shadertools-dev \ - libbluetooth-dev libsdl2-dev libsdl2-2.0-0 \ + libbluetooth-dev libsdl3-dev libsdl3-0 \ libglu1-mesa-dev libglu1-mesa libgles2-mesa-dev \ libavahi-compat-libdnssd-dev libsamplerate0-dev \ portaudio19-dev \ diff --git a/cmake/Deployment/Linux/Flatpak/io.ossia.score.yml b/cmake/Deployment/Linux/Flatpak/io.ossia.score.yml index 1e9c6d07cc..788f57e0d0 100644 --- a/cmake/Deployment/Linux/Flatpak/io.ossia.score.yml +++ b/cmake/Deployment/Linux/Flatpak/io.ossia.score.yml @@ -113,6 +113,7 @@ modules: - shared-modules/linux-audio/lilv.json - modules/dr_libs.yaml - modules/portaudio.yaml + - modules/sdl3.yaml - modules/libsamplerate.yaml - modules/rubberband.yaml - modules/rapidfuzz-cpp.yaml diff --git a/cmake/Deployment/Linux/Flatpak/modules/sdl3.yaml b/cmake/Deployment/Linux/Flatpak/modules/sdl3.yaml new file mode 100644 index 0000000000..7892ff00f1 --- /dev/null +++ b/cmake/Deployment/Linux/Flatpak/modules/sdl3.yaml @@ -0,0 +1,32 @@ +# Joystick / gamepad input, and the SDL audio backend +name: sdl3 +buildsystem: cmake-ninja +config-opts: + - -Wno-dev + - -DCMAKE_BUILD_TYPE=Release + - -DCMAKE_POSITION_INDEPENDENT_CODE=ON + - -DBUILD_SHARED_LIBS=ON + - -DSDL_JOYSTICK=ON + - -DSDL_HAPTIC=ON + - -DSDL_HIDAPI=ON + - -DSDL_HIDAPI_JOYSTICK=ON + - -DSDL_POWER=ON + - -DSDL_SENSOR=ON + - -DSDL_AUDIO=ON + - -DSDL_VIDEO=OFF + - -DSDL_RENDER=OFF + - -DSDL_CAMERA=OFF + - -DSDL_GPU=OFF + - -DSDL_DIALOG=OFF + - -DSDL_TRAY=OFF + - -DSDL_X11=OFF + - -DSDL_WAYLAND=OFF + - -DSDL_UNIX_CONSOLE_BUILD=ON + - -DSDL_TESTS=OFF + - -DSDL_TEST_LIBRARY=OFF + - -DSDL_EXAMPLES=OFF + - -DSDL_INSTALL_CPACK=OFF +sources: + - type: archive + url: https://github.com/libsdl-org/SDL/releases/download/release-3.4.14/SDL3-3.4.14.tar.gz + sha256: 30d4aa2b3037718142b32dffd4e72f917ebb6cc5227150e7bb9c45efb2153aeb From 4fc5ff113a4cf5fa0f03782cbdff6cb26c9b4ead Mon Sep 17 00:00:00 2001 From: Edu Meneses Date: Thu, 6 Aug 2026 10:11:07 -0400 Subject: [PATCH 3/3] sdl: build SDL3 from source on the releases that do not package it Ubuntu jammy (22.04 LTS), noble (24.04 LTS), lunar and oracular ship no libsdl3 at all, so pointing them at a package was not an option and they would otherwise have built with the joystick protocol and the SDL audio engine quietly missing. ci/sdl3.source.deps.sh builds SDL3 3.4.14 into /usr/local with the same subsystem set as the SDK's sdl.sh and the flatpak module. It is sourced rather than executed so $SUDO from common.setup.sh stays in scope, which is also why it contains no `exit` - that would take the calling deps script down with it and skip common.deps.sh. It short-circuits on `pkg-config --exists sdl3`, so a release that gains a libsdl3 package later only needs its apt line changed and the source build becomes a no-op. libsdl2-dev/libsdl2-2.0-0 are replaced by libudev-dev on those four: SDL3's linux joystick and HIDAPI backends want it, and nothing else in the tree needs SDL2 any more. Version tracks SDL_VERSION in ossia/sdk's common/versions.sh; keep them in step. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01TTUi76cnUWh7dGZC64LqbZ --- ci/sdl3.source.deps.sh | 62 ++++++++++++++++++++++++++++++++++++++ ci/ubuntu.jammy.deps.sh | 5 ++- ci/ubuntu.lunar.deps.sh | 5 ++- ci/ubuntu.noble.deps.sh | 5 ++- ci/ubuntu.oracular.deps.sh | 5 ++- 5 files changed, 78 insertions(+), 4 deletions(-) create mode 100755 ci/sdl3.source.deps.sh diff --git a/ci/sdl3.source.deps.sh b/ci/sdl3.source.deps.sh new file mode 100755 index 0000000000..d719ed10fd --- /dev/null +++ b/ci/sdl3.source.deps.sh @@ -0,0 +1,62 @@ +#!/bin/bash -eux + +# SDL3 from source, for distributions that do not package it yet. Sourced, not +# executed, so that $SUDO from common.setup.sh is in scope - hence no `exit` +# anywhere in here, which would take the calling deps script down with it. +# +# Ubuntu jammy (22.04), noble (24.04), lunar and oracular ship no libsdl3 at all; +# Debian trixie/sid and Ubuntu plucky/questing do package it and use libsdl3-dev +# instead. Without this, find_package(SDL3) finds nothing, OSSIA_ENABLE_SDL goes +# off, and the build silently loses the joystick protocol and the SDL audio +# engine. +# +# Version tracks SDL_VERSION in ossia/sdk's common/versions.sh. The subsystem set +# matches the SDK's sdl.sh and the flatpak module: score only needs joystick, +# gamepad, haptic, sensor and audio, so video and its dependencies stay off - +# which is also why SDL_UNIX_CONSOLE_BUILD is needed, as SDL3 otherwise refuses +# to configure with both X11 and Wayland disabled. + +if pkg-config --exists sdl3; then + echo "SDL3 $(pkg-config --modversion sdl3) already available, skipping source build" +else + ( + SDL3_VERSION=3.4.14 + SDL3_SRC="SDL3-$SDL3_VERSION" + + wget -nv "https://github.com/libsdl-org/SDL/releases/download/release-$SDL3_VERSION/$SDL3_SRC.tar.gz" + tar xzf "$SDL3_SRC.tar.gz" + rm "$SDL3_SRC.tar.gz" + + cmake -S "$SDL3_SRC" -B sdl3-build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/local \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DBUILD_SHARED_LIBS=ON \ + -DSDL_JOYSTICK=ON \ + -DSDL_HAPTIC=ON \ + -DSDL_HIDAPI=ON \ + -DSDL_HIDAPI_JOYSTICK=ON \ + -DSDL_POWER=ON \ + -DSDL_SENSOR=ON \ + -DSDL_AUDIO=ON \ + -DSDL_VIDEO=OFF \ + -DSDL_RENDER=OFF \ + -DSDL_CAMERA=OFF \ + -DSDL_GPU=OFF \ + -DSDL_DIALOG=OFF \ + -DSDL_TRAY=OFF \ + -DSDL_X11=OFF \ + -DSDL_WAYLAND=OFF \ + -DSDL_UNIX_CONSOLE_BUILD=ON \ + -DSDL_TESTS=OFF \ + -DSDL_TEST_LIBRARY=OFF \ + -DSDL_EXAMPLES=OFF \ + -DSDL_INSTALL_CPACK=OFF + + cmake --build sdl3-build --parallel + $SUDO cmake --install sdl3-build + $SUDO ldconfig + + rm -rf sdl3-build "$SDL3_SRC" + ) +fi diff --git a/ci/ubuntu.jammy.deps.sh b/ci/ubuntu.jammy.deps.sh index 43c9f7fe65..a6127e4c44 100755 --- a/ci/ubuntu.jammy.deps.sh +++ b/ci/ubuntu.jammy.deps.sh @@ -43,7 +43,7 @@ $SUDO apt-get install -y \ libqt6websockets6-dev \ libqt6serialport6-dev \ libqt6shadertools6-dev \ - libbluetooth-dev libsdl2-dev libsdl2-2.0-0 \ + libbluetooth-dev libudev-dev \ libglu1-mesa-dev libglu1-mesa libgles2-mesa-dev \ libavahi-compat-libdnssd-dev libsamplerate0-dev \ portaudio19-dev \ @@ -53,4 +53,7 @@ $SUDO apt-get install -y \ file \ dpkg-dev +# SDL3 is not packaged on this release; build it from source +source ci/sdl3.source.deps.sh + source ci/common.deps.sh LINUX diff --git a/ci/ubuntu.lunar.deps.sh b/ci/ubuntu.lunar.deps.sh index bb49e14254..1ee0ff8e68 100755 --- a/ci/ubuntu.lunar.deps.sh +++ b/ci/ubuntu.lunar.deps.sh @@ -38,7 +38,7 @@ $SUDO apt-get install -y \ libqt6websockets6-dev \ libqt6serialport6-dev \ libqt6shadertools6-dev \ - libbluetooth-dev libsdl2-dev libsdl2-2.0-0 \ + libbluetooth-dev libudev-dev \ libglu1-mesa-dev libglu1-mesa libgles2-mesa-dev \ libavahi-compat-libdnssd-dev libsamplerate0-dev \ portaudio19-dev \ @@ -50,4 +50,7 @@ $SUDO apt-get install -y \ dpkg-dev \ lsb-release +# SDL3 is not packaged on this release; build it from source +source ci/sdl3.source.deps.sh + source ci/common.deps.sh LINUX diff --git a/ci/ubuntu.noble.deps.sh b/ci/ubuntu.noble.deps.sh index 4a64660239..e5b3079df9 100755 --- a/ci/ubuntu.noble.deps.sh +++ b/ci/ubuntu.noble.deps.sh @@ -33,7 +33,7 @@ $SUDO apt-get install -y \ libqt6websockets6-dev \ libqt6serialport6-dev \ libqt6shadertools6-dev \ - libbluetooth-dev libsdl2-dev libsdl2-2.0-0 \ + libbluetooth-dev libudev-dev \ libglu1-mesa-dev libglu1-mesa libgles2-mesa-dev \ libavahi-compat-libdnssd-dev libsamplerate0-dev \ portaudio19-dev \ @@ -51,4 +51,7 @@ $SUDO rm -rf /usr/bin/lld /usr/bin/ld.lld $SUDO ln -s /usr/bin/lld-19 /usr/bin/lld $SUDO ln -s /usr/bin/ld.lld-19 /usr/bin/ld.lld +# SDL3 is not packaged on this release; build it from source +source ci/sdl3.source.deps.sh + source ci/common.deps.sh LINUX diff --git a/ci/ubuntu.oracular.deps.sh b/ci/ubuntu.oracular.deps.sh index ff8630b9b6..79053740f1 100755 --- a/ci/ubuntu.oracular.deps.sh +++ b/ci/ubuntu.oracular.deps.sh @@ -33,7 +33,7 @@ $SUDO apt-get install -y \ libqt6websockets6-dev \ libqt6serialport6-dev \ libqt6shadertools6-dev \ - libbluetooth-dev libsdl2-dev libsdl2-2.0-0 \ + libbluetooth-dev libudev-dev \ libglu1-mesa-dev libglu1-mesa libgles2-mesa-dev \ libavahi-compat-libdnssd-dev libsamplerate0-dev \ portaudio19-dev \ @@ -45,4 +45,7 @@ $SUDO apt-get install -y \ dpkg-dev \ lsb-release +# SDL3 is not packaged on this release; build it from source +source ci/sdl3.source.deps.sh + source ci/common.deps.sh LINUX