From 466699e4a8b8bcf9a52ac25a80b6dc62bfd01848 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Thu, 14 May 2026 06:11:20 +0000 Subject: [PATCH] [sdl3] add libusb feature (#51706) Signed-off-by: Rafael Kitover --- ports/sdl3/portfile.cmake | 11 ++++++++++- ports/sdl3/vcpkg.json | 7 +++++++ versions/baseline.json | 2 +- versions/s-/sdl3.json | 5 +++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ports/sdl3/portfile.cmake b/ports/sdl3/portfile.cmake index 6820bc4900..6c279b450e 100644 --- a/ports/sdl3/portfile.cmake +++ b/ports/sdl3/portfile.cmake @@ -20,6 +20,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS vulkan SDL_VULKAN wayland SDL_WAYLAND x11 SDL_X11 + libusb SDL_HIDAPI_LIBUSB ) if (VCPKG_TARGET_IS_EMSCRIPTEN) @@ -39,6 +40,15 @@ endif() if ("ibus" IN_LIST FEATURES) message(WARNING "You will need to install ibus dependencies to use feature ibus:\nsudo apt install libibus-1.0-dev\n") endif() + +if ("libusb" IN_LIST FEATURES) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_list(APPEND FEATURE_OPTIONS "-DSDL_HIDAPI_LIBUSB_SHARED=ON") + else() + vcpkg_list(APPEND FEATURE_OPTIONS "-DSDL_HIDAPI_LIBUSB_SHARED=OFF") + endif() +endif() + # option for not need to show windows list(APPEND FEATURE_OPTIONS -DSDL_UNIX_CONSOLE_BUILD=ON) if (VCPKG_TARGET_IS_LINUX AND NOT "x11" IN_LIST FEATURES AND NOT "wayland" IN_LIST FEATURES) @@ -59,7 +69,6 @@ vcpkg_cmake_configure( -DSDL_INSTALL_CMAKEDIR_ROOT=share/${PORT} # Specifying the revision skips the need to use git to determine a version -DSDL_REVISION=vcpkg - -DCMAKE_DISABLE_FIND_PACKAGE_LibUSB=1 MAYBE_UNUSED_VARIABLES SDL_FORCE_STATIC_VCRT ) diff --git a/ports/sdl3/vcpkg.json b/ports/sdl3/vcpkg.json index 11b76398f2..35fd2fdc4b 100644 --- a/ports/sdl3/vcpkg.json +++ b/ports/sdl3/vcpkg.json @@ -1,6 +1,7 @@ { "name": "sdl3", "version": "3.4.8", + "port-version": 1, "description": "Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.", "homepage": "https://www.libsdl.org", "license": "Zlib AND MIT AND Apache-2.0", @@ -57,6 +58,12 @@ "description": "Build with ibus IME support", "supports": "linux" }, + "libusb": { + "description": "Use libusb for joystick support", + "dependencies": [ + "libusb" + ] + }, "vulkan": { "description": "Vulkan functionality for SDL" }, diff --git a/versions/baseline.json b/versions/baseline.json index b6c6d3abd9..0491342917 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -9106,7 +9106,7 @@ }, "sdl3": { "baseline": "3.4.8", - "port-version": 0 + "port-version": 1 }, "sdl3-image": { "baseline": "3.4.4", diff --git a/versions/s-/sdl3.json b/versions/s-/sdl3.json index 562a010e60..4a5a26cc1d 100644 --- a/versions/s-/sdl3.json +++ b/versions/s-/sdl3.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "9c4f5fd6e369cc9699cc5176eef458d64b07912a", + "version": "3.4.8", + "port-version": 1 + }, { "git-tree": "c3a9eeaee64a945a280bd3eeda988129400a8e63", "version": "3.4.8",