From dee557bd4bc6504b8afe2400fd72ea1e283dbc56 Mon Sep 17 00:00:00 2001 From: Thomas Heinrichs <46387399+Thomas1664@users.noreply.github.com> Date: Mon, 26 Dec 2022 12:45:15 +0100 Subject: [PATCH 1/2] [sdl2] Add feature samplerate --- ports/sdl2/deps.patch | 13 +++++++++++++ ports/sdl2/portfile.cmake | 7 +++++++ ports/sdl2/vcpkg.json | 8 +++++++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 ports/sdl2/deps.patch diff --git a/ports/sdl2/deps.patch b/ports/sdl2/deps.patch new file mode 100644 index 00000000000000..a8637d8c801b71 --- /dev/null +++ b/ports/sdl2/deps.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake +index 65a98efbe..2f99f28f1 100644 +--- a/cmake/sdlchecks.cmake ++++ b/cmake/sdlchecks.cmake +@@ -352,7 +352,7 @@ endmacro() + # - HAVE_SDL_LOADSO opt + macro(CheckLibSampleRate) + if(SDL_LIBSAMPLERATE) +- find_package(SampleRate QUIET) ++ find_package(SampleRate CONFIG REQUIRED) + if(SampleRate_FOUND AND TARGET SampleRate::samplerate) + set(HAVE_LIBSAMPLERATE TRUE) + set(HAVE_LIBSAMPLERATE_H TRUE) diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index 595ac4ba93e289..2e7a2146f3897a 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -5,6 +5,8 @@ vcpkg_from_github( REF release-${VERSION} SHA512 c4cffa32d4d43de64cc47ada80a657a9db53f4c60da3684f96a036527fdc12b0e459e9e638cab6c7eb796de29fd60ee5a8c73b56bccd8483024e225c81469961 HEAD_REF main + PATCHES + deps.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC) @@ -16,6 +18,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS vulkan SDL_VULKAN x11 SDL_X11 wayland SDL_WAYLAND + samplerate SDL_LIBSAMPLERATE ) if ("x11" IN_LIST FEATURES) @@ -40,6 +43,8 @@ vcpkg_cmake_configure( -DSDL_TEST=OFF -DSDL_IBUS=OFF -DSDL_INSTALL_CMAKEDIR="cmake" + -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON + -DSDL_LIBSAMPLERATE_SHARED=OFF MAYBE_UNUSED_VARIABLES SDL_FORCE_STATIC_VCRT ) @@ -54,6 +59,8 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin/sdl2-config" "${CURRENT_PACKAGES_DIR}/SDL2.framework" "${CURRENT_PACKAGES_DIR}/debug/SDL2.framework" + "${CURRENT_PACKAGES_DIR}/share/licenses" + "${CURRENT_PACKAGES_DIR}/share/aclocal" ) file(GLOB BINS "${CURRENT_PACKAGES_DIR}/debug/bin/*" "${CURRENT_PACKAGES_DIR}/bin/*") diff --git a/ports/sdl2/vcpkg.json b/ports/sdl2/vcpkg.json index fad347aeb4f344..d29e40492de7e5 100644 --- a/ports/sdl2/vcpkg.json +++ b/ports/sdl2/vcpkg.json @@ -1,7 +1,7 @@ { "name": "sdl2", "version": "2.26.1", - "port-version": 1, + "port-version": 2, "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/download-2.0.php", "license": "Zlib", @@ -33,6 +33,12 @@ } ] }, + "samplerate": { + "description": "Use libsamplerate for audio rate conversion", + "dependencies": [ + "libsamplerate" + ] + }, "vulkan": { "description": "Vulkan functionality for SDL" }, From 8b76e1b1fc57c20937a6d03ae9f21d867b01cb11 Mon Sep 17 00:00:00 2001 From: Thomas Heinrichs <46387399+Thomas1664@users.noreply.github.com> Date: Mon, 26 Dec 2022 12:45:40 +0100 Subject: [PATCH 2/2] version --- versions/baseline.json | 2 +- versions/s-/sdl2.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index 150768aa1bfb2d..3dc7ba726542e5 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6842,7 +6842,7 @@ }, "sdl2": { "baseline": "2.26.1", - "port-version": 1 + "port-version": 2 }, "sdl2-gfx": { "baseline": "1.0.4", diff --git a/versions/s-/sdl2.json b/versions/s-/sdl2.json index a6280ec428b58f..ab49620c039293 100644 --- a/versions/s-/sdl2.json +++ b/versions/s-/sdl2.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "ee20c1d23fa6dc2fa0b288abc4f4d124ed14f066", + "version": "2.26.1", + "port-version": 2 + }, { "git-tree": "61ecd58c79e5522e8a23f842936e24b2b6f08c75", "version": "2.26.1",