[sdl2] update to 2.24.0 (#26436)

This commit is contained in:
Nick 2022-08-31 22:34:35 +02:00 committed by GitHub
parent af908b85af
commit f9b5f5406b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 114 additions and 213 deletions

View File

@ -0,0 +1,13 @@
diff --git a/configure b/configure
index 2829d79..697a504 100755
--- a/configure
+++ b/configure
@@ -6589,7 +6589,7 @@ fi
if enabled sdl2; then
SDL2_CONFIG="${cross_prefix}sdl2-config"
- test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent
+ test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 3.0.0" SDL_events.h SDL_PollEvent
if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
sdl2_extralibs=$("${SDL2_CONFIG}" --libs)

View File

@ -25,6 +25,7 @@ vcpkg_from_github(
0018-libaom-Dont-use-aom_codec_av1_dx_algo.patch
0019-libx264-Do-not-explicitly-set-X264_API_IMPORTS.patch
0020-fix-aarch64-libswscale.patch
0021-fix-sdl2-version-check.patch
)
if (SOURCE_PATH MATCHES " ")

View File

@ -1,7 +1,7 @@
{
"name": "ffmpeg",
"version": "4.4.1",
"port-version": 16,
"port-version": 17,
"description": [
"a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.",
"FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations."

View File

@ -0,0 +1,13 @@
diff --git a/src/Magnum/Platform/CMakeLists.txt b/src/Magnum/Platform/CMakeLists.txt
index f1b404f..19babf4 100644
--- a/src/Magnum/Platform/CMakeLists.txt
+++ b/src/Magnum/Platform/CMakeLists.txt
@@ -292,7 +292,7 @@ endif()
# SDL2 application
if(WITH_SDL2APPLICATION)
- find_package(SDL2)
+ find_package(SDL2 CONFIG REQUIRED)
if(NOT SDL2_FOUND)
message(FATAL_ERROR "SDL2 library, required by Sdl2Application, was not found. Set WITH_SDL2APPLICATION to OFF to skip building it.")
endif()

View File

@ -8,6 +8,7 @@ vcpkg_from_github(
002-sdl-includes.patch
003-fix-FindGLFW.patch
004-fix-FindOpenAL.patch
005-fix-find-sdl2.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)

View File

@ -1,7 +1,7 @@
{
"name": "magnum",
"version-string": "2020.06",
"port-version": 10,
"port-version": 11,
"description": "C++11/C++14 graphics middleware for games and data visualization",
"homepage": "https://magnum.graphics/",
"license": null,

View File

@ -0,0 +1,14 @@
diff --git a/CMake/FeatureSummary.cmake b/CMake/OgreFeatureSummary.cmake
similarity index 100%
rename from CMake/FeatureSummary.cmake
rename to CMake/OgreFeatureSummary.cmake
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cb86305..abbd5c4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -505,4 +505,4 @@ include(Packaging)
# Show feature summary
-include(FeatureSummary)
+include(OgreFeatureSummary)

View File

@ -17,6 +17,7 @@ vcpkg_from_github(
fix-dependency.patch
disable-dependency-qt.patch
fix-pkgconfig.patch
fix-cmake-feature-summary.patch
)
file(REMOVE "${SOURCE_PATH}/CMake/Packages/FindOpenEXR.cmake")

View File

@ -1,7 +1,7 @@
{
"name": "ogre",
"version": "1.12.9",
"port-version": 9,
"port-version": 10,
"description": "3D Object-Oriented Graphics Rendering Engine",
"homepage": "https://github.com/OGRECave/ogre",
"license": "MIT",

View File

@ -1,26 +1,33 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 644715a..6eacfb8 100644
index aa36eb02c..feb8a3b35 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2670,8 +2670,6 @@ endif()
configure_file("${SDL2_SOURCE_DIR}/include/SDL_revision.h.cmake"
"${SDL2_BINARY_DIR}/include/SDL_revision.h")
@@ -2833,8 +2833,6 @@ foreach(_hdr IN LISTS SDL2_INCLUDE_FILES)
endforeach()
list(APPEND SDL_GENERATED_HEADERS ${SDL2_COPIED_INCLUDE_FILES})
-if(NOT WINDOWS OR CYGWIN OR MINGW)
-
set(prefix ${CMAKE_INSTALL_PREFIX})
file(RELATIVE_PATH bin_prefix_relpath "${CMAKE_INSTALL_FULL_BINDIR}" "${CMAKE_INSTALL_PREFIX}")
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})
- else()
+ elseif(NOT WINDOWS_STORE)
listtostr(EXTRA_LIBS _EXTRA_LIBS "-l")
set(SDL_STATIC_LIBS ${SDL_LIBS} ${EXTRA_LDFLAGS} ${_EXTRA_LIBS})
list(REMOVE_DUPLICATES SDL_STATIC_LIBS)
@@ -2726,7 +2724,6 @@ Libs.private:")
@@ -2861,6 +2859,7 @@ Libs.private:")
endif()
# Clean up the different lists
+ if(NOT WINDOWS_STORE)
listtostr(EXTRA_LIBS _EXTRA_LIBS "-l")
set(SDL_STATIC_LIBS ${SDL_LIBS} ${EXTRA_LDFLAGS} ${_EXTRA_LIBS})
list(REMOVE_DUPLICATES SDL_STATIC_LIBS)
@@ -2870,6 +2869,7 @@ Libs.private:")
set(SDL_LIBS ${_SDL_LIBS})
listtostr(SDL_CFLAGS _SDL_CFLAGS "")
set(SDL_CFLAGS ${_SDL_CFLAGS})
+ endif()
# MESSAGE(STATUS "SDL_LIBS: ${SDL_LIBS}")
# MESSAGE(STATUS "SDL_STATIC_LIBS: ${SDL_STATIC_LIBS}")
@@ -2882,7 +2882,6 @@ Libs.private:")
"${SDL2_BINARY_DIR}/sdl2-config" @ONLY)
configure_file("${SDL2_SOURCE_DIR}/SDL2.spec.in"
"${SDL2_BINARY_DIR}/SDL2.spec" @ONLY)
@ -28,9 +35,9 @@ index 644715a..6eacfb8 100644
macro(check_add_debug_flag FLAG SUFFIX)
check_c_compiler_flag(${FLAG} HAS_C_FLAG_${SUFFIX})
@@ -3075,6 +3072,7 @@ if(NOT SDL2_DISABLE_INSTALL)
# TODO: what about the .spec file? Is it only needed for RPM creation?
@@ -3310,6 +3309,7 @@ if(NOT SDL2_DISABLE_INSTALL)
install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/aclocal")
install(FILES "LICENSE.txt" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/licenses/${PROJECT_NAME}")
endif()
+ install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
endif()

View File

@ -1,6 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa36eb02c..c01ee2e4b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1342,12 +1342,6 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT RISCOS AND NOT HAIKU)
@@ -1434,11 +1434,6 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
set(HAVE_FCITX TRUE)
endif()
@ -8,7 +10,6 @@
- if(IBUS_FOUND)
- set(HAVE_IBUS_IBUS_H TRUE)
- target_include_directories(sdl-build-options INTERFACE "${IBUS_INCLUDE_DIRS}")
- list(APPEND EXTRA_LIBS ${IBUS_LIBRARIES})
- endif()
if (HAVE_IBUS_IBUS_H OR HAVE_FCITX)

View File

@ -1,34 +0,0 @@
--- a/SDL2Config.cmake
+++ b/SDL2Config.cmake
@@ -46,6 +46,7 @@ foreach(prop ${relprops})
endif()
endforeach()
+if(NOT WINDOWS_STORE)
foreach(prop ${relprops})
get_target_property(sdl2mainimplib SDL2::SDL2main ${prop})
if(sdl2mainimplib)
@@ -53,6 +54,7 @@ foreach(prop ${relprops})
break()
endif()
endforeach()
+endif()
foreach(prop ${dbgprops})
get_target_property(sdl2implibdbg SDL2::SDL2 ${prop})
@@ -62,6 +64,7 @@ foreach(prop ${dbgprops})
endif()
endforeach()
+if(NOT WINDOWS_STORE)
foreach(prop ${dbgprops})
get_target_property(sdl2mainimplibdbg SDL2::SDL2main ${prop})
if(sdl2mainimplibdbg)
@@ -69,6 +72,7 @@ foreach(prop ${dbgprops})
break()
endif()
endforeach()
+endif()
if( sdl2implib AND sdl2mainimplib AND sdl2implibdbg AND sdl2mainimplibdbg )
# we have both release and debug builds of SDL2 and SDL2main, so use this ugly

View File

@ -1,15 +0,0 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -602,6 +602,11 @@ if(USE_GCC OR USE_CLANG)
list(APPEND EXTRA_CFLAGS -fcolor-diagnostics)
endif()
endif()
endif()
+if(MSVC)
+ target_compile_definitions(sdl-build-options INTERFACE "-D_CRT_SECURE_NO_DEPRECATE")
+ target_compile_definitions(sdl-build-options INTERFACE "-D_CRT_NONSTDC_NO_DEPRECATE")
+ target_compile_definitions(sdl-build-options INTERFACE "-D_CRT_SECURE_NO_WARNINGS")
+endif()
if(SDL_ASSEMBLY)

View File

@ -1,129 +0,0 @@
diff --git a/src/video/emscripten/SDL_emscriptenframebuffer.c b/src/video/emscripten/SDL_emscriptenframebuffer.c
index 372c6f5ac85..03fea04efa3 100644
--- a/src/video/emscripten/SDL_emscriptenframebuffer.c
+++ b/src/video/emscripten/SDL_emscriptenframebuffer.c
@@ -59,10 +59,19 @@ int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * form
return 0;
}
-static void
-Emscripten_UpdateWindowFramebufferWorker(SDL_Surface* surface)
+int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects)
{
- EM_ASM_INT({
+ SDL_Surface *surface;
+
+ SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
+ surface = data->surface;
+ if (!surface) {
+ return SDL_SetError("Couldn't find framebuffer surface for window");
+ }
+
+ /* Send the data to the display */
+
+ MAIN_THREAD_EM_ASM({
var w = $0;
var h = $1;
var pixels = $2;
@@ -147,31 +156,7 @@ Emscripten_UpdateWindowFramebufferWorker(SDL_Surface* surface)
}
SDL2.ctx.putImageData(SDL2.image, 0, 0);
- return 0;
}, surface->w, surface->h, surface->pixels);
-}
-
-int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects)
-{
- SDL_Surface *surface;
-
- SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
- surface = data->surface;
- if (!surface) {
- return SDL_SetError("Couldn't find framebuffer surface for window");
- }
-
- /* Send the data to the display */
-
- if (emscripten_is_main_runtime_thread()) {
- Emscripten_UpdateWindowFramebufferWorker(surface);
- } else {
- emscripten_sync_run_in_main_runtime_thread(
- EM_FUNC_SIG_VI,
- Emscripten_UpdateWindowFramebufferWorker,
- (uint32_t)surface
- );
- }
if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) {
/* give back control to browser for screen refresh */
diff --git a/src/video/emscripten/SDL_emscriptenmouse.c b/src/video/emscripten/SDL_emscriptenmouse.c
index e4148072503..38e394ac104 100644
--- a/src/video/emscripten/SDL_emscriptenmouse.c
+++ b/src/video/emscripten/SDL_emscriptenmouse.c
@@ -63,10 +63,20 @@ Emscripten_CreateDefaultCursor()
return Emscripten_CreateCursorFromString("default", SDL_FALSE);
}
-static const char*
-Emscripten_GetCursorUrl(int w, int h, int hot_x, int hot_y, void* pixels)
+
+static SDL_Cursor*
+Emscripten_CreateCursor(SDL_Surface* surface, int hot_x, int hot_y)
{
- return (const char *)EM_ASM_INT({
+ const char *cursor_url = NULL;
+ SDL_Surface *conv_surf;
+
+ conv_surf = SDL_ConvertSurfaceFormat(surface, SDL_PIXELFORMAT_ABGR8888, 0);
+
+ if (!conv_surf) {
+ return NULL;
+ }
+
+ cursor_url = (const char *)MAIN_THREAD_EM_ASM_INT({
var w = $0;
var h = $1;
var hot_x = $2;
@@ -114,40 +124,7 @@ Emscripten_GetCursorUrl(int w, int h, int hot_x, int hot_y, void* pixels)
stringToUTF8(url, urlBuf, url.length + 1);
return urlBuf;
- }, w, h, hot_x, hot_y, pixels);
-}
-
-static SDL_Cursor*
-Emscripten_CreateCursor(SDL_Surface* surface, int hot_x, int hot_y)
-{
- const char *cursor_url = NULL;
- SDL_Surface *conv_surf;
-
- conv_surf = SDL_ConvertSurfaceFormat(surface, SDL_PIXELFORMAT_ABGR8888, 0);
-
- if (!conv_surf) {
- return NULL;
- }
-
- if (emscripten_is_main_runtime_thread()) {
- cursor_url = Emscripten_GetCursorUrl(
- surface->w,
- surface->h,
- hot_x,
- hot_y,
- conv_surf->pixels
- );
- } else {
- cursor_url = (const char *)emscripten_sync_run_in_main_runtime_thread(
- EM_FUNC_SIG_IIIIIII,
- Emscripten_GetCursorUrl,
- surface->w,
- surface->h,
- hot_x,
- hot_y,
- conv_surf->pixels
- );
- }
+ }, surface->w, surface->h, hot_x, hot_y, conv_surf->pixels);
SDL_FreeSurface(conv_surf);

View File

@ -1,16 +1,13 @@
set(SDL2_VERSION 2.0.20)
set(SDL2_VERSION 2.24.0)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libsdl-org/SDL
REF 53dea9830964eee8b5c2a7ee0a65d6e268dc78a1 #vrelease-2.0.22
SHA512 809ac18aeb739cfc6558dc11a7b3abbdad62a8e651ae2bfc157f26947b0df063a34c117ea8bd003428b5618fa6ce21a655fda073f1ef15aa34bc4a442a578523
REF 8c9beb0c873f6ca5efbd88f1ad2648bfc793b2ac #vrelease-2.24.0
SHA512 7936fc3de9920eafe399f5b2af7bf87d479d4ba8c4a7957da90f3a90316dc7a6b8619ffd7a2c198d298d390e1235e00f9bd36fe3f04102bdff351b96c2ade59e
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-emscripten-fix-undefined-symbol-errors-in-non-threaded.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC)
@ -44,6 +41,9 @@ vcpkg_cmake_configure(
-DSDL_FORCE_STATIC_VCRT=${FORCE_STATIC_VCRT}
-DSDL_LIBC=ON
-DSDL_HIDAPI_JOYSTICK=ON
-DSDL_TEST=OFF
MAYBE_UNUSED_VARIABLES
SDL_FORCE_STATIC_VCRT
)
vcpkg_cmake_install()
@ -103,6 +103,15 @@ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2 " "-lSDL2d ")
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sdl2.pc" "-lSDL2 " "-lSDL2-static ")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2d " "-lSDL2-staticd ")
endif()
endif()
vcpkg_fixup_pkgconfig()
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,7 +1,6 @@
{
"name": "sdl2",
"version": "2.0.22",
"port-version": 3,
"version": "2.24.0",
"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",

View File

@ -2262,7 +2262,7 @@
},
"ffmpeg": {
"baseline": "4.4.1",
"port-version": 16
"port-version": 17
},
"ffnvcodec": {
"baseline": "11.1.5.0",
@ -4486,7 +4486,7 @@
},
"magnum": {
"baseline": "2020.06",
"port-version": 10
"port-version": 11
},
"magnum-extras": {
"baseline": "2020.06",
@ -5166,7 +5166,7 @@
},
"ogre": {
"baseline": "1.12.9",
"port-version": 9
"port-version": 10
},
"ogre-next": {
"baseline": "2.3.1",
@ -6573,8 +6573,8 @@
"port-version": 4
},
"sdl2": {
"baseline": "2.0.22",
"port-version": 3
"baseline": "2.24.0",
"port-version": 0
},
"sdl2-gfx": {
"baseline": "1.0.4",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "197609d70edc506c0257721d873b1eb3b93ba4b8",
"version": "4.4.1",
"port-version": 17
},
{
"git-tree": "0aee15f22c29078cc18d6324f3f622ef6e94deba",
"version": "4.4.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e6431ca1de3d870f6489764786af14b7230fa29f",
"version-string": "2020.06",
"port-version": 11
},
{
"git-tree": "13edb110eb5bc10f3591616c0fb64e7bc4b2ce9f",
"version-string": "2020.06",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ea03f2d3fd45123a688cd9fb177bcb9bab30a795",
"version": "1.12.9",
"port-version": 10
},
{
"git-tree": "24ad8730cbc30e48c816ce6bca6abfb6cf1851fc",
"version": "1.12.9",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "dbd3f6b2c738602adc3b3aa7c314212bff79b620",
"version": "2.24.0",
"port-version": 0
},
{
"git-tree": "69c64474577715f87366d9374b0483256f305f1e",
"version": "2.0.22",