diff --git a/emulators/yuzu/Makefile b/emulators/yuzu/Makefile index e1767ff1113b..9a1a03fc37c7 100644 --- a/emulators/yuzu/Makefile +++ b/emulators/yuzu/Makefile @@ -1,124 +1,125 @@ PORTNAME= yuzu PORTVERSION= s20220209 +PORTREVISION= 1 CATEGORIES= emulators .if make(makesum) MASTER_SITES= https://api.yuzu-emu.org/gamedb/?dummy=/:gamedb .else MASTER_SITES= LOCAL/jbeich:gamedb .endif DISTFILES= ${PORTNAME}/compatibility_list.json:gamedb EXTRACT_ONLY= ${DISTFILES:N*\:gamedb:C/\:.*//} PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/ PATCHFILES+= 4a8a248b47a2.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+= 98d47bc50cab.patch:-p1 # https://github.com/yuzu-emu/yuzu/pull/7497 mainline-merge PATCHFILES+= 8cf82354b1e4.patch:-p1 # https://github.com/yuzu-emu/yuzu/pull/7812 mainline-merge MAINTAINER= jbeich@FreeBSD.org COMMENT= Nintendo Switch emulator/debugger LICENSE= APACHE20 BSD3CLAUSE GPLv2+ ISCL LGPL21+ LGPL3+ MIT UNLICENSE LICENSE_COMB= multi LICENSE_FILE_BSD3CLAUSE=${WRKSRC}/externals/inih/inih/LICENSE.txt LICENSE_FILE_GPLv2+ = ${WRKSRC}/license.txt LICENSE_FILE_ISCL= ${WRKSRC}/externals/cubeb/LICENSE LICENSE_FILE_LGPL21+ = ${_LICENSE_STORE}/LGPL21 # soundtouch LICENSE_FILE_LGPL3+ = ${_LICENSE_STORE}/LGPL3 # sirit LICENSE_FILE_MIT= ${WRKSRC}/externals/sirit/externals/SPIRV-Headers/LICENSE ONLY_FOR_ARCHS= aarch64 amd64 ONLY_FOR_ARCHS_REASON= requires int128 and dynarmic backend BROKEN_aarch64= https://github.com/yuzu-emu/yuzu/issues/5290 BUILD_DEPENDS= boost-libs>0:devel/boost-libs \ nlohmann-json>0:devel/nlohmann-json \ glslangValidator:graphics/glslang LIB_DEPENDS= liblz4.so:archivers/liblz4 \ libzstd.so:archivers/zstd \ libopus.so:audio/opus \ libavcodec.so:multimedia/ffmpeg TEST_DEPENDS= catch>0:devel/catch USE_GITHUB= yes GH_ACCOUNT= yuzu-emu GH_TAGNAME= bcd666b86 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.202:Vulkan_Headers/externals/Vulkan-Headers \ MerryMage:dynarmic:r5-136-ga8cbfd9a:dynarmic/externals/dynarmic \ ReinUsesLisp:sirit:a395963:sirit/externals/sirit \ arsenm:sanitizers-cmake:aab6948:sanitizers_cmake/externals/cubeb/cmake/sanitizers-cmake \ benhoyt:inih:r52:inih/externals/inih/inih \ citra-emu:ext-soundtouch:060181e:soundtouch/externals/soundtouch \ fmtlib:fmt:8.0.0:fmt/externals/fmt \ herumi:xbyak:v5.96:xbyak/externals/xbyak \ kinetiknz:cubeb:cubeb-0.2-1350-gf79e0cf: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 pkgconfig sdl ssl USE_GCC= yes:build # libc++ lacks std::atomic_ref, std::ranges USE_SDL= sdl2 CMAKE_ON= Boost_USE_STATIC_LIBS CMAKE_ON+= BUNDLE_SPEEX # only used by cubeb tests CMAKE_OFF= YUZU_USE_BUNDLED_OPUS YUZU_USE_EXTERNAL_SDL2 ENABLE_GNUTLS ENABLE_MBEDTLS CMAKE_OFF+= ${CMAKE_TESTING_ON} CMAKE_TESTING_ON= YUZU_TESTS LDFLAGS+= -static-libstdc++ # avoid libc++ conflict, requires files/patch-fmt LDFLAGS+= -Wl,--as-needed # Qt5Network PLIST_FILES= bin/${PORTNAME}-cmd OPTIONS_DEFINE= ALSA PULSEAUDIO JACK NLS QT5 SNDIO VAAPI VULKAN WEBENGINE OPTIONS_DEFAULT=PULSEAUDIO JACK QT5 SNDIO VAAPI VULKAN WEBENGINE ALSA_BUILD_DEPENDS= alsa-lib>0:audio/alsa-lib ALSA_CMAKE_BOOL= USE_ALSA JACK_BUILD_DEPENDS= jackit>0:audio/jack JACK_CMAKE_BOOL= USE_JACK NLS_DESC= UI translations (implies QT5) NLS_USE= QT=linguisttools_build NLS_CMAKE_BOOL= ENABLE_QT_TRANSLATION NLS_IMPLIES= QT5 PULSEAUDIO_BUILD_DEPENDS=pulseaudio>0:audio/pulseaudio PULSEAUDIO_CMAKE_BOOL= USE_PULSE QT5_USES= desktop-file-utils qt:5 shared-mime-info QT5_USE= QT=qmake_build,buildtools_build,concurrent_build,core,gui,widgets QT5_CMAKE_BOOL= ENABLE_QT QT5_PLIST_FILES= bin/${PORTNAME} \ share/applications/${PORTNAME}.desktop \ share/icons/hicolor/scalable/apps/${PORTNAME}.svg \ share/mime/packages/${PORTNAME}.xml SNDIO_BUILD_DEPENDS= sndio>0:audio/sndio SNDIO_CMAKE_BOOL= USE_SNDIO VAAPI_LIB_DEPENDS= libva.so:multimedia/libva VULKAN_DESC= Vulkan renderer VULKAN_RUN_DEPENDS= ${LOCALBASE}/lib/libvulkan.so:graphics/vulkan-loader WEBENGINE_DESC= Web applet support (implies QT5) WEBENGINE_USE= QT=webengine WEBENGINE_CMAKE_BOOL= YUZU_USE_QT_WEB_ENGINE WEBENGINE_IMPLIES= QT5 post-patch: @${REINPLACE_CMD} -e '/check_submodules_present()/d' \ ${WRKSRC}/CMakeLists.txt @${REINPLACE_CMD} -e 's/@GIT_BRANCH@/master/' \ -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 post-configure: @${CP} ${DISTFILES:M*\:gamedb:C/\:.*//:S,^,${_DISTDIR},} \ ${BUILD_WRKSRC}/dist/compatibility_list/ .include diff --git a/emulators/yuzu/files/patch-kde b/emulators/yuzu/files/patch-kde new file mode 100644 index 000000000000..32c9c04d74e7 --- /dev/null +++ b/emulators/yuzu/files/patch-kde @@ -0,0 +1,71 @@ +$ pkg install yuzu plasma5-plasma-integration +$ export XDG_CURRENT_DESKTOP=KDE KDE_FULL_SESSION=true +$ yuzu +[...] +* thread #1, name = 'yuzu', stop reason = signal SIGSEGV: address access protected (fault address: 0x83c1ccc18) + frame #0: 0x000000083c1ccc18 libcxxrt.so.1`vtable for __cxxabiv1::__si_class_type_info + 16 +libcxxrt.so.1`vtable for __cxxabiv1::__si_class_type_info: +-> 0x83c1ccc18 <+16>: nop + 0x83c1ccc19 <+17>: xchgl %ecx, %eax + 0x83c1ccc1a <+18>: imull $0x0, (%rcx), %eax + 0x83c1ccc1d <+21>: addb %al, (%rax) +(lldb) bt +* thread #1, name = 'yuzu', stop reason = signal SIGSEGV: address access protected (fault address: 0x83c1ccc18) + * frame #0: 0x000000083c1ccc18 libcxxrt.so.1`vtable for __cxxabiv1::__si_class_type_info + 16 + frame #1: 0x0000000822adcf48 + frame #2: 0x000000089c992d16 libKF5ConfigCore.so.5`KConfigGroupPrivate::create(master=0x0000000822adcf48, name=0x0000000822adceb0, isImmutable=false, isConst=false) at kconfiggroup.cpp:114:13 + frame #3: 0x000000089c98bc2a libKF5ConfigCore.so.5`KConfigGroup::KConfigGroup(this=0x0000000822adcf38, master=0x0000000822adcf48, _group="Inactive") at kconfiggroup.cpp:476:9 + frame #4: 0x00000008964fc32f libKF5ConfigWidgets.so.5`KColorSchemePrivate::KColorSchemePrivate(this=0x0000000875c8b3c0, config=0x0000000822add248, state=Inactive, group="Colors:View", defaults=0x00000008964c84b0) at kcolorscheme.cpp:313:38 + frame #5: 0x00000008964fe613 libKF5ConfigWidgets.so.5`KColorScheme::KColorScheme(this=0x0000000822add250, state=Inactive, set=View, config=KSharedConfigPtr @ 0x0000000822add248) at kcolorscheme.cpp:552:17 + frame #6: 0x00000008964ff40c libKF5ConfigWidgets.so.5`KColorScheme::createApplicationPalette(config=0x000000088d3a7160) at kcolorscheme.cpp:702:22 + frame #7: 0x000000088ef1fb6d KDEPlasmaPlatformTheme.so`KHintsSettings::loadPalettes(this=0x000000088d3a7140) at khintssettings.cpp:423:66 + frame #8: 0x000000088ef1e242 KDEPlasmaPlatformTheme.so`KHintsSettings::KHintsSettings(this=0x000000088d3a7140, kdeglobals=KSharedConfig::Ptr @ 0x0000000822addd10) at khintssettings.cpp:144:5 + frame #9: 0x000000088ef183e8 KDEPlasmaPlatformTheme.so`KdePlatformTheme::loadSettings(this=0x000000088d3b19c0) at kdeplatformtheme.cpp:179:19 + frame #10: 0x000000088ef182a2 KDEPlasmaPlatformTheme.so`KdePlatformTheme::KdePlatformTheme(this=0x000000088d3b19c0) at kdeplatformtheme.cpp:62:5 + frame #11: 0x000000088ef4544a KDEPlasmaPlatformTheme.so`KdePlatformThemePlugin::create(this=0x000000088d38a750, key=0x0000000822adde40, paramList=0x0000000822adde60) at main.cpp:25:20 + frame #12: 0x000000083710e720 libQt5Gui.so.5`QPlatformTheme* qLoadPlugin(loader=0x00000008376e6358, key=0x0000000822adde40, args=0x0000000822adde60) at qfactoryloader_p.h:108:52 + frame #13: 0x000000083710e016 libQt5Gui.so.5`QPlatformThemeFactory::create(key=0x0000000875bc4bb0, platformPluginPath=0x0000000822ade300) at qplatformthemefactory.cpp:73:12 + frame #14: 0x000000083711adaf libQt5Gui.so.5`init_platform(pluginNamesWithArguments=0x0000000822ade1c8, platformPluginPath=0x0000000822ade300, platformThemeName=0x0000000822ade220, argc=0x0000000822ade6bc, argv=0x0000000822ade9d8) at qguiapplication.cpp:1282:50 + frame #15: 0x000000083711a111 libQt5Gui.so.5`QGuiApplicationPrivate::createPlatformIntegration(this=0x0000000875c56000) at qguiapplication.cpp:1481:5 + frame #16: 0x000000083711b22c libQt5Gui.so.5`QGuiApplicationPrivate::createEventDispatcher(this=0x0000000875c56000) at qguiapplication.cpp:1498:9 + frame #17: 0x000000083573cb75 libQt5Widgets.so.5`QApplicationPrivate::createEventDispatcher(this=0x0000000875c56000) at qapplication.cpp:167:29 + frame #18: 0x0000000838c2ffc6 libQt5Core.so.5`QCoreApplicationPrivate::init(this=0x0000000875c56000) at qcoreapplication.cpp:835:9 + frame #19: 0x00000008371157f3 libQt5Gui.so.5`QGuiApplicationPrivate::init(this=0x0000000875c56000) at qguiapplication.cpp:1527:30 + frame #20: 0x000000083573d129 libQt5Widgets.so.5`QApplicationPrivate::init(this=0x0000000875c56000) at qapplication.cpp:513:29 + frame #21: 0x000000083573d105 libQt5Widgets.so.5`QApplication::QApplication(this=0x0000000822ade6d0, argc=0x0000000822ade6bc, argv=0x0000000822ade9d8, _internal=331522) at qapplication.cpp:501:8 + frame #22: 0x00000000006447c1 yuzu`main(argc=1, argv=0x0000000822ade9d8) at main.cpp:3697:32 + frame #23: 0x0000000000445890 yuzu`_start(ap=, cleanup=) at crt1_c.c:73:7 +(lldb) f 2 +frame #2: 0x000000089bdbad16 libKF5ConfigCore.so.5`KConfigGroupPrivate::create(master=0x000000082359a8a8, name=0x000000082359a810, isImmutable=false, isConst=false) at kconfiggroup.cpp:114:13 + 111 static QExplicitlySharedDataPointer create(KConfigBase *master, const QByteArray &name, bool isImmutable, bool isConst) + 112 { + 113 QExplicitlySharedDataPointer data; +-> 114 if (dynamic_cast(master)) { + 115 data = new KConfigGroupPrivate(static_cast(master), isImmutable, isConst, name); + 116 } else { + 117 data = new KConfigGroupPrivate(dynamic_cast(master), isImmutable, isConst, name); +(lldb) f 22 +frame #22: 0x00000000006447c1 yuzu`main(argc=1, argv=0x0000000822ade9d8) at main.cpp:3697:32 + 3694 + 3695 // Enables the core to make the qt created contexts current on std::threads + 3696 QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity); +-> 3697 QApplication app(argc, argv); + 3698 + 3699 // Qt changes the locale and causes issues in float conversion using std::to_string() when + 3700 // generating shaders + +--- src/yuzu/main.cpp.orig 2022-02-09 18:29:32 UTC ++++ src/yuzu/main.cpp +@@ -3692,6 +3692,12 @@ int main(int argc, char* argv[]) { + } + #endif + ++#if (defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(_LIBCPP_VERSION) ++ // -static-libstdc++ is fragile on libc++ systems ++ qunsetenv("XDG_CURRENT_DESKTOP"); ++ qunsetenv("KDE_FULL_SESSION"); ++#endif ++ + // Enables the core to make the qt created contexts current on std::threads + QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity); + QApplication app(argc, argv);