From 6835eb7d3527c96c6a3385959ce3817123e3859f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 20 Aug 2022 09:59:37 +0300 Subject: [PATCH] aedi: update sdl2 to 2.24.0 --- aedi/target/library_tier2.py | 46 +++----------------- patch/sdl2-no-gamecontroller+corehaptic.diff | 2 +- patch/sdl2-no-updaterev.diff | 4 +- 3 files changed, 9 insertions(+), 43 deletions(-) diff --git a/aedi/target/library_tier2.py b/aedi/target/library_tier2.py index 05ed4368..e9488561 100644 --- a/aedi/target/library_tier2.py +++ b/aedi/target/library_tier2.py @@ -236,51 +236,17 @@ class Sdl2Target(CMakeStaticDependencyTarget): def prepare_source(self, state: BuildState): state.download_source( - 'https://libsdl.org/release/SDL2-2.0.22.tar.gz', - 'fe7cbf3127882e3fc7259a75a0cb585620272c51745d3852ab9dd87960697f2e', + 'https://github.com/libsdl-org/SDL/releases/download/release-2.24.0/SDL2-2.24.0.tar.gz', + '91e4c34b1768f92d399b078e171448c6af18cafda743987ed2064a28954d6d97', patches=('sdl2-no-updaterev', 'sdl2-no-gamecontroller+corehaptic')) - FRAMEWORKS = '-framework AudioToolbox -framework AVFoundation -framework Carbon' \ - ' -framework Cocoa -framework CoreAudio -framework CoreVideo -framework ForceFeedback' \ - ' -framework Foundation -framework IOKit -framework Metal -framework QuartzCore' - LINKER_FLAGS = ' -L${libdir} -lSDL2 ' + FRAMEWORKS + os.linesep - def configure(self, state: BuildState): - state.options['SDL_STATIC_PIC'] = 'YES' + opts = state.options + opts['SDL_STATIC_PIC'] = 'YES' + opts['SDL_TEST'] = 'NO' + super().configure(state) - def post_build(self, state: BuildState): - super().post_build(state) - - def update_sdl2_config(_: Path, line: str): - if line.startswith('# '): - return None - elif line.startswith(' echo -I'): - return ' echo -I${prefix}/include/SDL2 -D_THREAD_SAFE\n' - elif line.startswith(' echo -L'): - return ' echo' + Sdl2Target.LINKER_FLAGS - - return line - - self.update_config_script(state.install_path / 'bin/sdl2-config', update_sdl2_config) - - def update_targets_cmake(line: str): - libs = ' INTERFACE_LINK_LIBRARIES ' - return f'{libs}"{Sdl2Target.FRAMEWORKS}"\n' if line.startswith(libs) else line - - for suffix in ('', '-release'): - file_path = state.install_path / f'lib/cmake/SDL2/SDL2staticTargets{suffix}.cmake' - self.update_text_file(file_path, update_targets_cmake) - - @staticmethod - def _process_pkg_config(pcfile: Path, line: str) -> str: - libs = 'Libs:' - - if line.startswith(libs): - return libs + Sdl2Target.LINKER_FLAGS - - return line - class Sdl2ImageTarget(CMakeStaticDependencyTarget): def __init__(self, name='sdl2_image'): diff --git a/patch/sdl2-no-gamecontroller+corehaptic.diff b/patch/sdl2-no-gamecontroller+corehaptic.diff index c85eefa1..63f414a5 100644 --- a/patch/sdl2-no-gamecontroller+corehaptic.diff +++ b/patch/sdl2-no-gamecontroller+corehaptic.diff @@ -1,6 +1,6 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1902,7 +1902,7 @@ +@@ -1990,7 +1990,7 @@ #import #import int main() { return 0; }" HAVE_FRAMEWORK_COREHAPTICS) diff --git a/patch/sdl2-no-updaterev.diff b/patch/sdl2-no-updaterev.diff index 08880554..56010e9b 100644 --- a/patch/sdl2-no-updaterev.diff +++ b/patch/sdl2-no-updaterev.diff @@ -1,6 +1,6 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -2643,7 +2643,7 @@ +@@ -2788,7 +2788,7 @@ # Compat helpers for the configuration files find_package(Git) @@ -9,7 +9,7 @@ execute_process(COMMAND "${GIT_EXECUTABLE}" remote get-url origin WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" -@@ -2664,7 +2664,7 @@ +@@ -2809,7 +2809,7 @@ set(SDL_REVISION "") endif() else()