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/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/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.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.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 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 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()