Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/win-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ jobs:
portaudio:p
fftw:p
ffmpeg:p
SDL2:p
sdl3:p

- name: Build
shell: msys2 {0}
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ci/archlinux.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $SUDO pacman -S --noconfirm --needed \
$PACKAGES \
cmake ninja gcc llvm clang boost \
icu \
ffmpeg portaudio lv2 suil lilv sdl2 alsa-lib \
ffmpeg portaudio lv2 suil lilv sdl3 alsa-lib \
avahi fftw bluez-libs dbus \
tar xz wget \
brotli double-conversion zstd glib2 libb2 pcre2 \
Expand Down
2 changes: 1 addition & 1 deletion ci/archlinux.system.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $SUDO pacman -S --noconfirm --needed \
$PACKAGES \
cmake ninja gcc llvm clang boost \
icu \
ffmpeg portaudio lv2 suil lilv sdl2 alsa-lib \
ffmpeg portaudio lv2 suil lilv sdl3 alsa-lib \
avahi fftw bluez-libs \
tar xz wget \
brotli double-conversion zstd glib2 libb2 pcre2 \
Expand Down
4 changes: 2 additions & 2 deletions ci/debian.trixie-system.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:=} \
Expand Down Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion ci/debian.trixie.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ source ci/common.setup.sh

export CLANG_VERSION=19

# libsdl2-dev libsdl2-2.0-0
$SUDO apt-get update -qq
$SUDO apt-get install -qq --force-yes \
${PACKAGES:=} \
Expand All @@ -21,6 +20,7 @@ $SUDO apt-get install -qq --force-yes \
clang-$CLANG_VERSION lld-$CLANG_VERSION libclang-$CLANG_VERSION-dev llvm-$CLANG_VERSION-dev clang-tools-$CLANG_VERSION \
libfftw3-dev \
libsuil-dev liblilv-dev lv2-dev \
libsdl3-dev \
libdrm-dev libgbm-dev \
libdbus-1-dev \
libx11-dev libxext-dev libxcomposite-dev libxrandr-dev \
Expand Down
5 changes: 2 additions & 3 deletions ci/nix.build.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
, re2
, rubberband
, snappy
, SDL2
, SDL3 ? null
, spdlog
, suil
, udev
Expand Down Expand Up @@ -89,15 +89,14 @@ clangStdenv.mkDerivation (finalAttrs: {
re2
rubberband
snappy
SDL2
spdlog
suil
udev
xorg.libX11
xorg.libXext
xorg.libXcomposite
xorg.libXrandr
];
] ++ lib.optional (SDL3 != null) SDL3;

cmakeFlags = [
"-Wno-dev"
Expand Down
62 changes: 62 additions & 0 deletions ci/sdl3.source.deps.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion ci/ubuntu.2604.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
5 changes: 4 additions & 1 deletion ci/ubuntu.jammy.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
5 changes: 4 additions & 1 deletion ci/ubuntu.lunar.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
5 changes: 4 additions & 1 deletion ci/ubuntu.noble.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
5 changes: 4 additions & 1 deletion ci/ubuntu.oracular.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
2 changes: 1 addition & 1 deletion ci/ubuntu.plucky.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion ci/win32.mingw.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Done in the GH action for caching:
# pacboy -S --needed --noconfirm \
# cmake:p ninja:p toolchain:p cppwinrt:p qt6-base:p qt6-declarative:p qt6-websockets:p qt6-serialport:p qt6-shadertools:p qt6-scxml:p qt6-tools:p qt6-svg:p qt6-connectivity:p boost:p portaudio:p fftw:p ffmpeg:p SDL2:p
# cmake:p ninja:p toolchain:p cppwinrt:p qt6-base:p qt6-declarative:p qt6-websockets:p qt6-serialport:p qt6-shadertools:p qt6-scxml:p qt6-tools:p qt6-svg:p qt6-connectivity:p boost:p portaudio:p fftw:p ffmpeg:p sdl3:p

# TODO:
# jack2:p not available on clang?
Expand Down
1 change: 1 addition & 0 deletions cmake/Deployment/Linux/Flatpak/io.ossia.score.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ modules:
- shared-modules/linux-audio/lilv.json
- modules/dr_libs.yaml
- modules/portaudio.yaml
- modules/sdl3.yaml
- modules/rubberband.yaml
- modules/rapidfuzz-cpp.yaml
- modules/re2.yaml
Expand Down
32 changes: 32 additions & 0 deletions cmake/Deployment/Linux/Flatpak/modules/sdl3.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions cmake/ScoreExternalAddon.developer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/score-plugin-audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ if(OSSIA_ENABLE_PIPEWIRE)
endif()

if(OSSIA_ENABLE_SDL)
target_link_libraries(${PROJECT_NAME} PRIVATE $<BUILD_INTERFACE:ossia::sdl2>)
target_link_libraries(${PROJECT_NAME} PRIVATE $<BUILD_INTERFACE:ossia::sdl3>)
score_declare_feature(sdl)
endif()

Expand Down
2 changes: 1 addition & 1 deletion tools/developer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ else
portaudio:p \
fftw:p \
ffmpeg:p \
SDL2:p
sdl3:p

echo "[developer.sh] Configuring ($MINGW_PREFIX)"
mkdir -p $BUILD_DIR
Expand Down
Loading