From 2703e862f4d081f09a95fda3439faed309145ef8 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Wed, 2 Mar 2022 12:45:23 +0100 Subject: [PATCH] Add mingw-SDL2_lmingw32.patch --- mingw-SDL2.spec | 10 +++++++++- mingw-SDL2_lmingw32.patch | 12 ++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 mingw-SDL2_lmingw32.patch diff --git a/mingw-SDL2.spec b/mingw-SDL2.spec index e065485..34ec2cb 100644 --- a/mingw-SDL2.spec +++ b/mingw-SDL2.spec @@ -2,12 +2,17 @@ Name: mingw-SDL2 Version: 2.0.20 -Release: 2%{?dist} +Release: 3%{?dist} Summary: MinGW Windows port of SDL2 cross-platform multimedia library License: LGPLv2+ URL: http://www.libsdl.org/ Source0: http://www.libsdl.org/release/SDL2-%{version}.tar.gz +# Fix -lmingw32 order in in SDL_LIBS +# The link order must be -lmingw32 -lSDL2main -lSDL2, otherwise +# undefined reference to `WinMain@16' +# appers in consumers +Patch0: mingw-SDL2_lmingw32.patch BuildArch: noarch @@ -122,6 +127,9 @@ device. %changelog +* Wed Mar 02 2022 Sandro Mani - 2.0.22-3 +- Add mingw-SDL2_lmingw32.patch + * Thu Jan 20 2022 Fedora Release Engineering - 2.0.20-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/mingw-SDL2_lmingw32.patch b/mingw-SDL2_lmingw32.patch new file mode 100644 index 0000000..8f82d45 --- /dev/null +++ b/mingw-SDL2_lmingw32.patch @@ -0,0 +1,12 @@ +diff -rupN SDL2-2.0.20/CMakeLists.txt SDL2-2.0.20-new/CMakeLists.txt +--- SDL2-2.0.20/CMakeLists.txt 2022-01-08 22:13:56.000000000 +0100 ++++ SDL2-2.0.20-new/CMakeLists.txt 2022-03-02 12:41:51.634494670 +0100 +@@ -1787,7 +1787,7 @@ elseif(WINDOWS) + list(APPEND EXTRA_LIBS mingw32) + list(APPEND EXTRA_LDFLAGS "-mwindows") + set(SDL_CFLAGS "${SDL_CFLAGS} -Dmain=SDL_main") +- list(APPEND SDL_LIBS "-lmingw32" "-lSDL2main" "-mwindows") ++ list(APPEND SDL_LIBS "-lSDL2main" "-lmingw32" "-mwindows") + endif() + + elseif(APPLE)