[sdl2] update to 2.0.22 (#24694)

* [sdl2] update to 2.0.22

* update version

Co-authored-by: FrankXie <v-frankxie@microsoft.com>
This commit is contained in:
JonLiu1993 2022-05-16 12:21:02 +08:00 committed by GitHub
parent 0cf5b4305b
commit 5e7cbdceac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 104 deletions

View File

@ -1,14 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 644715a..6eacfb8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2555,7 +2555,6 @@ endif()
@@ -2670,8 +2670,6 @@ endif()
configure_file("${SDL2_SOURCE_DIR}/include/SDL_revision.h.cmake"
"${SDL2_BINARY_DIR}/include/SDL_revision.h")
-if(NOT WINDOWS OR CYGWIN OR MINGW)
-
set(prefix ${CMAKE_INSTALL_PREFIX})
@@ -2590,7 +2590,7 @@ Libs.private:")
set(exec_prefix "\${prefix}")
@@ -2705,7 +2703,7 @@ Libs.private:")
set(SDL_STATIC_LIBS ${_SDL_STATIC_LIBS})
listtostrrev(SDL_LIBS _SDL_LIBS)
set(SDL_LIBS ${_SDL_LIBS})
@ -17,7 +20,7 @@
listtostr(EXTRA_LIBS _EXTRA_LIBS "-l")
set(SDL_STATIC_LIBS ${SDL_LIBS} ${EXTRA_LDFLAGS} ${_EXTRA_LIBS})
list(REMOVE_DUPLICATES SDL_STATIC_LIBS)
@@ -2611,7 +2611,6 @@ Libs.private:")
@@ -2726,7 +2724,6 @@ Libs.private:")
"${SDL2_BINARY_DIR}/sdl2-config" @ONLY)
configure_file("${SDL2_SOURCE_DIR}/SDL2.spec.in"
"${SDL2_BINARY_DIR}/SDL2.spec" @ONLY)
@ -25,12 +28,11 @@
macro(check_add_debug_flag FLAG SUFFIX)
check_c_compiler_flag(${FLAG} HAS_C_FLAG_${SUFFIX})
@@ -2956,6 +2956,7 @@ if(NOT (WINDOWS OR CYGWIN) OR MINGW)
# TODO: what about the .spec file? Is it only needed for RPM creation?
install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/aclocal")
@@ -3075,6 +3072,7 @@ if(NOT SDL2_DISABLE_INSTALL)
# TODO: what about the .spec file? Is it only needed for RPM creation?
install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/aclocal")
endif()
+ install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
endif()
+install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
##### Uninstall target #####

View File

@ -1,25 +0,0 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1755,8 +1755,10 @@ elseif(WINDOWS)
list(APPEND EXTRA_LIBS dinput8)
endif()
if(HAVE_XINPUT_H)
- set(SDL_JOYSTICK_XINPUT 1)
- set(HAVE_XINPUT TRUE)
+ if(NOT WINDOWS_STORE)
+ set(SDL_JOYSTICK_XINPUT 1)
+ set(HAVE_XINPUT TRUE)
+ endif()
if(HAVE_WINDOWS_GAMING_INPUT_H)
set(SDL_JOYSTICK_WGI 1)
endif()
@@ -1764,7 +1766,7 @@ elseif(WINDOWS)
set(HAVE_SDL_JOYSTICK TRUE)
if(SDL_HAPTIC)
- if(HAVE_DINPUT_H OR HAVE_XINPUT_H)
+ if((HAVE_DINPUT_H OR HAVE_XINPUT_H) AND NOT WINDOWS_STORE)
file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/windows/*.c)
if(HAVE_DINPUT_H)
set(SDL_HAPTIC_DINPUT 1)

View File

@ -1,15 +0,0 @@
--- a/src/misc/winrt/SDL_sysurl.cpp
+++ b/src/misc/winrt/SDL_sysurl.cpp
@@ -18,10 +18,9 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-#include <windows.h>
-#include "../../core/windows/SDL_windows.h"
#include "../SDL_sysurl.h"
+#include "../../core/windows/SDL_windows.h"
int
SDL_SYS_OpenURL(const char *url)

View File

@ -1,45 +0,0 @@
From 99af3281ee11ff947a82c561c2a275627ccea90c Mon Sep 17 00:00:00 2001
From: Charlie Birks <charlie@daft.games>
Date: Sat, 22 Jan 2022 12:27:43 +0000
Subject: [PATCH] timer: Fix Emscripten declaration-after-statement error
---
src/timer/unix/SDL_systimer.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/timer/unix/SDL_systimer.c b/src/timer/unix/SDL_systimer.c
index 57fdab09c..2cf26764c 100644
--- a/src/timer/unix/SDL_systimer.c
+++ b/src/timer/unix/SDL_systimer.c
@@ -187,13 +187,6 @@ SDL_GetPerformanceFrequency(void)
void
SDL_Delay(Uint32 ms)
{
-#ifdef __EMSCRIPTEN__
- if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) {
- /* pseudo-synchronous pause, used directly or through e.g. SDL_WaitEvent */
- emscripten_sleep(ms);
- return;
- }
-#endif
int was_error;
#if HAVE_NANOSLEEP
@@ -203,6 +196,14 @@ SDL_Delay(Uint32 ms)
Uint64 then, now, elapsed;
#endif
+#ifdef __EMSCRIPTEN__
+ if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) {
+ /* pseudo-synchronous pause, used directly or through e.g. SDL_WaitEvent */
+ emscripten_sleep(ms);
+ return;
+ }
+#endif
+
/* Set the timeout interval */
#if HAVE_NANOSLEEP
elapsed.tv_sec = ms / 1000;
--
2.35.1

View File

@ -2,17 +2,14 @@ set(SDL2_VERSION 2.0.20)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libsdl-org/SDL
REF release-2.0.20
SHA512 f8558057a06d4507190b369b2067aee55c22ab796b90bb663fbc36218e66ec14e2feb0ecd55f9b798bfd24fc94e2b4cb93eddc52a59f0709d6cb0ebdb6d9309b
REF 53dea9830964eee8b5c2a7ee0a65d6e268dc78a1 #vrelease-2.0.22
SHA512 809ac18aeb739cfc6558dc11a7b3abbdad62a8e651ae2bfc157f26947b0df063a34c117ea8bd003428b5618fa6ce21a655fda073f1ef15aa34bc4a442a578523
HEAD_REF master
PATCHES
0001-sdl2-Enable-creation-of-pkg-cfg-file-on-windows.patch
0002-sdl2-skip-ibus-on-linux.patch
0003-sdl2-disable-sdlmain-target-search-on-uwp.patch
0004-Define-crt-macros.patch
0005-Fix-uwp-joystick.patch
0006-Update-SDL_sysurl.cpp.patch
0007-timer-Fix-Emscripten-declaration-after-statement-err.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC)

View File

@ -1,9 +1,9 @@
{
"name": "sdl2",
"version": "2.0.20",
"port-version": 3,
"version": "2.0.22",
"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",
"dependencies": [
{
"name": "vcpkg-cmake",

View File

@ -6393,8 +6393,8 @@
"port-version": 4
},
"sdl2": {
"baseline": "2.0.20",
"port-version": 3
"baseline": "2.0.22",
"port-version": 0
},
"sdl2-gfx": {
"baseline": "1.0.4",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "6d875fe2feac0480f61fcf890136e045c12429f1",
"version": "2.0.22",
"port-version": 0
},
{
"git-tree": "24fc8b7ae34a3a363c76820d4ca50f715648a0b2",
"version": "2.0.20",