git: 097b6241bb42 - main - emulators/yuzu: update to s20211218

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Sun, 19 Dec 2021 00:17:19 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=097b6241bb4225dd747d75a58e26205b9d2c5eaa

commit 097b6241bb4225dd747d75a58e26205b9d2c5eaa
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2021-12-05 00:48:44 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2021-12-19 00:16:49 +0000

    emulators/yuzu: update to s20211218
    
    Changes:        https://github.com/yuzu-emu/yuzu/compare/a2fb5a13b...8e33cf1c2
---
 emulators/yuzu/Makefile                   | 23 +++++++++++++++++------
 emulators/yuzu/distinfo                   | 14 +++++++++++---
 emulators/yuzu/files/patch-CMakeLists.txt |  4 ++--
 emulators/yuzu/files/patch-sdl2           | 26 ++++++++++++++++----------
 4 files changed, 46 insertions(+), 21 deletions(-)

diff --git a/emulators/yuzu/Makefile b/emulators/yuzu/Makefile
index 7f24330a7670..6226dbf181a8 100644
--- a/emulators/yuzu/Makefile
+++ b/emulators/yuzu/Makefile
@@ -1,11 +1,15 @@
 PORTNAME=	yuzu
-PORTVERSION=	s20211203
+PORTVERSION=	s20211218
 PORTREVISION?=	0
 CATEGORIES=	emulators
 
 PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
 PATCHFILES+=	6904f055db88.patch:-p1 # https://github.com/yuzu-emu/yuzu/pull/6598 mainline-merge
 PATCHFILES+=	e919bea9c84e.patch:-p1 # https://github.com/yuzu-emu/yuzu/pull/7346 mainline-merge
+PATCHFILES+=	16e5fc080281.patch:-p1 # https://github.com/yuzu-emu/yuzu/pull/7497 mainline-merge
+PATCHFILES+=	57909b727b2e.patch:-p1 # https://github.com/yuzu-emu/yuzu/pull/7497 mainline-merge
+PATCHFILES+=	1a9576fdffd5.patch:-p1 # https://github.com/yuzu-emu/yuzu/pull/7602
+PATCHFILES+=	e57b13ad948e.patch:-p1 # https://github.com/yuzu-emu/yuzu/pull/7602
 
 MAINTAINER=	jbeich@FreeBSD.org
 COMMENT=	Nintendo Switch emulator/debugger
@@ -34,7 +38,7 @@ LIB_DEPENDS=	liblz4.so:archivers/liblz4 \
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	yuzu-emu
-GH_TAGNAME=	a2fb5a13b
+GH_TAGNAME=	8e33cf1c2
 GH_TUPLE=	yuzu-emu:mbedtls:v2.16.9-115-g8c88150ca:mbedtls/externals/mbedtls \
 		KhronosGroup:SPIRV-Headers:1.5.4.raytracing.fixed-32-ga3fdfe8:SPIRV_Headers/externals/sirit/externals/SPIRV-Headers \
 		KhronosGroup:Vulkan-Headers:v1.2.180:Vulkan_Headers/externals/Vulkan-Headers \
@@ -48,16 +52,17 @@ GH_TUPLE=	yuzu-emu:mbedtls:v2.16.9-115-g8c88150ca:mbedtls/externals/mbedtls \
 		kinetiknz:cubeb:cubeb-0.2-1345-g773f16b:cubeb/externals/cubeb \
 		yhirose:cpp-httplib:v0.9.0-5-g9648f95:cpp_httplib/externals/cpp-httplib
 
-USES=		cmake:testing compiler:c++17-lang localbase:ldflags sdl ssl
+USES=		cmake:testing compiler:c++17-lang localbase:ldflags pkgconfig sdl ssl
 USE_GCC=	yes:build # libc++ lacks std::atomic_ref, std::ranges
 USE_SDL=	sdl2
-CMAKE_ON=	Boost_USE_STATIC_LIBS LIBVA_FOUND
+CMAKE_ON=	Boost_USE_STATIC_LIBS
+CMAKE_ON+=	BUNDLE_SPEEX # only used by cubeb tests
 CMAKE_OFF=	YUZU_USE_EXTERNAL_SDL2 ENABLE_GNUTLS ENABLE_MBEDTLS
 LDFLAGS+=	-static-libstdc++ # avoid libc++ conflict, requires files/patch-fmt
 LDFLAGS+=	-Wl,--as-needed # Qt5Network
 
-OPTIONS_DEFINE=	ALSA PULSEAUDIO JACK SNDIO VULKAN
-OPTIONS_DEFAULT=PULSEAUDIO JACK SNDIO VULKAN
+OPTIONS_DEFINE=	ALSA PULSEAUDIO JACK SNDIO VAAPI VULKAN
+OPTIONS_DEFAULT=PULSEAUDIO JACK SNDIO VAAPI VULKAN
 OPTIONS_MULTI=	GUI
 OPTIONS_MULTI_GUI=	QT5 SDL
 OPTIONS_SLAVE?=	SDL
@@ -86,6 +91,8 @@ QT5_PLIST_FILES=bin/${PORTNAME} \
 		share/icons/hicolor/scalable/apps/${PORTNAME}.svg \
 		share/mime/packages/${PORTNAME}.xml
 
+VAAPI_LIB_DEPENDS=	libva.so:multimedia/libva
+
 VULKAN_DESC=		Vulkan renderer
 VULKAN_RUN_DEPENDS=	${LOCALBASE}/lib/libvulkan.so:graphics/vulkan-loader
 
@@ -102,4 +109,8 @@ post-patch:
 		-e 's/@GIT_DESC@/${GH_TAGNAME}/' \
 		${WRKSRC}/src/common/scm_rev.cpp.in
 
+post-patch-VAAPI-off:
+	@${REINPLACE_CMD} -i .nova '/pkg_check.*libva/d' \
+		${WRKSRC}/CMakeLists.txt
+
 .include <bsd.port.mk>
diff --git a/emulators/yuzu/distinfo b/emulators/yuzu/distinfo
index 345a3b773c60..a2d60e9b84f9 100644
--- a/emulators/yuzu/distinfo
+++ b/emulators/yuzu/distinfo
@@ -1,6 +1,6 @@
-TIMESTAMP = 1638576500
-SHA256 (yuzu-emu-yuzu-s20211203-a2fb5a13b_GH0.tar.gz) = f71128fb99da0fc7be5592c0ce0d74ec1350704fab3c74624f81054d66b9776c
-SIZE (yuzu-emu-yuzu-s20211203-a2fb5a13b_GH0.tar.gz) = 4461169
+TIMESTAMP = 1639860795
+SHA256 (yuzu-emu-yuzu-s20211218-8e33cf1c2_GH0.tar.gz) = 485e773e26e78da1d0db2a45bd5caa0b9f4d8f1570d8081b58ecb1420ae944ac
+SIZE (yuzu-emu-yuzu-s20211218-8e33cf1c2_GH0.tar.gz) = 4470238
 SHA256 (yuzu-emu-mbedtls-v2.16.9-115-g8c88150ca_GH0.tar.gz) = 8cd6d075b4da0ad5fb995eb37390e2e6088be8d41ab1cdfc7e7e4256bd991450
 SIZE (yuzu-emu-mbedtls-v2.16.9-115-g8c88150ca_GH0.tar.gz) = 2679189
 SHA256 (KhronosGroup-SPIRV-Headers-1.5.4.raytracing.fixed-32-ga3fdfe8_GH0.tar.gz) = bd629d6296dd374eb2aeff923c75895ba0f3ce6448dad89763930e65b954e0cb
@@ -29,3 +29,11 @@ SHA256 (6904f055db88.patch) = 587a818f7099e38b7103db5e5b43019e60e1cdc28a450df5b6
 SIZE (6904f055db88.patch) = 4650
 SHA256 (e919bea9c84e.patch) = e132ba798a1e5e660bc43c3a524113898036f4cee6f7cc7c65a83b0e10170a42
 SIZE (e919bea9c84e.patch) = 3248
+SHA256 (16e5fc080281.patch) = c637e6e08ae9532a519dcba399fece8569a0300ce1aa9540acfc3ebc7a23e03a
+SIZE (16e5fc080281.patch) = 6022
+SHA256 (57909b727b2e.patch) = fce8dcf7d0581eea20fbd9a911568d501a4a6c32c48a476e588fe462f48569be
+SIZE (57909b727b2e.patch) = 586
+SHA256 (1a9576fdffd5.patch) = a987a79f49f6225a6277c892185115c2bde6ecda42e00e021f41ed40a7948f6c
+SIZE (1a9576fdffd5.patch) = 643
+SHA256 (e57b13ad948e.patch) = aff024986deac68b78c527d61c368d6d2ae4513b8c27bd28f080c62956e75178
+SIZE (e57b13ad948e.patch) = 855
diff --git a/emulators/yuzu/files/patch-CMakeLists.txt b/emulators/yuzu/files/patch-CMakeLists.txt
index a96aa821af30..43638c95a8bc 100644
--- a/emulators/yuzu/files/patch-CMakeLists.txt
+++ b/emulators/yuzu/files/patch-CMakeLists.txt
@@ -1,6 +1,6 @@
 yuzu (Qt) currently needs SDL for input
 
---- CMakeLists.txt.orig	2021-08-14 09:28:59 UTC
+--- CMakeLists.txt.orig	2021-12-06 23:09:30 UTC
 +++ CMakeLists.txt
 @@ -395,7 +395,10 @@ if (ENABLE_SDL2)
          target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
@@ -11,7 +11,7 @@ yuzu (Qt) currently needs SDL for input
 +endif()
 +
 +if (NOT YUZU_USE_BUNDLED_SDL2 AND NOT YUZU_USE_EXTERNAL_SDL2)
-         find_package(SDL2 2.0.16 REQUIRED)
+         find_package(SDL2 2.0.18 REQUIRED)
  
          # Some installations don't set SDL2_LIBRARIES
 @@ -407,7 +410,6 @@ if (ENABLE_SDL2)
diff --git a/emulators/yuzu/files/patch-sdl2 b/emulators/yuzu/files/patch-sdl2
index 2eb05a0a0049..2a55b9750e86 100644
--- a/emulators/yuzu/files/patch-sdl2
+++ b/emulators/yuzu/files/patch-sdl2
@@ -2,24 +2,24 @@ https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252371
 
 CMake Error at CMakeLists.txt:397 (find_package):
   Could not find a configuration file for package "SDL2" that is compatible
-  with requested version "2.0.16".
+  with requested version "2.0.18".
 
   The following configuration files were considered but not accepted:
 
     /usr/local/lib/cmake/SDL2/sdl2-config.cmake, version: 2.0.12
 
---- CMakeLists.txt.orig	2021-08-14 09:28:59 UTC
+--- CMakeLists.txt.orig	2021-12-06 23:09:30 UTC
 +++ CMakeLists.txt
 @@ -398,7 +398,7 @@ if (ENABLE_SDL2)
  endif()
  
  if (NOT YUZU_USE_BUNDLED_SDL2 AND NOT YUZU_USE_EXTERNAL_SDL2)
--        find_package(SDL2 2.0.16 REQUIRED)
+-        find_package(SDL2 2.0.18 REQUIRED)
 +        find_package(SDL2 2.0.12 REQUIRED)
  
          # Some installations don't set SDL2_LIBRARIES
          if("${SDL2_LIBRARIES}" STREQUAL "")
---- src/input_common/drivers/sdl_driver.cpp.orig	2021-11-27 10:52:08 UTC
+--- src/input_common/drivers/sdl_driver.cpp.orig	2021-12-18 10:33:07 UTC
 +++ src/input_common/drivers/sdl_driver.cpp
 @@ -39,6 +39,7 @@ class SDLJoystick { (public)
      }
@@ -51,7 +51,7 @@ CMake Error at CMakeLists.txt:397 (find_package):
      }
 +#endif
  
-     BasicMotion GetMotion() {
+     const BasicMotion& GetMotion() const {
          return motion;
 @@ -362,6 +366,7 @@ void SDLDriver::HandleGameControllerEvent(const SDL_Ev
          }
@@ -69,8 +69,8 @@ CMake Error at CMakeLists.txt:397 (find_package):
      case SDL_JOYDEVICEREMOVED:
          LOG_DEBUG(Input, "Controller removed with Instance_ID {}", event.jdevice.which);
          CloseJoystick(SDL_JoystickFromInstanceID(event.jdevice.which));
-@@ -392,7 +398,7 @@ SDLDriver::SDLDriver(const std::string& input_engine_)
- 
+@@ -390,7 +396,7 @@ void SDLDriver::CloseJoysticks() {
+ SDLDriver::SDLDriver(std::string input_engine_) : InputEngine(std::move(input_engine_)) {
      if (!Settings::values.enable_raw_input) {
          // Disable raw input. When enabled this setting causes SDL to die when a web applet opens
 -        SDL_SetHint(SDL_HINT_JOYSTICK_RAWINPUT, "0");
@@ -78,7 +78,7 @@ CMake Error at CMakeLists.txt:397 (find_package):
      }
  
      // Prevent SDL from adding undesired axis
-@@ -400,7 +406,7 @@ SDLDriver::SDLDriver(const std::string& input_engine_)
+@@ -398,12 +404,12 @@ SDLDriver::SDLDriver(std::string input_engine_) : Inpu
  
      // Enable HIDAPI rumble. This prevents SDL from disabling motion on PS4 and PS5 controllers
      SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1");
@@ -87,7 +87,13 @@ CMake Error at CMakeLists.txt:397 (find_package):
      SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
  
      // Use hidapi driver for joycons. This will allow joycons to be detected as a GameController and
-@@ -670,6 +676,7 @@ ButtonBindings SDLDriver::GetNintendoButtonBinding(
+     // not a generic one
+-    SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, "1");
++    SDL_SetHint("SDL_JOYSTICK_HIDAPI_JOY_CONS", "1");
+ 
+     // Disable hidapi driver for xbox. Already default on Windows, this causes conflict with native
+     // driver on Linux.
+@@ -672,6 +678,7 @@ ButtonBindings SDLDriver::GetNintendoButtonBinding(
      auto sl_button = SDL_CONTROLLER_BUTTON_LEFTSHOULDER;
      auto sr_button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER;
  
@@ -95,7 +101,7 @@ CMake Error at CMakeLists.txt:397 (find_package):
      if (joystick->IsJoyconLeft()) {
          sl_button = SDL_CONTROLLER_BUTTON_PADDLE2;
          sr_button = SDL_CONTROLLER_BUTTON_PADDLE4;
-@@ -678,6 +685,7 @@ ButtonBindings SDLDriver::GetNintendoButtonBinding(
+@@ -680,6 +687,7 @@ ButtonBindings SDLDriver::GetNintendoButtonBinding(
          sl_button = SDL_CONTROLLER_BUTTON_PADDLE3;
          sr_button = SDL_CONTROLLER_BUTTON_PADDLE1;
      }