commit f231010616b06c0547582e4a789517c11405af49
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Sat Jul 28 18:09:34 2018 +0100
Try fix rfbz #4962
Use the same SDL that wxGTK depends on (F27 SDL, F28 SDL2)
pcsx2-wxWidgets-SDL2.patch | 74 ++++++++++++++++++++++++++++++++++++++++++++++
pcsx2.spec | 15 ++++++++--
2 files changed, 86 insertions(+), 3 deletions(-)
---
diff --git a/pcsx2-wxWidgets-SDL2.patch b/pcsx2-wxWidgets-SDL2.patch
new file mode 100644
index 0000000..ce313ae
--- /dev/null
+++ b/pcsx2-wxWidgets-SDL2.patch
@@ -0,0 +1,74 @@
+From 41c49faa81d4970e903e7d85616774c979e103a5 Mon Sep 17 00:00:00 2001
+From: Jonathan Li <jonathan.li(a)hotmail.co.uk>
+Date: Sun, 4 Feb 2018 14:04:17 +0000
+Subject: [PATCH] cmake: Improve wxWidgets and SDL linkage check
+
+If wxWidgets is linked to SDL, check what version it's actually linked
+against instead of assuming it's linked to SDL1.2 (which isn't true on
+Fedora 27).
+---
+ cmake/ApiValidation.cmake | 41 ++++++++++++++++++++++++++++-------------
+ 1 file changed, 28 insertions(+), 13 deletions(-)
+
+diff --git a/cmake/ApiValidation.cmake b/cmake/ApiValidation.cmake
+index e7a4f99a77..f93bc67fcd 100644
+--- a/cmake/ApiValidation.cmake
++++ b/cmake/ApiValidation.cmake
+@@ -1,9 +1,14 @@
+ set(wx_sdl_c_code "
+ #include <wx/setup.h>
+
+-#if (wxUSE_LIBSDL != 0)
++#if (wxUSE_LIBSDL == 0)
+ #error cmake_WX_SDL
+ #endif
++
++int main()
++{
++ return 0;
++}
+ ")
+
+ set(gcc7_mmx_code "
+@@ -83,19 +88,29 @@ function(WX_vs_SDL)
+ file(WRITE "${CMAKE_BINARY_DIR}/wx_sdl.c" "${wx_sdl_c_code}")
+ enable_language(C)
+
+- try_run(
+- run_result_unused
+- compile_result_unused
+- "${CMAKE_BINARY_DIR}"
+- "${CMAKE_BINARY_DIR}/wx_sdl.c"
+- COMPILE_OUTPUT_VARIABLE OUT
+- CMAKE_FLAGS
"-DINCLUDE_DIRECTORIES:STRING=${wxWidgets_INCLUDE_DIRS}"
+- )
++ try_compile(
++ wx_linked_to_sdl
++ "${CMAKE_BINARY_DIR}"
++ "${CMAKE_BINARY_DIR}/wx_sdl.c"
++ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${wxWidgets_INCLUDE_DIRS}"
++ LINK_LIBRARIES "${wxWidgets_LIBRARIES}"
++ COPY_FILE "${CMAKE_BINARY_DIR}/wx_sdl"
++ )
++
++ if (NOT wx_linked_to_sdl)
++ return()
++ endif()
++
++ execute_process(
++ COMMAND ldd "${CMAKE_BINARY_DIR}/wx_sdl"
++ COMMAND grep -c SDL2
++ OUTPUT_VARIABLE sdl2_count
++ )
+
+- if (${OUT} MATCHES "cmake_WX_SDL" AND SDL2_API)
+- message(FATAL_ERROR "WxWidget is linked to SDL (wxUSE_LIBSDL) and it is
likely SDL1.2.
+- Unfortunately you try to build PCSX2 with SDL2 support which is not compatible
+- Please use -DSDL2_API=FALSE")
++ if (SDL2_API AND sdl2_count STREQUAL "0")
++ message(FATAL_ERROR "wxWidgets is linked to SDL1.2. Please use
-DSDL2_API=FALSE.")
++ elseif (NOT SDL2_API AND NOT sdl2_count STREQUAL "0")
++ message(FATAL_ERROR "wxWidgets is linked to SDL2. Please use
-DSDL2_API=TRUE")
+ endif()
+ endfunction()
+
diff --git a/pcsx2.spec b/pcsx2.spec
index 73b049a..ff9cb39 100644
--- a/pcsx2.spec
+++ b/pcsx2.spec
@@ -1,6 +1,6 @@
Name: pcsx2
Version: 1.4
-Release: 9%{?dist}
+Release: 10%{?dist}
Summary: A Sony Playstation2 emulator
License: GPLv3
URL:
https://github.com/PCSX2/pcsx2
@@ -9,6 +9,7 @@ URL:
https://github.com/PCSX2/pcsx2
Source0: pcsx2.1.4.tar.gz
Source1: download_pcsx2_1.4_tarball.sh
Patch1: pcsx2-gcc6.patch
+Patch2: pcsx2-wxWidgets-SDL2.patch
# PCSX2 does not support running as a 64 bit application.
#
http://code.google.com/p/pcsx2/wiki/ChrootAnd64bStatusLinux
ExclusiveArch: i686
@@ -26,12 +27,16 @@ BuildRequires: libICE-devel
BuildRequires: libXrandr-devel
BuildRequires: mesa-libGLES-devel
BuildRequires: alsa-lib-devel
-BuildRequires: SDL-devel
-#BuildRequires: SDL2-devel
BuildRequires: gtk2-devel
#BuildRequires: gtk3-devel
BuildRequires: portaudio-devel
BuildRequires: sparsehash-devel
+%if (0%{?fedora} >= 28)
+BuildRequires: SDL2-devel
+%else
+BuildRequires: SDL-devel
+%endif
+# use SDL that depends wxGTK
%if (0%{?fedora} >= 27)
BuildRequires: compat-wxGTK3-gtk2-devel
%else
@@ -163,6 +168,10 @@ fi
%changelog
+* Sat Jul 28 2018 Sérgio Basto <sergio(a)serjux.com> - 1.4-10
+- Try fix rfbz #4962
+- Use the same SDL that wxGTK depends on (F27 SDL, F28 SDL2)
+
* Fri Jul 27 2018 RPM Fusion Release Engineering <sergio(a)serjux.com> - 1.4-9
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild