File pcsx2-PR3832.patch of Package pcsx2-git

From 6cd4f378c9c9b20331b599eef25b8dd7eb11321c Mon Sep 17 00:00:00 2001
From: Shanoah Alkire <arcum42@gmail.com>
Date: Thu, 15 Oct 2020 21:56:07 -0700
Subject: [PATCH 1/4] Remove version and platform checks for wxwidgets. It's
 probably better to find *something* rather then fail because you have 3.1.2
 and the build was looking for 3.0 when both work.

---
 cmake/SearchForStuff.cmake | 34 +++++++++++++++++++++-------------
 1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake
index 7a3871535f..ea24887903 100644
--- a/cmake/SearchForStuff.cmake
+++ b/cmake/SearchForStuff.cmake
@@ -20,6 +20,7 @@ set(OpenGL_GL_PREFERENCE GLVND)
 find_package(OpenGL)
 find_package(PNG)
 find_package(Vtune)
+
 # The requirement of wxWidgets is checked in SelectPcsx2Plugins module
 # Does not require the module (allow to compile non-wx plugins)
 # Force the unicode build (the variable is only supported on cmake 2.8.3 and above)
@@ -35,13 +36,15 @@ else()
     set(wxWidgets_CONFIG_OPTIONS --unicode=yes)
 endif()
 
-list(APPEND wxWidgets_CONFIG_OPTIONS --version=3.0)
+# I'm removing the version check, because it excludes newer versions and requires specifically 3.0.
+#list(APPEND wxWidgets_CONFIG_OPTIONS --version=3.0)
 
-if(GTK3_API AND NOT APPLE)
-    list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk3)
-elseif(NOT APPLE)
-    list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk2)
-endif()
+# Let's not specifically require Gtk 2 or 3, either. As long as you have wx there...
+#if(GTK3_API AND NOT APPLE)
+#    list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk3)
+#elseif(NOT APPLE)
+#    list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk2)
+#endif()
 
 # wx2.8 => /usr/bin/wx-config-2.8
 # lib32-wx2.8 => /usr/bin/wx-config32-2.8
@@ -66,9 +69,21 @@ else()
     if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
         set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk3u-3.0-config")
     endif()
+    if(EXISTS "/usr/bin/wx-config-3.2")
+        set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.2")
+    endif()
+    if(EXISTS "/usr/bin/wx-config-3.1")
+        set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.1")
+    endif()
     if(EXISTS "/usr/bin/wx-config-3.0")
         set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.0")
     endif()
+    if(EXISTS "/usr/bin/wx-config")
+        set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config")
+    endif()
+    if(EXISTS "/usr/bin/wx-config-gtk3")
+        set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-gtk3")
+    endif()
 endif()
 
 find_package(wxWidgets COMPONENTS base core adv)
@@ -77,13 +92,6 @@ find_package(ZLIB)
 ## Use pcsx2 package to find module
 include(FindLibc)
 
-## Only needed by the extra plugins
-if(EXTRA_PLUGINS)
-    include(FindCg)
-    include(FindGlew)
-    find_package(JPEG)
-endif()
-
 ## Use CheckLib package to find module
 include(CheckLib)
 if(Linux)

From 5942bf589fc3183024e7c70f624a3cb05a1375d2 Mon Sep 17 00:00:00 2001
From: Shanoah Alkire <arcum42@gmail.com>
Date: Fri, 16 Oct 2020 11:18:31 -0700
Subject: [PATCH 2/4] Build gtk 3 by default. Replace gtk 3 flag with one for
 gtk 2.

---
 build.sh                    |  2 +-
 cmake/BuildParameters.cmake | 12 +-----------
 cmake/SearchForStuff.cmake  | 28 ++++++++++++++--------------
 3 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/build.sh b/build.sh
index 0df5553fc0..56924fe0e1 100755
--- a/build.sh
+++ b/build.sh
@@ -207,7 +207,7 @@ for ARG in "$@"; do
         --sdl12             ) flags="$flags -DSDL2_API=FALSE" ;;
         --extra             ) flags="$flags -DEXTRA_PLUGINS=TRUE" ;;
         --asan              ) flags="$flags -DUSE_ASAN=TRUE" ;;
-        --gtk3              ) flags="$flags -DGTK3_API=TRUE" ;;
+        --gtk2              ) flags="$flags -DGTK2_API=TRUE" ;;
         --lto               ) flags="$flags -DUSE_LTO=TRUE" ;;
         --pgo-optimize      ) flags="$flags -DUSE_PGO_OPTIMIZE=TRUE" ;;
         --pgo-generate      ) flags="$flags -DUSE_PGO_GENERATE=TRUE" ;;
diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake
index 195315e12e..e6abe893b6 100644
--- a/cmake/BuildParameters.cmake
+++ b/cmake/BuildParameters.cmake
@@ -46,7 +46,7 @@ option(XDG_STD "Use XDG standard path instead of the standard PCSX2 path")
 option(EXTRA_PLUGINS "Build various 'extra' plugins")
 option(PORTAUDIO_API "Build portaudio support on spu2x" ON)
 option(SDL2_API "Use SDL2 on spu2x and onepad (wxWidget mustn't be built with SDL1.2 support" ON)
-option(GTK3_API "Use GTK3 api (experimental/wxWidget must be built with GTK3 support)")
+option(GTK2_API "Use GTK2 api (legacy)")
 
 if(PACKAGE_MODE)
     if(NOT DEFINED PLUGIN_DIR)
@@ -434,16 +434,6 @@ endif()
 # Use some default machine flags
 string(STRIP "${CMAKE_CXX_FLAGS} ${DEFAULT_CPP_FLAG}" CMAKE_CXX_FLAGS)
 
-#-------------------------------------------------------------------------------
-# Too much user/packager use experimental flags as release flags
-#-------------------------------------------------------------------------------
-if(CMAKE_BUILD_TYPE MATCHES "Release" OR PACKAGE_MODE)
-    if (GTK3_API)
-        message(WARNING "GTK3 is highly experimental besides it requires a wxWidget built with __WXGTK3__ support !!!")
-    endif()
-endif()
-
-
 #-------------------------------------------------------------------------------
 # MacOS-specific things
 #-------------------------------------------------------------------------------
diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake
index ea24887903..1a53942ae9 100644
--- a/cmake/SearchForStuff.cmake
+++ b/cmake/SearchForStuff.cmake
@@ -40,10 +40,10 @@ endif()
 #list(APPEND wxWidgets_CONFIG_OPTIONS --version=3.0)
 
 # Let's not specifically require Gtk 2 or 3, either. As long as you have wx there...
-#if(GTK3_API AND NOT APPLE)
-#    list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk3)
-#elseif(NOT APPLE)
+#if(GTK2_API AND NOT APPLE)
 #    list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk2)
+#elseif(NOT APPLE)
+#    list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk3)
 #endif()
 
 # wx2.8 => /usr/bin/wx-config-2.8
@@ -124,14 +124,14 @@ endif()
 if(UNIX)
     find_package(X11)
     # Most plugins (if not all) and PCSX2 core need gtk2, so set the required flags
-    if (GTK3_API)
-        if(CMAKE_CROSSCOMPILING)
-            find_package(GTK3 REQUIRED gtk)
-        else()
-            check_lib(GTK3 gtk+-3.0 gtk/gtk.h)
-        endif()
+    if (GTK2_API)
+    find_package(GTK2 REQUIRED gtk)
+    else()
+    if(CMAKE_CROSSCOMPILING)
+        find_package(GTK3 REQUIRED gtk)
     else()
-        find_package(GTK2 REQUIRED gtk)
+        check_lib(GTK3 gtk+-3.0 gtk/gtk.h)
+    endif()
     endif()
 endif()
 
@@ -139,12 +139,12 @@ endif()
 #		    Use system include
 #----------------------------------------
 if(UNIX)
-	if(GTK2_FOUND)
-		include_directories(${GTK2_INCLUDE_DIRS})
-    elseif(GTK3_FOUND)
-		include_directories(${GTK3_INCLUDE_DIRS})
+	if(GTK3_FOUND)
+        include_directories(${GTK3_INCLUDE_DIRS})
         # A lazy solution
         set(GTK2_LIBRARIES ${GTK3_LIBRARIES})
+    elseif(GTK2_FOUND)
+        include_directories(${GTK2_INCLUDE_DIRS})
 	endif()
 
 	if(X11_FOUND)

From d1ef39724291efdf6084d1292facf716cffbe278 Mon Sep 17 00:00:00 2001
From: Shanoah Alkire <arcum42@gmail.com>
Date: Fri, 16 Oct 2020 11:41:46 -0700
Subject: [PATCH 3/4] Remove two unused cmake modules.

---
 cmake/FindCg.cmake   | 75 --------------------------------------------
 cmake/FindGlew.cmake | 51 ------------------------------
 2 files changed, 126 deletions(-)
 delete mode 100644 cmake/FindCg.cmake
 delete mode 100644 cmake/FindGlew.cmake

diff --git a/cmake/FindCg.cmake b/cmake/FindCg.cmake
deleted file mode 100644
index 2981000762..0000000000
--- a/cmake/FindCg.cmake
+++ /dev/null
@@ -1,75 +0,0 @@
-# Find a NVidia Cg Toolkit installation
-# This module finds a NVidia Cg Toolkit installation.
-
-# CG_FOUND			found Cg
-# CG_INCLUDE_DIRS	include path to cg.h
-# CG_LIBRARIES		path to Cg libs
-# CG_COMPILER		path to Cg compiler
-
-# find Cg on Windows
-if(WIN32)
-	# find Cg compiler
-	find_program(CG_COMPILER cgc PATHS
-				 "C:/Program Files/NVIDIA Corporation/cg/bin"
-				 DOC "Path to the Cg compiler.")
-			 
-	# find Cg include
-	find_path(CG_INCLUDE_DIRS NAMES Cg/cg.h GL/glext.h PATHS
-			  "C:/Program Files/NVIDIA Corporation/cg/include"
-			  DOC "Path to the Cg/GL includes.")
-	
-	# find Cg libraries
-	# Cg library
-	find_library(CG_LIBRARY NAMES Cg PATHS
-				 "C:/Program Files/NVIDIA Corporation/cg/lib"
-				 DOC "Path to the Cg library.")
-
-	# Cg GL library
-	find_library(CG_GL_LIBRARY NAMES CgGL PATHS
-				 "C:/Program Files/NVIDIA Corporation/cg/lib"
-				 DOC "Path to the CgGL library.")
-
-	set(CG_LIBRARIES ${CG_LIBRARY} ${CG_GL_LIBRARY})
-
-else(WIN32) # Unix based OS
-	# find Cg compiler
-	find_program(CG_COMPILER cgc PATHS
-				 /usr/bin
-				 /usr/local/bin
-				/opt/nvidia-cg-toolkit/bin
-				 DOC "Path to the Cg compiler.")
-	
-	# find Cg include
-	find_path(CG_INCLUDE_DIRS NAMES Cg/cg.h GL/glext.h PATHS
-			  /usr/include
-			  /usr/local/include
-			  /opt/nvidia-cg-toolkit/include
-			  DOC "Path to the Cg/GL includes.")
-	
-	# find Cg libraries
-	# Cg library
-	find_library(CG_LIBRARY NAMES Cg PATHS
-				 /usr/include
-				 /usr/local/lib
-				 /opt/nvidia-cg-toolkit/lib	
-				 /opt/nvidia-cg-toolkit/lib32
-				 DOC "Path to the Cg library.")
-
-	# Cg GL library
-	find_library(CG_GL_LIBRARY NAMES CgGL PATHS
-				 /usr/include
-				 /usr/local/lib
-				 /opt/nvidia-cg-toolkit/lib
-				 /opt/nvidia-cg-toolkit/lib32
-				 DOC "Path to the CgGL library.")
-
-	set(CG_LIBRARIES ${CG_LIBRARY} ${CG_GL_LIBRARY})
-endif(WIN32)
-
-# handle the QUIETLY and REQUIRED arguments and set CG_FOUND to TRUE if 
-# all listed variables are TRUE
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Cg DEFAULT_MSG CG_LIBRARIES CG_INCLUDE_DIRS)
-
-mark_as_advanced(CG_FOUND CG_INCLUDE_DIRS CG_LIBRARIES CG_COMPILER)
-
diff --git a/cmake/FindGlew.cmake b/cmake/FindGlew.cmake
deleted file mode 100644
index d9e206e1a8..0000000000
--- a/cmake/FindGlew.cmake
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Try to find GLEW library and include path.
-# Once done this will define
-#
-# GLEW_FOUND - system has GLEW
-# GLEW_INCLUDE_DIR - the GLEW include directories
-# GLEW_LIBRARY - link these to use GLEW
-# 
-
-if(GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
-    set(GLEW_FIND_QUIETLY TRUE)
-endif(GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
-
-IF (WIN32)
-    FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
-		$ENV{PROGRAMFILES}/GLEW/include
-		${CMAKE_SOURCE_DIR}/src/nvgl/glew/include
-		DOC "The directory where GL/glew.h resides")
-	FIND_LIBRARY( GLEW_LIBRARY
-		NAMES glew GLEW glew32 glew32s
-		PATHS
-		$ENV{PROGRAMFILES}/GLEW/lib
-		${CMAKE_SOURCE_DIR}/src/nvgl/glew/bin
-		${CMAKE_SOURCE_DIR}/src/nvgl/glew/lib
-		DOC "The GLEW library")
-ELSE (WIN32)
-    FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
-		/usr/include
-		/usr/local/include
-		/sw/include
-		/opt/local/include
-		DOC "The directory where GL/glew.h resides")
-	FIND_LIBRARY( GLEW_LIBRARY
-		NAMES GLEW glew
-		PATHS
-		/usr/lib32
-		/usr/lib
-		/usr/local/lib32
-		/usr/local/lib
-		/sw/lib
-		/opt/local/lib
-		DOC "The GLEW library")
-ENDIF (WIN32)
-
-# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if 
-# all listed variables are TRUE
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_LIBRARY GLEW_INCLUDE_DIR)
-
-mark_as_advanced(GLEW_LIBRARY GLEW_INCLUDE_DIR)
-

From 9c92e00696cb338437d1f2c8eeda8a0ede5f3891 Mon Sep 17 00:00:00 2001
From: Shanoah Alkire <arcum42@gmail.com>
Date: Sat, 17 Oct 2020 04:33:24 -0700
Subject: [PATCH 4/4] Forgot to change a description in build.sh.

---
 build.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.sh b/build.sh
index 56924fe0e1..91712dfe4c 100755
--- a/build.sh
+++ b/build.sh
@@ -244,7 +244,7 @@ for ARG in "$@"; do
             echo "--no-portaudio  : Skip portaudio for spu2x."
             echo
             echo "** Expert Developer option **"
-            echo "--gtk3          : replace GTK2 by GTK3"
+            echo "--gtk2          : use GTK 2 instead of GTK 3"
             echo "--no-cross-multilib: Build a native PCSX2 (nonfunctional recompiler)"
             echo "--no-trans      : Don't regenerate mo files when building."
             echo "--clang         : Build with Clang/llvm"
openSUSE Build Service is sponsored by