From 40722bd22f8d35080caa7fa516941796482514eb Mon Sep 17 00:00:00 2001 From: O01eg Date: Wed, 13 Nov 2024 21:51:21 +0400 Subject: [PATCH 01/18] CI: Update Artifact actions to v4 --- .github/workflows/android-macos-python.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/android-macos-python.yml b/.github/workflows/android-macos-python.yml index 881da01..6837ff2 100644 --- a/.github/workflows/android-macos-python.yml +++ b/.github/workflows/android-macos-python.yml @@ -150,7 +150,7 @@ jobs: pushd build-boost/Boost-for-Android/libiconv-libicu-android/${{ matrix.ndk-arch }}/ zip -r -9 -q ../../../../FreeOrionSDK_${{ steps.cmake-dist-version.outputs.dist-version }}_Android-${{ matrix.ndk-arch }}.zip lib/libicui18n.a lib/libicuuc.a lib/libicudata.a lib/libiconv.so - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 name: Artifacts if: ${{ !startsWith(github.ref, 'refs/tags/v') }} with: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 42fb0dd..ed36448 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -28,7 +28,7 @@ jobs: cd build cmake --build . --config RelWithDebInfo - name: Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ !startsWith(github.ref, 'refs/tags/v') }} with: name: MacOS SDK diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7bf4d74..674bdc8 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -32,7 +32,7 @@ jobs: cd build cmake --build . --config RelWithDebInfo -- /verbosity:d - name: Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ !startsWith(github.ref, 'refs/tags/v') }} with: name: Windows SDK From a596d0c2393150bd9b49cbf7a1585f9531f18a64 Mon Sep 17 00:00:00 2001 From: O01eg Date: Sun, 22 Dec 2024 12:25:34 +0400 Subject: [PATCH 02/18] Update MacOS runner from 11 to 13 --- .github/workflows/android-macos-python.yml | 2 +- .github/workflows/macos.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/android-macos-python.yml b/.github/workflows/android-macos-python.yml index 6837ff2..c91aa14 100644 --- a/.github/workflows/android-macos-python.yml +++ b/.github/workflows/android-macos-python.yml @@ -15,7 +15,7 @@ on: jobs: build-android: name: ${{ matrix.ndk-arch }} on ${{ matrix.arch }} Android - runs-on: macos-11 + runs-on: macos-13 strategy: matrix: ndk-arch: [x86_64] diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index ed36448..781f5fd 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-11] + os: [macos-13] env: CMAKE_BUILD_PARALLEL_LEVEL: 2 HOMEBREW_NO_AUTO_UPDATE: 1 @@ -21,7 +21,7 @@ jobs: run: | mkdir build cd build - xcversion select 11.7 + xcodes select 14.1 cmake -DCMAKE_XCODE_BUILD_SYSTEM=1 .. - name: Build run: | From 148d49aa592f92e6836da92f56a6a9bd11efe313 Mon Sep 17 00:00:00 2001 From: O01eg Date: Sun, 22 Dec 2024 13:32:32 +0400 Subject: [PATCH 03/18] Upload python library artifact once for Android --- .github/workflows/android-macos-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-macos-python.yml b/.github/workflows/android-macos-python.yml index c91aa14..abdbf12 100644 --- a/.github/workflows/android-macos-python.yml +++ b/.github/workflows/android-macos-python.yml @@ -156,7 +156,7 @@ jobs: with: name: python SDK path: | - python39.zip + ${{ matrix.ndk-arch == 'x86_64' && 'python39.zip' || '' }} FreeOrionSDK_${{ steps.cmake-dist-version.outputs.dist-version }}_Android-${{ matrix.ndk-arch }}.zip - name: Prepare Release From fd08da0ca5d7b3cdc74e474d196b654c7f9da48d Mon Sep 17 00:00:00 2001 From: O01eg Date: Sun, 22 Dec 2024 14:02:51 +0400 Subject: [PATCH 04/18] Fix boost toolset issue --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a91fab..eb692d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -555,7 +555,7 @@ else() list(GET _VS_PLATFORM_TOOLSET 0 _VS_PLATFORM_TOOLSET_VERSION) list(GET _VS_PLATFORM_TOOLSET 1 _VS_PLATFORM_TOOLSET_TARGET) math(EXPR _VS_PLATFORM_TOOLSET_VERSION "${_VS_PLATFORM_TOOLSET_VERSION}/10") - set(_VS_PLATFORM_TOOLSET_VERSION "${_VS_PLATFORM_TOOLSET_VERSION}.0") + set(_VS_PLATFORM_TOOLSET_VERSION "${_VS_PLATFORM_TOOLSET_VERSION}.3") set(BOOST_CONFIGURE_FLAGS debug-store=database ) @@ -570,6 +570,7 @@ else() list(APPEND BOOST_CONFIGURE_FLAGS define=BOOST_USE_WINAPI_VERSION=BOOST_WINAPI_VERSION_VISTA) endif() set(BOOST_TOOLSET msvc-${_VS_PLATFORM_TOOLSET_VERSION}) + message(STATUS "Boost toolset is msvc-${_VS_PLATFORM_TOOLSET_VERSION} for ${CMAKE_VS_PLATFORM_TOOLSET}") set(BOOST_OSX_SYSROOT "") endif() From 6a9a0ae547a9cdee899f0a12b64936e97712a70b Mon Sep 17 00:00:00 2001 From: O01eg Date: Sun, 22 Dec 2024 16:14:24 +0400 Subject: [PATCH 05/18] Update SDL to 2.0.14 and output applied patch --- CMakeLists.txt | 1 + Sources.cmake | 4 ++-- ...r-build-and-install-SDL2main-library.patch | 12 ++++++---- ...C_HEADER-property-to-install-headers.patch | 24 +++++++++++-------- ...4-CMake-Add-MacOSX-Framework-support.patch | 14 +++++------ 5 files changed, 32 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb692d9..ab0efae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ function(ExternalProject_PatchSet TARGET_NAME RESULT) else() set(${RESULT} ${${RESULT}} COMMAND) endif() + set(${RESULT} ${${RESULT}} ${CMAKE_COMMAND} -E echo "Appliying patch ${_PATCH} ..." COMMAND) set(${RESULT} ${${RESULT}} ${PATCH_EXECUTABLE} -p1 < ${_PATCH}) endforeach() if(NOT ${RESULT}) diff --git a/Sources.cmake b/Sources.cmake index 165785d..e3fb95d 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.12) +set(SDL_VERSION 2.0.14) set(SDL_URL https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz) -set(SDL_MD5 783b6f2df8ff02b19bb5ce492b99c8ff) +set(SDL_MD5 76ed4e6da9c07bd168b2acd9bfefab1b) 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 8996042..45aab2c 100644 --- a/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch +++ b/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch @@ -11,27 +11,31 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index aa17932b6..3fe76072c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -2199,13 +2199,13 @@ endif() +@@ -2196,15 +2196,15 @@ endif() # Ensure that the extra cflags are used at compile time set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") -# Always build SDLmain +-if(NOT WINDOWS_STORE) -add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) -target_include_directories(SDL2main PUBLIC "$" $ $) -set(_INSTALL_LIBS "SDL2main") -if (NOT ANDROID) - set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") -endif() +-endif() +# Never build SDLmain ++#if(NOT WINDOWS_STORE) +#add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) +#target_include_directories(SDL2main PUBLIC "$" $) +#set(_INSTALL_LIBS "SDL2main") +#if (NOT ANDROID) +# set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX}) +#endif() - - if(SDL_SHARED) - add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) ++#endif() + + if (ANDROID AND HAVE_HIDAPI) + set(_INSTALL_LIBS ${_INSTALL_LIBS} "hidapi") -- 2.14.3 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 1b97afc..0c3ea15 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 @@ -8,11 +8,11 @@ Subject: [PATCH] CMake: Use PUBLIC_HEADER property to install headers 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3fe76072c..56cced0f0 100644 +index a420993..ec2cdd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1795,13 +1795,19 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") - # set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX}) +@@ -2206,17 +2206,23 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") + #endif() #endif() +file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h) @@ -23,6 +23,10 @@ index 3fe76072c..56cced0f0 100644 +endforeach() +list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) + + if (ANDROID AND HAVE_HIDAPI) + set(_INSTALL_LIBS ${_INSTALL_LIBS} "hidapi") + endif() + if(SDL_SHARED) - add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) - if(APPLE) @@ -37,7 +41,7 @@ index 3fe76072c..56cced0f0 100644 set_target_properties(SDL2 PROPERTIES VERSION ${LT_VERSION} SOVERSION ${LT_REVISION} -@@ -1848,7 +1854,9 @@ endif() +@@ -2269,7 +2275,9 @@ endif() if(SDL_STATIC) set (BUILD_SHARED_LIBS FALSE) @@ -48,7 +52,7 @@ index 3fe76072c..56cced0f0 100644 if (NOT SDL_SHARED OR NOT WIN32) set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2") # Note: Apparently, OUTPUT_NAME must really be unique; even when -@@ -1887,7 +1897,8 @@ endif() +@@ -2311,7 +2319,8 @@ endif() install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets LIBRARY DESTINATION "lib${LIB_SUFFIX}" ARCHIVE DESTINATION "lib${LIB_SUFFIX}" @@ -57,8 +61,8 @@ index 3fe76072c..56cced0f0 100644 + PUBLIC_HEADER DESTINATION include/SDL2) ##### Export files ##### - if (APPLE) -@@ -1799,23 +1810,15 @@ install( + if (WINDOWS) +@@ -2339,15 +2348,6 @@ install( COMPONENT Devel ) @@ -70,14 +74,14 @@ index 3fe76072c..56cced0f0 100644 -endforeach() -list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) -install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2) - +- string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE) if (UPPER_BUILD_TYPE MATCHES DEBUG) set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") - else() +@@ -2355,7 +2355,7 @@ else() set(SOPOSTFIX "") endif() - + -if(NOT (WINDOWS OR CYGWIN)) +if((NOT WINDOWS OR CYGWIN) AND (NOT BUILD_FRAMEWORK)) if(SDL_SHARED) diff --git a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch index fc91e25..174340a 100644 --- a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch +++ b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch @@ -8,20 +8,20 @@ Subject: [PATCH] CMake: Add MacOSX Framework support 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 56cced0f0..f32165cb7 100644 +index ec2cdd4..c3185d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -373,6 +373,9 @@ dep_option(KMSDRM_SHARED "Dynamically load KMS DRM support" ON "VIDEO_KMSDRM" OFF) - option_string(BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal or 'OFF'" "OFF") +@@ -399,6 +399,9 @@ option_string(BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal option_string(FOREGROUNDING_SIGNAL "number to use for magic foregrounding signal or 'OFF'" "OFF") set_option(HIDAPI "Use HIDAPI for low level joystick drivers" ${OPT_DEF_HIDAPI}) + set_option(JOYSTICK_VIRTUAL "Enable the virtual-joystick driver" ON) +if(APPLE) + set_option(BUILD_FRAMEWORK "Build Framework bundle for OSX" OFF) +endif() 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") -@@ -1819,6 +1822,16 @@ if(SDL_SHARED) +@@ -2244,6 +2247,16 @@ if(SDL_SHARED) set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB") endif() set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS}) @@ -35,9 +35,9 @@ index 56cced0f0..f32165cb7 100644 + MACOSX_RPATH ON + OUTPUT_NAME "SDL2") + endif() - target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) - target_include_directories(SDL2 PUBLIC "$" $) - if (NOT ANDROID) + target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) + target_include_directories(SDL2 PUBLIC "$" $ $) + if(ANDROID) -- 2.14.3 From 1eebe0327366e2e33cb79162b1e64ea9750ffcb9 Mon Sep 17 00:00:00 2001 From: O01eg Date: Sun, 22 Dec 2024 17:11:00 +0400 Subject: [PATCH 06/18] Update SDL to 2.0.16 --- Sources.cmake | 4 +-- ...r-build-and-install-SDL2main-library.patch | 14 +++++--- ...C_HEADER-property-to-install-headers.patch | 34 +++++++++++-------- ...4-CMake-Add-MacOSX-Framework-support.patch | 6 ++-- ...Make-Set-framework-install-directory.patch | 10 +++--- 5 files changed, 38 insertions(+), 30 deletions(-) diff --git a/Sources.cmake b/Sources.cmake index e3fb95d..08ba4c0 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.14) +set(SDL_VERSION 2.0.16) set(SDL_URL https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz) -set(SDL_MD5 76ed4e6da9c07bd168b2acd9bfefab1b) +set(SDL_MD5 98b8a1535a757ea1d03ae44e2fb20247) 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 45aab2c..42c2c97 100644 --- a/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch +++ b/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch @@ -11,26 +11,30 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index aa17932b6..3fe76072c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -2196,15 +2196,15 @@ endif() +@@ -2540,16 +2540,16 @@ endif() # Ensure that the extra cflags are used at compile time set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") -# Always build SDLmain -if(NOT WINDOWS_STORE) -add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) --target_include_directories(SDL2main PUBLIC "$" $ $) +-# alias target for in-tree builds +-add_library(SDL2::SDL2main ALIAS SDL2main) +-target_include_directories(SDL2main PUBLIC "$" $ $) -set(_INSTALL_LIBS "SDL2main") -if (NOT ANDROID) - set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") -endif() -endif() -+# Never build SDLmain ++# Always build SDLmain +#if(NOT WINDOWS_STORE) +#add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) -+#target_include_directories(SDL2main PUBLIC "$" $) ++# alias target for in-tree builds ++#add_library(SDL2::SDL2main ALIAS SDL2main) ++#target_include_directories(SDL2main PUBLIC "$" $ $) +#set(_INSTALL_LIBS "SDL2main") +#if (NOT ANDROID) -+# set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX}) ++# set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") +#endif() +#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 0c3ea15..a64a32d 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 @@ -8,10 +8,10 @@ Subject: [PATCH] CMake: Use PUBLIC_HEADER property to install headers 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index a420993..ec2cdd4 100644 +index 18bcfc2..0937ac9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -2206,17 +2206,23 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +@@ -2552,19 +2552,25 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") #endif() #endif() @@ -29,40 +29,44 @@ index a420993..ec2cdd4 100644 if(SDL_SHARED) - add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) ++ add_library(SDL2 SHARED ${INCLUDE_FILES} ${SOURCE_FILES} ${VERSION_SOURCES}) + # alias target for in-tree builds + add_library(SDL2::SDL2 ALIAS SDL2) - if(APPLE) - set_target_properties(SDL2 PROPERTIES - MACOSX_RPATH 1 - OUTPUT_NAME "SDL2-${LT_RELEASE}") - elseif(UNIX AND NOT ANDROID) -+ add_library(SDL2 SHARED ${INCLUDE_FILES} ${SOURCE_FILES} ${VERSION_SOURCES}) + set_target_properties(SDL2 PROPERTIES + PUBLIC_HEADER "${INCLUDE_FILES}") + if(UNIX AND NOT ANDROID) set_target_properties(SDL2 PROPERTIES VERSION ${LT_VERSION} - SOVERSION ${LT_REVISION} -@@ -2269,7 +2275,9 @@ endif() + SOVERSION ${LT_MAJOR} +@@ -2620,9 +2626,11 @@ endif() if(SDL_STATIC) set (BUILD_SHARED_LIBS FALSE) - add_library(SDL2-static STATIC ${SOURCE_FILES}) + add_library(SDL2-static STATIC ${INCLUDE_FILES} ${SOURCE_FILES}) + # alias target for in-tree builds + add_library(SDL2::SDL2-static ALIAS SDL2-static) + set_target_properties(SDL2-static PROPERTIES + PUBLIC_HEADER "${INCLUDE_FILES}") if (NOT SDL_SHARED OR NOT WIN32) set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2") # Note: Apparently, OUTPUT_NAME must really be unique; even when -@@ -2311,7 +2319,8 @@ endif() +@@ -2664,7 +2672,8 @@ endif() install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets - LIBRARY DESTINATION "lib${LIB_SUFFIX}" - ARCHIVE DESTINATION "lib${LIB_SUFFIX}" -- RUNTIME DESTINATION bin) -+ RUNTIME DESTINATION bin -+ PUBLIC_HEADER DESTINATION include/SDL2) + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}" +- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2") ##### Export files ##### if (WINDOWS) -@@ -2339,15 +2348,6 @@ install( +@@ -2692,15 +2701,6 @@ install( COMPONENT Devel ) @@ -73,16 +77,16 @@ index a420993..ec2cdd4 100644 - list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME}) -endforeach() -list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) --install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2) +-install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2) - string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE) if (UPPER_BUILD_TYPE MATCHES DEBUG) set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") -@@ -2355,7 +2355,7 @@ else() +@@ -2708,7 +2708,7 @@ else() set(SOPOSTFIX "") endif() --if(NOT (WINDOWS OR CYGWIN)) +-if(NOT (WINDOWS OR CYGWIN OR MINGW)) +if((NOT WINDOWS OR CYGWIN) AND (NOT BUILD_FRAMEWORK)) if(SDL_SHARED) set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc. diff --git a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch index 174340a..5669018 100644 --- a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch +++ b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch @@ -11,10 +11,10 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index ec2cdd4..c3185d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -399,6 +399,9 @@ option_string(BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal - option_string(FOREGROUNDING_SIGNAL "number to use for magic foregrounding signal or 'OFF'" "OFF") +@@ -419,6 +419,9 @@ option_string(BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal set_option(HIDAPI "Use HIDAPI for low level joystick drivers" ${OPT_DEF_HIDAPI}) set_option(JOYSTICK_VIRTUAL "Enable the virtual-joystick driver" ON) + set_option(ASAN "Use AddressSanitizer to detect memory errors" OFF) +if(APPLE) + set_option(BUILD_FRAMEWORK "Build Framework bundle for OSX" OFF) +endif() @@ -36,7 +36,7 @@ index ec2cdd4..c3185d3 100644 + OUTPUT_NAME "SDL2") + endif() target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) - target_include_directories(SDL2 PUBLIC "$" $ $) + target_include_directories(SDL2 PUBLIC "$" $ $) if(ANDROID) -- 2.14.3 diff --git a/patches/sdl/0005-CMake-Set-framework-install-directory.patch b/patches/sdl/0005-CMake-Set-framework-install-directory.patch index c21ffb8..44701ab 100644 --- a/patches/sdl/0005-CMake-Set-framework-install-directory.patch +++ b/patches/sdl/0005-CMake-Set-framework-install-directory.patch @@ -11,12 +11,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index f32165cb7..50446f868 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1793,6 +1793,7 @@ install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets - LIBRARY DESTINATION "lib${LIB_SUFFIX}" - ARCHIVE DESTINATION "lib${LIB_SUFFIX}" - RUNTIME DESTINATION bin +@@ -2686,6 +2686,7 @@ install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + FRAMEWORK DESTINATION ${CMAKE_INSTALL_PREFIX} - PUBLIC_HEADER DESTINATION include/SDL2) + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2") ##### Export files ##### -- From e055b0d2bb7a6d0afe1c3265e06a91d00b097561 Mon Sep 17 00:00:00 2001 From: O01eg Date: Sun, 22 Dec 2024 18:25:33 +0400 Subject: [PATCH 07/18] Update SDL to 2.0.18 --- CMakeLists.txt | 6 +-- Sources.cmake | 4 +- ...b-file-for-Debug-and-RelWithDebInfo-.patch | 4 +- ...r-build-and-install-SDL2main-library.patch | 48 ++++++++++--------- ...C_HEADER-property-to-install-headers.patch | 33 +++++++------ ...4-CMake-Add-MacOSX-Framework-support.patch | 12 ++--- ...Make-Set-framework-install-directory.patch | 6 +-- 7 files changed, 59 insertions(+), 54 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab0efae..8c1eae4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -394,9 +394,9 @@ ExternalProject_Add(sdl -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_} -DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE} -DSDL_STATIC=OFF - -DDIRECTX=OFF - -DRENDER_D3D=OFF - -DVIDEO_VULKAN=OFF + -DSDL_DIRECTX=OFF + -DSDL_RENDER_D3D=OFF + -DSDL_VULKAN=OFF ${SDL_CONFIGURE_FLAGS} INSTALL_DIR ${SDL_CONFIGURE_INSTALL_DIR} ) diff --git a/Sources.cmake b/Sources.cmake index 08ba4c0..ca62c77 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.16) +set(SDL_VERSION 2.0.18) set(SDL_URL https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz) -set(SDL_MD5 98b8a1535a757ea1d03ae44e2fb20247) +set(SDL_MD5 c1dd33299db5b7091f37d989c68d5212) 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/0001-CMake-Install-pdb-file-for-Debug-and-RelWithDebInfo-.patch b/patches/sdl/0001-CMake-Install-pdb-file-for-Debug-and-RelWithDebInfo-.patch index f632d9e..0b13f9a 100644 --- a/patches/sdl/0001-CMake-Install-pdb-file-for-Debug-and-RelWithDebInfo-.patch +++ b/patches/sdl/0001-CMake-Install-pdb-file-for-Debug-and-RelWithDebInfo-.patch @@ -12,8 +12,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f1e828d1..aa17932b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1947,6 +1947,13 @@ if(NOT (WINDOWS OR CYGWIN)) - install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/aclocal") +@@ -2848,6 +2848,13 @@ if(NOT (WINDOWS OR CYGWIN)) + install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/aclocal") endif() +if(SDL_SHARED AND (MSVC_VERSION GREATER 1500) AND (NOT CMAKE_VERSION VERSION_LESS "3.1")) 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 42c2c97..7699de4 100644 --- a/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch +++ b/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch @@ -8,38 +8,40 @@ Subject: [PATCH] Never build and install SDL2main library 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index aa17932b6..3fe76072c 100644 +index d8209ca..b0a24bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -2540,16 +2540,16 @@ endif() +@@ -2670,18 +2670,18 @@ endif() # Ensure that the extra cflags are used at compile time set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") - + -# Always build SDLmain -if(NOT WINDOWS_STORE) --add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) --# alias target for in-tree builds --add_library(SDL2::SDL2main ALIAS SDL2main) --target_include_directories(SDL2main PUBLIC "$" $ $) --set(_INSTALL_LIBS "SDL2main") --if (NOT ANDROID) -- set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") --endif() +- add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) +- # alias target for in-tree builds +- 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() -endif() -+# Always build SDLmain ++# Never build SDLmain +#if(NOT WINDOWS_STORE) -+#add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) -+# alias target for in-tree builds -+#add_library(SDL2::SDL2main ALIAS SDL2main) -+#target_include_directories(SDL2main PUBLIC "$" $ $) -+#set(_INSTALL_LIBS "SDL2main") -+#if (NOT ANDROID) -+# set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") ++# add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) ++# # alias target for in-tree builds ++# 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() +#endif() -+#endif() - - if (ANDROID AND HAVE_HIDAPI) - set(_INSTALL_LIBS ${_INSTALL_LIBS} "hidapi") + + if(ANDROID) + target_include_directories(sdl-build-options INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures") -- 2.14.3 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 a64a32d..5dd2e9e 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 @@ -8,11 +8,11 @@ Subject: [PATCH] CMake: Use PUBLIC_HEADER property to install headers 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 18bcfc2..0937ac9 100644 +index b0a24bc..6a74f12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -2552,19 +2552,25 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") - #endif() +@@ -2683,6 +2683,15 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") + # endif() #endif() +file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h) @@ -22,9 +22,12 @@ index 18bcfc2..0937ac9 100644 + list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME}) +endforeach() +list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) ++install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2) + - if (ANDROID AND HAVE_HIDAPI) - set(_INSTALL_LIBS ${_INSTALL_LIBS} "hidapi") + if(ANDROID) + target_include_directories(sdl-build-options INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures") + endif() +@@ -2692,14 +2701,12 @@ if(IOS OR TVOS) endif() if(SDL_SHARED) @@ -43,7 +46,7 @@ index 18bcfc2..0937ac9 100644 set_target_properties(SDL2 PROPERTIES VERSION ${LT_VERSION} SOVERSION ${LT_MAJOR} -@@ -2620,9 +2626,11 @@ endif() +@@ -2736,9 +2743,11 @@ endif() if(SDL_STATIC) set (BUILD_SHARED_LIBS FALSE) @@ -53,20 +56,20 @@ index 18bcfc2..0937ac9 100644 add_library(SDL2::SDL2-static ALIAS SDL2-static) + set_target_properties(SDL2-static PROPERTIES + PUBLIC_HEADER "${INCLUDE_FILES}") - if (NOT SDL_SHARED OR NOT WIN32) + 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 -@@ -2664,7 +2672,8 @@ endif() +@@ -2780,7 +2789,8 @@ endif() install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}" + 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") ##### Export files ##### - if (WINDOWS) -@@ -2692,15 +2701,6 @@ install( + if (WINDOWS AND NOT MINGW) +@@ -2808,15 +2818,6 @@ install( COMPONENT Devel ) @@ -82,12 +85,12 @@ index 18bcfc2..0937ac9 100644 string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE) if (UPPER_BUILD_TYPE MATCHES DEBUG) set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") -@@ -2708,7 +2708,7 @@ else() +@@ -2824,7 +2825,7 @@ else() set(SOPOSTFIX "") endif() --if(NOT (WINDOWS OR CYGWIN OR MINGW)) -+if((NOT WINDOWS OR CYGWIN) AND (NOT BUILD_FRAMEWORK)) +-if(NOT (WINDOWS OR CYGWIN) OR MINGW) ++if((NOT (WINDOWS OR CYGWIN) OR MINGW) AND (NOT BUILD_FRAMEWORK)) if(SDL_SHARED) set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc. get_target_property(SONAME SDL2 OUTPUT_NAME) diff --git a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch index 5669018..8d06e1e 100644 --- a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch +++ b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch @@ -12,16 +12,16 @@ index ec2cdd4..c3185d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -419,6 +419,9 @@ option_string(BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal - set_option(HIDAPI "Use HIDAPI for low level joystick drivers" ${OPT_DEF_HIDAPI}) - set_option(JOYSTICK_VIRTUAL "Enable the virtual-joystick driver" ON) - set_option(ASAN "Use AddressSanitizer to detect memory errors" OFF) + set_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" ON) + set_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON) + set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors" OFF) +if(APPLE) + set_option(BUILD_FRAMEWORK "Build Framework bundle for OSX" OFF) +endif() 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") -@@ -2244,6 +2247,16 @@ if(SDL_SHARED) +@@ -2731,6 +2734,16 @@ if(SDL_SHARED) set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB") endif() set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS}) @@ -36,8 +36,8 @@ index ec2cdd4..c3185d3 100644 + OUTPUT_NAME "SDL2") + endif() target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) - target_include_directories(SDL2 PUBLIC "$" $ $) - if(ANDROID) + target_include_directories(SDL2 BEFORE PRIVATE "${SDL2_BINARY_DIR}/include") + target_include_directories(SDL2 PUBLIC "$;$;$") -- 2.14.3 diff --git a/patches/sdl/0005-CMake-Set-framework-install-directory.patch b/patches/sdl/0005-CMake-Set-framework-install-directory.patch index 44701ab..929463c 100644 --- a/patches/sdl/0005-CMake-Set-framework-install-directory.patch +++ b/patches/sdl/0005-CMake-Set-framework-install-directory.patch @@ -12,10 +12,10 @@ 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}${LIB_SUFFIX}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" -+ FRAMEWORK DESTINATION ${CMAKE_INSTALL_PREFIX} ++ FRAMEWORK DESTINATION "${CMAKE_INSTALL_PREFIX}" PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2") ##### Export files ##### From 01b9da102e579a0b903fc8ae17302b6c721a0667 Mon Sep 17 00:00:00 2001 From: O01eg Date: Sun, 22 Dec 2024 19:10:36 +0400 Subject: [PATCH 08/18] Update SDL to 2.0.20 --- Sources.cmake | 4 +- ...r-build-and-install-SDL2main-library.patch | 46 +++++++++++++++++-- ...C_HEADER-property-to-install-headers.patch | 18 ++++---- ...4-CMake-Add-MacOSX-Framework-support.patch | 2 +- ...Make-Set-framework-install-directory.patch | 14 +++--- 5 files changed, 61 insertions(+), 23 deletions(-) diff --git a/Sources.cmake b/Sources.cmake index ca62c77..8c76233 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..8a71f4f 100644 --- a/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch +++ b/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch @@ -8,10 +8,10 @@ Subject: [PATCH] Never build and install SDL2main library 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index d8209ca..b0a24bc 100644 +index f951d0e..81257e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -2670,18 +2670,18 @@ endif() +@@ -2747,17 +2747,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() @@ -42,6 +40,46 @@ index d8209ca..b0a24bc 100644 if(ANDROID) target_include_directories(sdl-build-options INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures") +@@ -2858,12 +2858,12 @@ if(SDL_SHARED) + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + endif() + +-if(NOT WINDOWS_STORE) +- install(TARGETS SDL2main EXPORT SDL2mainTargets +- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" +- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" +- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") +-endif() ++#if(NOT WINDOWS_STORE) ++# install(TARGETS SDL2main EXPORT SDL2mainTargets ++# LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++# ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++# RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") ++#endif() + + if(SDL_STATIC) + install(TARGETS SDL2-static EXPORT SDL2staticTargets +@@ -2893,13 +2893,13 @@ if(SDL_SHARED) + ) + endif() + +-if(NOT WINDOWS_STORE) +- install(EXPORT SDL2mainTargets +- FILE SDL2mainTargets.cmake +- NAMESPACE SDL2:: +- DESTINATION ${PKG_PREFIX} +- ) +-endif() ++#if(NOT WINDOWS_STORE) ++# install(EXPORT SDL2mainTargets ++# FILE SDL2mainTargets.cmake ++# NAMESPACE SDL2:: ++# DESTINATION ${PKG_PREFIX} ++# ) ++#endif() + + if(SDL_STATIC) + install(EXPORT SDL2staticTargets -- 2.14.3 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..8e84cd4 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 From 9d79590405de812bff03a31caa6aa47d11ebdf1e Mon Sep 17 00:00:00 2001 From: O01eg Date: Sun, 22 Dec 2024 19:36:29 +0400 Subject: [PATCH 09/18] Update SDL to 2.0.22 --- CMakeLists.txt | 1 + Sources.cmake | 4 +- ...b-file-for-Debug-and-RelWithDebInfo-.patch | 4 +- ...r-build-and-install-SDL2main-library.patch | 85 ----------------- ...C_HEADER-property-to-install-headers.patch | 92 ++++++++++--------- ...Make-Set-framework-install-directory.patch | 14 +-- 6 files changed, 59 insertions(+), 141 deletions(-) delete mode 100644 patches/sdl/0002-Never-build-and-install-SDL2main-library.patch diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c1eae4..3bfddfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -397,6 +397,7 @@ ExternalProject_Add(sdl -DSDL_DIRECTX=OFF -DSDL_RENDER_D3D=OFF -DSDL_VULKAN=OFF + -DSDL2_DISABLE_SDL2MAIN=ON ${SDL_CONFIGURE_FLAGS} INSTALL_DIR ${SDL_CONFIGURE_INSTALL_DIR} ) diff --git a/Sources.cmake b/Sources.cmake index 8c76233..6a8ea5c 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.20) +set(SDL_VERSION 2.0.22) set(SDL_URL https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz) -set(SDL_MD5 a53acc02e1cca98c4123229069b67c9e) +set(SDL_MD5 40aedb499cb2b6f106d909d9d97f869a) 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/0001-CMake-Install-pdb-file-for-Debug-and-RelWithDebInfo-.patch b/patches/sdl/0001-CMake-Install-pdb-file-for-Debug-and-RelWithDebInfo-.patch index 0b13f9a..9122ba0 100644 --- a/patches/sdl/0001-CMake-Install-pdb-file-for-Debug-and-RelWithDebInfo-.patch +++ b/patches/sdl/0001-CMake-Install-pdb-file-for-Debug-and-RelWithDebInfo-.patch @@ -13,7 +13,7 @@ index 8f1e828d1..aa17932b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2848,6 +2848,13 @@ if(NOT (WINDOWS OR CYGWIN)) - install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/aclocal") + endif() endif() +if(SDL_SHARED AND (MSVC_VERSION GREATER 1500) AND (NOT CMAKE_VERSION VERSION_LESS "3.1")) @@ -25,7 +25,7 @@ index 8f1e828d1..aa17932b6 100644 + ##### Uninstall target ##### - if(NOT TARGET uninstall) + if(NOT SDL2_DISABLE_UNINSTALL) -- 2.14.3 diff --git a/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch b/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch deleted file mode 100644 index 8a71f4f..0000000 --- a/patches/sdl/0002-Never-build-and-install-SDL2main-library.patch +++ /dev/null @@ -1,85 +0,0 @@ -From b8b84a04806f077a341a6014ae71ce0ac9d182ad Mon Sep 17 00:00:00 2001 -From: Marcel Metz -Date: Fri, 1 Apr 2016 17:23:05 +0200 -Subject: [PATCH] Never build and install SDL2main library - ---- - CMakeLists.txt | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f951d0e..81257e0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -2747,17 +2747,17 @@ endif() - # Ensure that the extra cflags are used at compile time - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") - --# Always build SDLmain --if(NOT WINDOWS_STORE) -- add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) -- # alias target for in-tree builds -- add_library(SDL2::SDL2main ALIAS SDL2main) -- target_include_directories(SDL2main BEFORE PRIVATE "${SDL2_BINARY_DIR}/include") -- target_include_directories(SDL2main PUBLIC "$" $ $) -- if (NOT ANDROID) -- set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") -- endif() --endif() -+# Never build SDLmain -+#if(NOT WINDOWS_STORE) -+# add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) -+# # alias target for in-tree builds -+# add_library(SDL2::SDL2main ALIAS SDL2main) -+# target_include_directories(SDL2main BEFORE PRIVATE "${SDL2_BINARY_DIR}/include") -+# target_include_directories(SDL2main PUBLIC "$" $ $) -+# if (NOT ANDROID) -+# set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") -+# endif() -+#endif() - - if(ANDROID) - target_include_directories(sdl-build-options INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures") -@@ -2858,12 +2858,12 @@ if(SDL_SHARED) - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - endif() - --if(NOT WINDOWS_STORE) -- install(TARGETS SDL2main EXPORT SDL2mainTargets -- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" -- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" -- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") --endif() -+#if(NOT WINDOWS_STORE) -+# install(TARGETS SDL2main EXPORT SDL2mainTargets -+# LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" -+# ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" -+# RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") -+#endif() - - if(SDL_STATIC) - install(TARGETS SDL2-static EXPORT SDL2staticTargets -@@ -2893,13 +2893,13 @@ if(SDL_SHARED) - ) - endif() - --if(NOT WINDOWS_STORE) -- install(EXPORT SDL2mainTargets -- FILE SDL2mainTargets.cmake -- NAMESPACE SDL2:: -- DESTINATION ${PKG_PREFIX} -- ) --endif() -+#if(NOT WINDOWS_STORE) -+# install(EXPORT SDL2mainTargets -+# FILE SDL2mainTargets.cmake -+# NAMESPACE SDL2:: -+# DESTINATION ${PKG_PREFIX} -+# ) -+#endif() - - if(SDL_STATIC) - install(EXPORT SDL2staticTargets --- -2.14.3 - 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 8e84cd4..8f87fd9 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 @@ -8,26 +8,28 @@ Subject: [PATCH] CMake: Use PUBLIC_HEADER property to install headers 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index b0a24bc..6a74f12 100644 +index 22b91ad..ab0ff17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -2683,6 +2683,15 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") - # endif() - #endif() +@@ -2874,6 +2874,17 @@ if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) + endif() + endif() -+file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h) -+file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h) -+foreach(_FNAME ${BIN_INCLUDE_FILES}) -+ get_filename_component(_INCNAME ${_FNAME} NAME) -+ list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME}) -+endforeach() -+list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) -+install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2) ++if(NOT SDL2_DISABLE_INSTALL) ++ file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h) ++ file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h) ++ foreach(_FNAME ${BIN_INCLUDE_FILES}) ++ get_filename_component(_INCNAME ${_FNAME} NAME) ++ list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME}) ++ endforeach() ++ list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) ++ install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2) ++endif() + if(ANDROID) target_include_directories(sdl-build-options INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures") endif() -@@ -2692,14 +2701,12 @@ if(IOS OR TVOS) +@@ -2883,14 +2894,12 @@ if(IOS OR TVOS) endif() if(SDL_SHARED) @@ -46,7 +48,7 @@ index b0a24bc..6a74f12 100644 set_target_properties(SDL2 PROPERTIES VERSION ${LT_VERSION} SOVERSION ${LT_MAJOR} -@@ -2736,9 +2743,11 @@ endif() +@@ -2929,9 +2938,11 @@ endif() if(SDL_STATIC) set (BUILD_SHARED_LIBS FALSE) @@ -59,41 +61,41 @@ 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 -@@ -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() +@@ -2974,7 +2985,8 @@ if(NOT SDL2_DISABLE_INSTALL) + 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() - #if(NOT WINDOWS_STORE) -@@ -2808,15 +2818,6 @@ install( - COMPONENT Devel - ) + if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) +@@ -3036,15 +3048,6 @@ if(NOT SDL2_DISABLE_INSTALL) + COMPONENT Devel + ) --file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h) --file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h) --foreach(_FNAME ${BIN_INCLUDE_FILES}) -- get_filename_component(_INCNAME ${_FNAME} NAME) -- list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME}) --endforeach() --list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) --install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2) +- file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h) +- file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h) +- foreach(_FNAME ${BIN_INCLUDE_FILES}) +- get_filename_component(_INCNAME ${_FNAME} NAME) +- list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME}) +- endforeach() +- list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) +- install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2) - - string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE) - if (UPPER_BUILD_TYPE MATCHES DEBUG) - set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") -@@ -2824,7 +2825,7 @@ else() - set(SOPOSTFIX "") - endif() + string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE) + if (UPPER_BUILD_TYPE MATCHES DEBUG) + set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") +@@ -3052,7 +3055,7 @@ if(NOT SDL2_DISABLE_INSTALL) + set(SOPOSTFIX "") + endif() --if(NOT (WINDOWS OR CYGWIN) OR MINGW) -+if((NOT (WINDOWS OR CYGWIN) OR MINGW) AND (NOT BUILD_FRAMEWORK)) - if(SDL_SHARED) - set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc. - get_target_property(SONAME SDL2 OUTPUT_NAME) +- if(NOT (WINDOWS OR CYGWIN) OR MINGW) ++ if((NOT (WINDOWS OR CYGWIN) OR MINGW) AND (NOT BUILD_FRAMEWORK)) + if(SDL_SHARED) + set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc. + get_target_property(SONAME SDL2 OUTPUT_NAME) -- 2.14.3 diff --git a/patches/sdl/0005-CMake-Set-framework-install-directory.patch b/patches/sdl/0005-CMake-Set-framework-install-directory.patch index a97586e..f944a57 100644 --- a/patches/sdl/0005-CMake-Set-framework-install-directory.patch +++ b/patches/sdl/0005-CMake-Set-framework-install-directory.patch @@ -11,13 +11,13 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index f32165cb7..50446f868 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -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() +@@ -2999,6 +2999,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() -- 2.14.3 From abe8aba3655ac7ff8245b7198ff9bd10ede0d4cb Mon Sep 17 00:00:00 2001 From: O01eg Date: Sun, 22 Dec 2024 20:11:48 +0400 Subject: [PATCH 10/18] Update SDL to 2.24.0 --- Sources.cmake | 4 +- ...C_HEADER-property-to-install-headers.patch | 101 ------------------ ...4-CMake-Add-MacOSX-Framework-support.patch | 19 +++- ...Make-Set-framework-install-directory.patch | 9 +- 4 files changed, 21 insertions(+), 112 deletions(-) delete mode 100644 patches/sdl/0003-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch diff --git a/Sources.cmake b/Sources.cmake index 6a8ea5c..14f3df9 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.22) +set(SDL_VERSION 2.24.0) set(SDL_URL https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz) -set(SDL_MD5 40aedb499cb2b6f106d909d9d97f869a) +set(SDL_MD5 cf539ffe9e0dd6f943ac9de75fd2e56e) 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/0003-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch b/patches/sdl/0003-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch deleted file mode 100644 index 8f87fd9..0000000 --- a/patches/sdl/0003-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 8a05500c8ad7b72f38ca3ff67116b1e2e4d61afa Mon Sep 17 00:00:00 2001 -From: Marcel Metz -Date: Fri, 1 Apr 2016 17:51:35 +0200 -Subject: [PATCH] CMake: Use PUBLIC_HEADER property to install headers - ---- - CMakeLists.txt | 34 ++++++++++++++++++---------------- - 1 file changed, 18 insertions(+), 16 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 22b91ad..ab0ff17 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -2874,6 +2874,17 @@ if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) - endif() - endif() - -+if(NOT SDL2_DISABLE_INSTALL) -+ file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h) -+ file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h) -+ foreach(_FNAME ${BIN_INCLUDE_FILES}) -+ get_filename_component(_INCNAME ${_FNAME} NAME) -+ list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME}) -+ endforeach() -+ list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) -+ install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2) -+endif() -+ - if(ANDROID) - target_include_directories(sdl-build-options INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures") - endif() -@@ -2883,14 +2894,12 @@ if(IOS OR TVOS) - endif() - - if(SDL_SHARED) -- add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) -+ add_library(SDL2 SHARED ${INCLUDE_FILES} ${SOURCE_FILES} ${VERSION_SOURCES}) - # alias target for in-tree builds - add_library(SDL2::SDL2 ALIAS SDL2) -- if(APPLE) -- set_target_properties(SDL2 PROPERTIES -- MACOSX_RPATH 1 -- OUTPUT_NAME "SDL2-${LT_RELEASE}") -- elseif(UNIX AND NOT ANDROID) -+ set_target_properties(SDL2 PROPERTIES -+ PUBLIC_HEADER "${INCLUDE_FILES}") -+ if(UNIX AND NOT ANDROID) - set_target_properties(SDL2 PROPERTIES - VERSION ${LT_VERSION} - SOVERSION ${LT_MAJOR} -@@ -2929,9 +2938,11 @@ endif() - - if(SDL_STATIC) - set (BUILD_SHARED_LIBS FALSE) -- add_library(SDL2-static STATIC ${SOURCE_FILES}) -+ add_library(SDL2-static STATIC ${INCLUDE_FILES} ${SOURCE_FILES}) - # alias target for in-tree builds - add_library(SDL2::SDL2-static ALIAS SDL2-static) -+ set_target_properties(SDL2-static PROPERTIES -+ PUBLIC_HEADER "${INCLUDE_FILES}") - 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 -@@ -2974,7 +2985,8 @@ if(NOT SDL2_DISABLE_INSTALL) - 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() - - if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) -@@ -3036,15 +3048,6 @@ if(NOT SDL2_DISABLE_INSTALL) - COMPONENT Devel - ) - -- file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h) -- file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h) -- foreach(_FNAME ${BIN_INCLUDE_FILES}) -- get_filename_component(_INCNAME ${_FNAME} NAME) -- list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME}) -- endforeach() -- list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) -- install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2) -- - string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE) - if (UPPER_BUILD_TYPE MATCHES DEBUG) - set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") -@@ -3052,7 +3055,7 @@ if(NOT SDL2_DISABLE_INSTALL) - set(SOPOSTFIX "") - endif() - -- if(NOT (WINDOWS OR CYGWIN) OR MINGW) -+ if((NOT (WINDOWS OR CYGWIN) OR MINGW) AND (NOT BUILD_FRAMEWORK)) - if(SDL_SHARED) - set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc. - get_target_property(SONAME SDL2 OUTPUT_NAME) --- -2.14.3 - diff --git a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch index eb05360..2e35d76 100644 --- a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch +++ b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch @@ -12,8 +12,8 @@ index ec2cdd4..c3185d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -419,6 +419,9 @@ option_string(BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal - set_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" ON) - set_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON) + dep_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" ON SDL_HIDAPI OFF) + dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_HIDAPI OFF) set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors" OFF) +if(APPLE) + set_option(BUILD_FRAMEWORK "Build Framework bundle for OSX" OFF) @@ -35,9 +35,18 @@ index ec2cdd4..c3185d3 100644 + MACOSX_RPATH ON + OUTPUT_NAME "SDL2") + endif() - target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) - target_include_directories(SDL2 BEFORE PRIVATE "${SDL2_BINARY_DIR}/include") - target_include_directories(SDL2 PUBLIC "$;$;$") + # FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS + target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD}) + target_include_directories(SDL2 PUBLIC +@@ -3052,7 +3055,7 @@ if(NOT SDL2_DISABLE_INSTALL) + set(SOPOSTFIX "") + endif() + +- if(NOT (WINDOWS OR CYGWIN) OR MINGW) ++ if((NOT (WINDOWS OR CYGWIN) OR MINGW) AND (NOT BUILD_FRAMEWORK)) + if(SDL_SHARED) + set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc. + get_target_property(SONAME SDL2 OUTPUT_NAME) -- 2.14.3 diff --git a/patches/sdl/0005-CMake-Set-framework-install-directory.patch b/patches/sdl/0005-CMake-Set-framework-install-directory.patch index f944a57..1948f8e 100644 --- a/patches/sdl/0005-CMake-Set-framework-install-directory.patch +++ b/patches/sdl/0005-CMake-Set-framework-install-directory.patch @@ -11,14 +11,15 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index f32165cb7..50446f868 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -2999,6 +2999,7 @@ install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets +@@ -3189,6 +3189,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") +- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ FRAMEWORK DESTINATION "${CMAKE_INSTALL_PREFIX}") endif() + if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) -- 2.14.3 From 3c67613dbe8afaeebe84e2e6965f32ecd440f0dc Mon Sep 17 00:00:00 2001 From: O01eg Date: Sun, 22 Dec 2024 20:18:48 +0400 Subject: [PATCH 11/18] Fix artifact names collision for Android --- .github/workflows/android-macos-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-macos-python.yml b/.github/workflows/android-macos-python.yml index abdbf12..115e26b 100644 --- a/.github/workflows/android-macos-python.yml +++ b/.github/workflows/android-macos-python.yml @@ -154,7 +154,7 @@ jobs: name: Artifacts if: ${{ !startsWith(github.ref, 'refs/tags/v') }} with: - name: python SDK + name: python ${{ matrix.ndk-arch }} SDK path: | ${{ matrix.ndk-arch == 'x86_64' && 'python39.zip' || '' }} FreeOrionSDK_${{ steps.cmake-dist-version.outputs.dist-version }}_Android-${{ matrix.ndk-arch }}.zip From b35e72149356c8dc0923f67bb29c53242c04a7f2 Mon Sep 17 00:00:00 2001 From: O01eg Date: Sun, 22 Dec 2024 21:21:39 +0400 Subject: [PATCH 12/18] Update SDL to 2.24.2 --- Sources.cmake | 4 ++-- .../0004-CMake-Add-MacOSX-Framework-support.patch | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources.cmake b/Sources.cmake index 14f3df9..5cd74be 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.24.0) +set(SDL_VERSION 2.24.2) set(SDL_URL https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz) -set(SDL_MD5 cf539ffe9e0dd6f943ac9de75fd2e56e) +set(SDL_MD5 84c71cb2a14aa0d9504513c0b9fcb17c) 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/0004-CMake-Add-MacOSX-Framework-support.patch b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch index 2e35d76..528ab96 100644 --- a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch +++ b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch @@ -8,10 +8,10 @@ Subject: [PATCH] CMake: Add MacOSX Framework support 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt -index ec2cdd4..c3185d3 100644 +index 707eb5c..af93a52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -419,6 +419,9 @@ option_string(BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal +@@ -505,6 +505,9 @@ dep_option(SDL_HIDAPI_LIBUSB "Use libusb for low level joystick drivers" O dep_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" ON SDL_HIDAPI OFF) dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_HIDAPI OFF) set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors" OFF) @@ -19,9 +19,9 @@ index ec2cdd4..c3185d3 100644 + set_option(BUILD_FRAMEWORK "Build Framework bundle for OSX" OFF) +endif() - 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) + option(SDL_SHARED "Build a shared version of the library" ${SDL_SHARED_ENABLED_BY_DEFAULT}) + option(SDL_STATIC "Build a static version of the library" ${SDL_STATIC_ENABLED_BY_DEFAULT}) +@@ -3097,6 +3100,16 @@ if(SDL_SHARED) endif() set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB") endif() @@ -38,7 +38,7 @@ index ec2cdd4..c3185d3 100644 # FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD}) target_include_directories(SDL2 PUBLIC -@@ -3052,7 +3055,7 @@ if(NOT SDL2_DISABLE_INSTALL) +@@ -3288,7 +3301,7 @@ if(NOT SDL2_DISABLE_INSTALL) set(SOPOSTFIX "") endif() From 670ff26932c165d388bc14751569d3563e4c5d0c Mon Sep 17 00:00:00 2001 From: O01eg Date: Sun, 22 Dec 2024 21:43:14 +0400 Subject: [PATCH 13/18] Update SDL to 2.26.0 --- Sources.cmake | 4 ++-- ...4-CMake-Add-MacOSX-Framework-support.patch | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Sources.cmake b/Sources.cmake index 5cd74be..5b87b33 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.24.2) +set(SDL_VERSION 2.26.0) set(SDL_URL https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz) -set(SDL_MD5 84c71cb2a14aa0d9504513c0b9fcb17c) +set(SDL_MD5 35bc58cfe41b8fb6c8e6646be26fa47e) 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/0004-CMake-Add-MacOSX-Framework-support.patch b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch index 528ab96..5f078d4 100644 --- a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch +++ b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch @@ -8,20 +8,20 @@ Subject: [PATCH] CMake: Add MacOSX Framework support 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 707eb5c..af93a52 100644 +index a596eec..7f6e574 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -505,6 +505,9 @@ dep_option(SDL_HIDAPI_LIBUSB "Use libusb for low level joystick drivers" O - dep_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" ON SDL_HIDAPI OFF) - dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_HIDAPI OFF) +@@ -514,6 +514,9 @@ dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_H set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors" OFF) + option_string(SDL_VENDOR_INFO "Vendor name and/or version to add to SDL_REVISION" "") + set_option(SDL_CCACHE "Use Ccache to speed up build" ON) +if(APPLE) + set_option(BUILD_FRAMEWORK "Build Framework bundle for OSX" OFF) +endif() - option(SDL_SHARED "Build a shared version of the library" ${SDL_SHARED_ENABLED_BY_DEFAULT}) - option(SDL_STATIC "Build a static version of the library" ${SDL_STATIC_ENABLED_BY_DEFAULT}) -@@ -3097,6 +3100,16 @@ if(SDL_SHARED) + option(SDL_WERROR "Enable -Werror" OFF) + +@@ -3320,6 +3323,16 @@ if(SDL_SHARED) endif() set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB") endif() @@ -38,10 +38,10 @@ index 707eb5c..af93a52 100644 # FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD}) target_include_directories(SDL2 PUBLIC -@@ -3288,7 +3301,7 @@ if(NOT SDL2_DISABLE_INSTALL) - set(SOPOSTFIX "") +@@ -3518,7 +3531,7 @@ if(NOT SDL2_DISABLE_INSTALL) + install(FILES ${SDL2_BINARY_DIR}/sdl2.pc + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") endif() - - if(NOT (WINDOWS OR CYGWIN) OR MINGW) + if((NOT (WINDOWS OR CYGWIN) OR MINGW) AND (NOT BUILD_FRAMEWORK)) if(SDL_SHARED) From e427d082fa239f4e429424c2e8b2778f1df2425e Mon Sep 17 00:00:00 2001 From: O01eg Date: Sun, 22 Dec 2024 22:07:44 +0400 Subject: [PATCH 14/18] Fix artifact names for Windows --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 674bdc8..e1f0fec 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -35,7 +35,7 @@ jobs: uses: actions/upload-artifact@v4 if: ${{ !startsWith(github.ref, 'refs/tags/v') }} with: - name: Windows SDK + name: Windows ${{ matrix.toolset }}-${{ matrix.arch }} SDK path: | build/FreeOrionSDK_*_MSVC-${{ matrix.toolset }}-${{ matrix.arch }}.zip - name: Prepare Release From d93ab70faf4ffb21fb4749f7239261f71907f210 Mon Sep 17 00:00:00 2001 From: O01eg Date: Mon, 23 Dec 2024 10:05:07 +0400 Subject: [PATCH 15/18] Try to fix include installation for MacOS --- ...C_HEADER-property-to-install-headers.patch | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch diff --git a/patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch b/patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch new file mode 100644 index 0000000..fb4320b --- /dev/null +++ b/patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch @@ -0,0 +1,61 @@ +From 8a05500c8ad7b72f38ca3ff67116b1e2e4d61afa Mon Sep 17 00:00:00 2001 +From: Marcel Metz +Date: Fri, 1 Apr 2016 17:51:35 +0200 +Subject: [PATCH] CMake: Use PUBLIC_HEADER property to install headers + +--- + CMakeLists.txt | 34 ++++++++++++++++++---------------- + 1 file changed, 18 insertions(+), 16 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1bc7ffb..5bc532e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3278,7 +3278,7 @@ if(APPLE) + endif() + + if(SDL_SHARED) +- add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) ++ add_library(SDL2 SHARED ${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SOURCE_FILES} ${VERSION_SOURCES}) + add_dependencies(SDL2 sdl_headers_copy) + # alias target for in-tree builds + add_library(SDL2::SDL2 ALIAS SDL2) +@@ -3291,6 +3291,8 @@ if(SDL_SHARED) + endif() + endif() + if(APPLE) ++ set_target_properties(SDL2 PROPERTIES ++ PUBLIC_HEADER "${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS}") + # FIXME: Remove SOVERSION in SDL3 + set_target_properties(SDL2 PROPERTIES + MACOSX_RPATH 1 +@@ -3356,13 +3358,15 @@ if(SDL_SHARED) + endif() + + if(SDL_STATIC) +- add_library(SDL2-static STATIC ${SOURCE_FILES}) ++ add_library(SDL2-static STATIC ${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SOURCE_FILES}) + add_dependencies(SDL2-static sdl_headers_copy) + # alias target for in-tree builds + add_library(SDL2::SDL2-static ALIAS SDL2-static) + set_target_properties(SDL2-static PROPERTIES + OUTPUT_NAME "${sdl_static_libname}" + POSITION_INDEPENDENT_CODE "${SDL_STATIC_PIC}") ++ set_target_properties(SDL2-static PROPERTIES ++ PUBLIC_HEADER "${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS}") + target_compile_definitions(SDL2-static PRIVATE SDL_STATIC_LIB) + # TODO: Win32 platforms keep the same suffix .lib for import and static + # libraries - do we need to consider this? +@@ -3410,7 +3414,8 @@ if(NOT SDL2_DISABLE_INSTALL) + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" +- FRAMEWORK DESTINATION "${CMAKE_INSTALL_PREFIX}") ++ FRAMEWORK DESTINATION "${CMAKE_INSTALL_PREFIX}" ++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2") + endif() + + if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) +-- +2.14.3 + From 5289a771ecd6b2e388773df303a1fb0b94b3fe3f Mon Sep 17 00:00:00 2001 From: O01eg Date: Mon, 23 Dec 2024 14:09:44 +0400 Subject: [PATCH 16/18] Try to add missing SDL_revision.h and SDL_config.h headers --- ...ke-Use-PUBLIC_HEADER-property-to-install-headers.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch b/patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch index fb4320b..ed34cf6 100644 --- a/patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch +++ b/patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch @@ -16,7 +16,7 @@ index 1bc7ffb..5bc532e 100644 if(SDL_SHARED) - add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) -+ add_library(SDL2 SHARED ${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SOURCE_FILES} ${VERSION_SOURCES}) ++ add_library(SDL2 SHARED ${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h ${SOURCE_FILES} ${VERSION_SOURCES}) add_dependencies(SDL2 sdl_headers_copy) # alias target for in-tree builds add_library(SDL2::SDL2 ALIAS SDL2) @@ -25,7 +25,7 @@ index 1bc7ffb..5bc532e 100644 endif() if(APPLE) + set_target_properties(SDL2 PROPERTIES -+ PUBLIC_HEADER "${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS}") ++ PUBLIC_HEADER "${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h") # FIXME: Remove SOVERSION in SDL3 set_target_properties(SDL2 PROPERTIES MACOSX_RPATH 1 @@ -34,7 +34,7 @@ index 1bc7ffb..5bc532e 100644 if(SDL_STATIC) - add_library(SDL2-static STATIC ${SOURCE_FILES}) -+ add_library(SDL2-static STATIC ${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SOURCE_FILES}) ++ add_library(SDL2-static STATIC ${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h ${SOURCE_FILES}) add_dependencies(SDL2-static sdl_headers_copy) # alias target for in-tree builds add_library(SDL2::SDL2-static ALIAS SDL2-static) @@ -42,7 +42,7 @@ index 1bc7ffb..5bc532e 100644 OUTPUT_NAME "${sdl_static_libname}" POSITION_INDEPENDENT_CODE "${SDL_STATIC_PIC}") + set_target_properties(SDL2-static PROPERTIES -+ PUBLIC_HEADER "${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS}") ++ PUBLIC_HEADER "${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h") target_compile_definitions(SDL2-static PRIVATE SDL_STATIC_LIB) # TODO: Win32 platforms keep the same suffix .lib for import and static # libraries - do we need to consider this? From 98fff575ddc837076ea4793a502b0c5db2b19e5e Mon Sep 17 00:00:00 2001 From: O01eg Date: Mon, 23 Dec 2024 18:22:23 +0400 Subject: [PATCH 17/18] Try to disable SDL Framework installation --- CMakeLists.txt | 4 +- ...4-CMake-Add-MacOSX-Framework-support.patch | 52 ---------------- ...Make-Set-framework-install-directory.patch | 25 -------- ...C_HEADER-property-to-install-headers.patch | 61 ------------------- 4 files changed, 2 insertions(+), 140 deletions(-) delete mode 100644 patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch delete mode 100644 patches/sdl/0005-CMake-Set-framework-install-directory.patch delete mode 100644 patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bfddfb..1115756 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -374,9 +374,9 @@ if(WIN32) else() set(SDL_CONFIGURE_FLAGS -DBUILD_SHARED_LIBS=ON - -DBUILD_FRAMEWORK=ON + -DBUILD_FRAMEWORK=OFF ) - set(SDL_CONFIGURE_INSTALL_DIR ${SDK_INSTALL_DIR}/Frameworks) + set(SDL_CONFIGURE_INSTALL_DIR ${SDK_INSTALL_DIR}) endif() ExternalProject_PatchSet(sdl SDL_PATCHSET) diff --git a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch deleted file mode 100644 index 5f078d4..0000000 --- a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 43524a3266a76d091e41c4aca86e009fd06bae9d Mon Sep 17 00:00:00 2001 -From: Marcel Metz -Date: Fri, 1 Apr 2016 18:10:19 +0200 -Subject: [PATCH] CMake: Add MacOSX Framework support - ---- - CMakeLists.txt | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a596eec..7f6e574 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -514,6 +514,9 @@ dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_H - set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors" OFF) - option_string(SDL_VENDOR_INFO "Vendor name and/or version to add to SDL_REVISION" "") - set_option(SDL_CCACHE "Use Ccache to speed up build" ON) -+if(APPLE) -+ set_option(BUILD_FRAMEWORK "Build Framework bundle for OSX" OFF) -+endif() - - option(SDL_WERROR "Enable -Werror" OFF) - -@@ -3320,6 +3323,16 @@ if(SDL_SHARED) - endif() - set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB") - endif() -+ if(APPLE AND BUILD_FRAMEWORK) -+ set_target_properties(SDL2 PROPERTIES -+ FRAMEWORK TRUE -+ FRAMEWORK_VERSION ${SDL_VERSION} -+ MACOSX_FRAMEWORK_IDENTIFIER org.libsdl.SDL2 -+ MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${SDL_VERSION} -+ MACOSX_FRAMEWORK_BUNDLE_VERSION ${SDL_VERSION} -+ MACOSX_RPATH ON -+ OUTPUT_NAME "SDL2") -+ endif() - # FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS - target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD}) - target_include_directories(SDL2 PUBLIC -@@ -3518,7 +3531,7 @@ if(NOT SDL2_DISABLE_INSTALL) - install(FILES ${SDL2_BINARY_DIR}/sdl2.pc - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") - endif() -- if(NOT (WINDOWS OR CYGWIN) OR MINGW) -+ if((NOT (WINDOWS OR CYGWIN) OR MINGW) AND (NOT BUILD_FRAMEWORK)) - if(SDL_SHARED) - set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc. - get_target_property(SONAME SDL2 OUTPUT_NAME) --- -2.14.3 - diff --git a/patches/sdl/0005-CMake-Set-framework-install-directory.patch b/patches/sdl/0005-CMake-Set-framework-install-directory.patch deleted file mode 100644 index 1948f8e..0000000 --- a/patches/sdl/0005-CMake-Set-framework-install-directory.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 4243d36624b0ab5bf80c3ab9c0269e419a4beb09 Mon Sep 17 00:00:00 2001 -From: Marcel Metz -Date: Fri, 1 Apr 2016 18:58:04 +0200 -Subject: [PATCH] CMake: Set framework install directory - ---- - CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f32165cb7..50446f868 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -3189,6 +3189,7 @@ 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}" -+ FRAMEWORK DESTINATION "${CMAKE_INSTALL_PREFIX}") - endif() - - if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) --- -2.14.3 - diff --git a/patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch b/patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch deleted file mode 100644 index ed34cf6..0000000 --- a/patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 8a05500c8ad7b72f38ca3ff67116b1e2e4d61afa Mon Sep 17 00:00:00 2001 -From: Marcel Metz -Date: Fri, 1 Apr 2016 17:51:35 +0200 -Subject: [PATCH] CMake: Use PUBLIC_HEADER property to install headers - ---- - CMakeLists.txt | 34 ++++++++++++++++++---------------- - 1 file changed, 18 insertions(+), 16 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1bc7ffb..5bc532e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -3278,7 +3278,7 @@ if(APPLE) - endif() - - if(SDL_SHARED) -- add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) -+ add_library(SDL2 SHARED ${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h ${SOURCE_FILES} ${VERSION_SOURCES}) - add_dependencies(SDL2 sdl_headers_copy) - # alias target for in-tree builds - add_library(SDL2::SDL2 ALIAS SDL2) -@@ -3291,6 +3291,8 @@ if(SDL_SHARED) - endif() - endif() - if(APPLE) -+ set_target_properties(SDL2 PROPERTIES -+ PUBLIC_HEADER "${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h") - # FIXME: Remove SOVERSION in SDL3 - set_target_properties(SDL2 PROPERTIES - MACOSX_RPATH 1 -@@ -3356,13 +3358,15 @@ if(SDL_SHARED) - endif() - - if(SDL_STATIC) -- add_library(SDL2-static STATIC ${SOURCE_FILES}) -+ add_library(SDL2-static STATIC ${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h ${SOURCE_FILES}) - add_dependencies(SDL2-static sdl_headers_copy) - # alias target for in-tree builds - add_library(SDL2::SDL2-static ALIAS SDL2-static) - set_target_properties(SDL2-static PROPERTIES - OUTPUT_NAME "${sdl_static_libname}" - POSITION_INDEPENDENT_CODE "${SDL_STATIC_PIC}") -+ set_target_properties(SDL2-static PROPERTIES -+ PUBLIC_HEADER "${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h") - target_compile_definitions(SDL2-static PRIVATE SDL_STATIC_LIB) - # TODO: Win32 platforms keep the same suffix .lib for import and static - # libraries - do we need to consider this? -@@ -3410,7 +3414,8 @@ if(NOT SDL2_DISABLE_INSTALL) - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" -- FRAMEWORK DESTINATION "${CMAKE_INSTALL_PREFIX}") -+ FRAMEWORK DESTINATION "${CMAKE_INSTALL_PREFIX}" -+ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2") - endif() - - if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) --- -2.14.3 - From a6f1d2793a6f582ba8da19a14afa04c1b4c9089c Mon Sep 17 00:00:00 2001 From: O01eg Date: Wed, 25 Dec 2024 10:40:18 +0400 Subject: [PATCH 18/18] Fix so-names for SDL on MacOS --- patches/sdl/0002-CMake-Remove-so-names.patch | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 patches/sdl/0002-CMake-Remove-so-names.patch diff --git a/patches/sdl/0002-CMake-Remove-so-names.patch b/patches/sdl/0002-CMake-Remove-so-names.patch new file mode 100644 index 0000000..e118432 --- /dev/null +++ b/patches/sdl/0002-CMake-Remove-so-names.patch @@ -0,0 +1,36 @@ +From b9cfc3565b4d56adc5f022a5ab18c89959bc9476 Mon Sep 17 00:00:00 2001 +From: O01eg +Date: Wed, 25 Dec 2024 10:40:02 +0400 +Subject: [PATCH 2/2] CMake: Remove so-names + +--- + CMakeLists.txt | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a596eec..b509bb3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3290,9 +3290,7 @@ if(SDL_SHARED) + if(APPLE) + # FIXME: Remove SOVERSION in SDL3 + set_target_properties(SDL2 PROPERTIES +- MACOSX_RPATH 1 +- SOVERSION 0 +- OUTPUT_NAME "SDL2-${LT_RELEASE}") ++ MACOSX_RPATH 1) + elseif(UNIX AND NOT ANDROID) + set_target_properties(SDL2 PROPERTIES + VERSION ${LT_VERSION} +@@ -3518,7 +3516,7 @@ if(NOT SDL2_DISABLE_INSTALL) + install(FILES ${SDL2_BINARY_DIR}/sdl2.pc + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + endif() +- if(NOT (WINDOWS OR CYGWIN) OR MINGW) ++ if(NOT (WINDOWS OR CYGWIN OR APPLE) OR MINGW) + if(SDL_SHARED) + set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc. + get_target_property(SONAME SDL2 OUTPUT_NAME) +-- +2.45.2 +