From 8249b73f58a3a20da6f760d71afd913d3fc39002 Mon Sep 17 00:00:00 2001 From: O01eg Date: Sun, 22 Dec 2024 18:59:42 +0400 Subject: [PATCH] WIP: Try to update SDL to 2.0.20 --- Sources.cmake | 4 ++-- ...er-build-and-install-SDL2main-library.patch | 4 +--- ...IC_HEADER-property-to-install-headers.patch | 18 +++++++++--------- ...04-CMake-Add-MacOSX-Framework-support.patch | 2 +- ...CMake-Set-framework-install-directory.patch | 14 +++++++------- 5 files changed, 20 insertions(+), 22 deletions(-) diff --git a/Sources.cmake b/Sources.cmake index d1a8daf..6be89f7 100644 --- a/Sources.cmake +++ b/Sources.cmake @@ -34,9 +34,9 @@ set(FREETYPE_VERSION 2.9) set(FREETYPE_URL http://downloads.sourceforge.net/project/freetype/freetype2/${FREETYPE_VERSION}/freetype-${FREETYPE_VERSION}.tar.gz) set(FREETYPE_MD5 d23a1b246e78890458c6672cb45eacd0) -set(SDL_VERSION 2.0.18) +set(SDL_VERSION 2.0.20) set(SDL_URL https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz) -set(SDL_MD5 c1dd33299db5b7091f37d989c68d5212) +set(SDL_MD5 a53acc02e1cca98c4123229069b67c9e) set(LIBOGG_VERSION 1.3.2) set(LIBOGG_URL http://downloads.xiph.org/releases/ogg/libogg-${LIBOGG_VERSION}.tar.gz) diff --git a/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch b/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch index 7699de4..6b57895 100644 --- a/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch +++ b/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch @@ -11,7 +11,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index d8209ca..b0a24bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -2670,18 +2670,18 @@ endif() +@@ -2750,17 +2750,17 @@ endif() # Ensure that the extra cflags are used at compile time set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") @@ -22,7 +22,6 @@ index d8209ca..b0a24bc 100644 - add_library(SDL2::SDL2main ALIAS SDL2main) - target_include_directories(SDL2main BEFORE PRIVATE "${SDL2_BINARY_DIR}/include") - target_include_directories(SDL2main PUBLIC "$" $ $) -- set(_INSTALL_LIBS "SDL2main") - if (NOT ANDROID) - set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") - endif() @@ -34,7 +33,6 @@ index d8209ca..b0a24bc 100644 +# add_library(SDL2::SDL2main ALIAS SDL2main) +# target_include_directories(SDL2main BEFORE PRIVATE "${SDL2_BINARY_DIR}/include") +# target_include_directories(SDL2main PUBLIC "$" $ $) -+# set(_INSTALL_LIBS "SDL2main") +# if (NOT ANDROID) +# set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") +# endif() diff --git a/patches/sdl/0003-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch b/patches/sdl/0003-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch index 5dd2e9e..109a16d 100644 --- a/patches/sdl/0003-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch +++ b/patches/sdl/0003-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch @@ -59,16 +59,16 @@ index b0a24bc..6a74f12 100644 if (NOT SDL_SHARED OR NOT WIN32 OR MINGW) set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2") # Note: Apparently, OUTPUT_NAME must really be unique; even when -@@ -2780,7 +2789,8 @@ endif() - install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" -- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") -+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" -+ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2") +@@ -2855,7 +2855,8 @@ endif() + install(TARGETS SDL2 EXPORT SDL2Targets + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" +- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2") + endif() - ##### Export files ##### - if (WINDOWS AND NOT MINGW) + if(NOT WINDOWS_STORE) @@ -2808,15 +2818,6 @@ install( COMPONENT Devel ) diff --git a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch index 8d06e1e..eb05360 100644 --- a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch +++ b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch @@ -22,9 +22,9 @@ index ec2cdd4..c3185d3 100644 set(SDL_SHARED ${SDL_SHARED_ENABLED_BY_DEFAULT} CACHE BOOL "Build a shared version of the library") set(SDL_STATIC ${SDL_STATIC_ENABLED_BY_DEFAULT} CACHE BOOL "Build a static version of the library") @@ -2731,6 +2734,16 @@ if(SDL_SHARED) + endif() set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB") endif() - set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS}) + if(APPLE AND BUILD_FRAMEWORK) + set_target_properties(SDL2 PROPERTIES + FRAMEWORK TRUE diff --git a/patches/sdl/0005-CMake-Set-framework-install-directory.patch b/patches/sdl/0005-CMake-Set-framework-install-directory.patch index 929463c..a97586e 100644 --- a/patches/sdl/0005-CMake-Set-framework-install-directory.patch +++ b/patches/sdl/0005-CMake-Set-framework-install-directory.patch @@ -11,14 +11,14 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index f32165cb7..50446f868 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -2686,6 +2686,7 @@ install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" -+ FRAMEWORK DESTINATION "${CMAKE_INSTALL_PREFIX}" - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2") +@@ -2878,6 +2878,7 @@ install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ FRAMEWORK DESTINATION "${CMAKE_INSTALL_PREFIX}" + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2") + endif() - ##### Export files ##### -- 2.14.3