diff --git a/emulators/dolphin-emu/Makefile b/emulators/dolphin-emu/Makefile index 7f86d74b3969..6f9a8b472747 100644 --- a/emulators/dolphin-emu/Makefile +++ b/emulators/dolphin-emu/Makefile @@ -1,116 +1,117 @@ PORTNAME= dolphin-emu PORTVERSION= 5.0.19870 PORTREVISION= 1 CATEGORIES= emulators MAINTAINER= martymac@FreeBSD.org COMMENT= Gamecube and Wii Emulator WWW= https://www.dolphin-emu.org LICENSE= BSD3CLAUSE CC0-1.0 GPLv2+ MIT LICENSE_COMB= multi +BUILD_DEPENDS= libfmt>=10.1:devel/libfmt \ + vulkan-headers>0:graphics/vulkan-headers # Notes on dependencies: # - alsa support has been disabled (not optimal) # - enet and soundtouch come from Externals/ as Dolphin's versions diverge # (see comments in CMakeLists.txt) # Various problems that may be addressed in the future: # - freesurround comes from Externals/ as it is not available from ports yet # - cubeb comes from Externals/ as it is not available from ports yet # - gtest detection is missing (Externals/ version enforced by CMakeLists.txt) LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \ libavdevice.so:multimedia/ffmpeg \ libavfilter.so:multimedia/ffmpeg \ libavformat.so:multimedia/ffmpeg \ libavutil.so:multimedia/ffmpeg \ libswresample.so:multimedia/ffmpeg \ libswscale.so:multimedia/ffmpeg \ libfmt.so:devel/libfmt \ libpugixml.so:textproc/pugixml \ libxxhash.so:devel/xxhash \ libzstd.so:archivers/zstd \ libminizip-ng.so:archivers/minizip-ng \ liblzo2.so:archivers/lzo2 \ libspng.so:graphics/libspng \ libspeexdsp.so:audio/speexdsp \ libpulse.so:audio/pulseaudio \ libjack.so:audio/jack \ libsndio.so:audio/sndio \ libsfml-system.so:devel/sfml \ libminiupnpc.so:net/miniupnpc \ libmbedtls.so:security/mbedtls \ libcurl.so:ftp/curl \ libhidapi.so:comms/hidapi \ libxkbcommon.so:x11/libxkbcommon -BUILD_DEPENDS= vulkan-headers>0:graphics/vulkan-headers USES= cmake compiler:c++17-lang desktop-file-utils elfctl gl iconv \ pkgconfig qmake qt:6 sdl xorg ELF_FEATURES= +noaslr:Binaries/dolphin-emu* # See: https://fr.dolphin-emu.org/download/?ref=btn # for latest beta version and associated commit USE_GITHUB= yes GH_PROJECT= dolphin GH_TAGNAME= 8c2a1c1 .include "${.CURDIR}/Makefile.tuples" USE_GL= egl gl USE_SDL= sdl2 USE_XORG= ice sm x11 xext xi xrandr USE_QT= base svg # XXX USE_MGBA crashes configure step CMAKE_ARGS+= -DUSE_UPNP:BOOL=ON \ -DENABLE_QT:BOOL=ON \ -DENABLE_ALSA:BOOL=OFF \ -DENABLE_PULSEAUDIO:BOOL=ON \ -DUSE_DISCORD_PRESENCE:BOOL=OFF \ -DUSE_MGBA:BOOL=OFF \ -DENABLE_AUTOUPDATE:BOOL=OFF \ -DCMAKE_INSTALL_MANDIR:PATH=${MANPREFIX}/man MAKE_ENV+= DESTDIR="${STAGEDIR}" # XXX Fix build on archs where 'unsigned long' is 32bit CXXFLAGS+= -DLZO_CFG_PREFER_TYPEOF_ACC_INT32E_T=LZO_TYPEOF_INT # Bypass git check (and set a dummy -unused- revision) CMAKE_ARGS+= -DDOLPHIN_WC_BRANCH:STRING="stable" \ -DDOLPHIN_WC_REVISION:STRING="1" OPTIONS_DEFINE= NLS OPTIONS_SUB= yes NLS_USES= gettext NLS_CMAKE_ON= -DDISABLE_NLS:BOOL=OFF NLS_CMAKE_OFF= -DDISABLE_NLS:BOOL=ON .include # JIT-enabled binaries are amd64 and aarch64 only .if ${ARCH} != "amd64" && ${ARCH} != "aarch64" CMAKE_ARGS+= -DENABLE_GENERIC:BOOL=ON .endif .if ${CHOSEN_COMPILER_TYPE:Mclang} CMAKE_ARGS+= -DENABLE_LLVM:BOOL=ON \ -DLLVM_DIR=${LOCALBASE}/llvm${LLVM_DEFAULT}/lib/cmake/llvm LIB_DEPENDS+= libLLVM-${LLVM_DEFAULT:C/^([6-9])0/\1/}.so:devel/llvm${LLVM_DEFAULT} .else CMAKE_ARGS+= -DENABLE_LLVM:BOOL=OFF .endif # For maintainer (do not forget to clean up Makefile.tuples afterwards to # remove useless submodules) Makefile.tuples:: @${ECHO_CMD} -n > ${.CURDIR}/Makefile.tuples @${RM} -rf ${WRKDIR}/.maintainer.checkout @${MKDIR} ${WRKDIR}/.maintainer.checkout && \ cd ${WRKDIR}/.maintainer.checkout && \ git clone https://github.com/${GH_ACCOUNT}/${GH_PROJECT} . && \ git checkout ${GH_TAGNAME} && \ git submodule init && \ git submodule update --recursive && \ ${SH} ${FILESDIR}/gen_gh_tuple.sh > ${.CURDIR}/Makefile.tuples .include diff --git a/emulators/dolphin-emu/files/patch-libfmt b/emulators/dolphin-emu/files/patch-libfmt new file mode 100644 index 000000000000..56679c6177f5 --- /dev/null +++ b/emulators/dolphin-emu/files/patch-libfmt @@ -0,0 +1,168 @@ +Obtained from: https://github.com/dolphin-emu/dolphin/commit/63467559b20682a6b9e4ec43c6b43456e1fca111 + https://github.com/dolphin-emu/dolphin/commit/b5b28da39d371ff2abbb0855fadc3c748a8a7043 + +--- CMakeLists.txt.orig 2023-07-23 02:24:09 UTC ++++ CMakeLists.txt +@@ -630,7 +630,7 @@ if (_M_X86) + endif() + add_subdirectory(Externals/cpp-optparse) + +-dolphin_find_optional_system_library(fmt Externals/fmt 8) ++dolphin_find_optional_system_library(fmt Externals/fmt 10.1) + + add_subdirectory(Externals/imgui) + add_subdirectory(Externals/implot) +--- Source/Android/jni/GpuDriver.cpp.orig 2023-07-23 02:24:09 UTC ++++ Source/Android/jni/GpuDriver.cpp +@@ -7,6 +7,7 @@ + + #include + ++#include "Common/EnumUtils.h"` + #include "Common/IniFile.h" + #include "jni/AndroidCommon/AndroidCommon.h" + #include "jni/AndroidCommon/IDCache.h" +@@ -69,7 +70,7 @@ Java_org_dolphinemu_dolphinemu_utils_GpuDriverHelper_0 + properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; + properties2.pNext = &driverProperties; + vkGetPhysicalDeviceProperties2(gpu_list.front(), &properties2); +- driverId = fmt::format("{}", driverProperties.driverID); ++ driverId = fmt::format("{}", Common::ToUnderlying(driverProperties.driverID)); + } + else + { +--- Source/Core/Common/HRWrap.cpp.orig 2023-07-23 02:24:09 UTC ++++ Source/Core/Common/HRWrap.cpp +@@ -3,13 +3,15 @@ + + #include "HRWrap.h" + +-#include +- + namespace Common + { + std::string GetHResultMessage(HRESULT hr) + { + auto err = winrt::hresult_error(hr); + return winrt::to_string(err.message()); ++} ++std::string GetHResultMessage(const winrt::hresult& hr) ++{ ++ return GetHResultMessage(hr.value); + } + } // namespace Common +--- Source/Core/Common/HRWrap.h.orig 2023-07-23 02:24:09 UTC ++++ Source/Core/Common/HRWrap.h +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + + #include "Common/CommonTypes.h" + +@@ -31,5 +32,16 @@ struct fmt::formatter + { + return fmt::format_to(ctx.out(), "{} ({:#010x})", Common::GetHResultMessage(hr.m_hr), + static_cast(hr.m_hr)); ++ } ++}; ++ ++template <> ++struct fmt::formatter ++{ ++ constexpr auto parse(fmt::format_parse_context& ctx) { return ctx.begin(); } ++ template ++ auto format(const winrt::hresult& hr, FormatContext& ctx) const ++ { ++ return fmt::format_to(ctx.out(), "{} ({:#010x})", Common::GetHResultMessage(hr), hr.value); + } + }; +--- Source/Core/Common/Swap.h.orig 2023-07-23 02:24:09 UTC ++++ Source/Core/Common/Swap.h +@@ -16,6 +16,8 @@ + #include + #endif + ++#include ++ + #include "Common/CommonTypes.h" + + namespace Common +@@ -183,3 +185,15 @@ struct BigEndianValue (private) + value_type raw; + }; + } // Namespace Common ++ ++template ++struct fmt::formatter> ++{ ++ fmt::formatter m_formatter; ++ constexpr auto parse(format_parse_context& ctx) { return m_formatter.parse(ctx); } ++ template ++ auto format(const Common::BigEndianValue& value, FormatContext& ctx) const ++ { ++ return m_formatter.format(value.operator value_type(), ctx); ++ } ++}; +--- Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp.orig 2023-07-23 02:24:09 UTC ++++ Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp +@@ -23,6 +23,7 @@ + + #include + ++#include "Common/HRWrap.h" + #include "Common/Logging/Log.h" + #include "Common/StringUtil.h" + #include "InputCommon/ControllerInterface/ControllerInterface.h" +@@ -506,7 +507,7 @@ class Device : public Core::Device (private) + catch (winrt::hresult_error error) + { + ERROR_LOG_FMT(CONTROLLERINTERFACE, +- "WGInput: IRawGameController::GetCurrentReading failed: {:x}", error.code()); ++ "WGInput: IRawGameController::GetCurrentReading failed: {}", error.code()); + } + + // IGamepad: +@@ -518,7 +519,7 @@ class Device : public Core::Device (private) + } + catch (winrt::hresult_error error) + { +- ERROR_LOG_FMT(CONTROLLERINTERFACE, "WGInput: IGamepad::GetCurrentReading failed: {:x}", ++ ERROR_LOG_FMT(CONTROLLERINTERFACE, "WGInput: IGamepad::GetCurrentReading failed: {}", + error.code()); + } + } +--- Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp.orig 2023-07-23 02:24:09 UTC ++++ Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp +@@ -4,7 +4,8 @@ + #include "VideoCommon/Assets/DirectFilesystemAssetLibrary.h" + + #include +-#include ++ ++#include + + #include "Common/FileUtil.h" + #include "Common/Logging/Log.h" +--- Source/Core/VideoCommon/BPMemory.h.orig 2023-07-23 02:24:09 UTC ++++ Source/Core/VideoCommon/BPMemory.h +@@ -1863,7 +1863,7 @@ enum class ColorChannel : u32 + template <> + struct fmt::formatter : EnumFormatter + { +- formatter() : EnumFormatter({"Red", "Green", "Blue", "Alpha"}) {} ++ constexpr formatter() : EnumFormatter({"Red", "Green", "Blue", "Alpha"}) {} + }; + + enum class KonstSel : u32 +--- Source/Core/VideoCommon/TextureCacheBase.h.orig 2023-07-23 02:24:09 UTC ++++ Source/Core/VideoCommon/TextureCacheBase.h +@@ -98,7 +98,6 @@ struct EFBCopyParams + template <> + struct fmt::formatter + { +- std::shared_ptr state; + constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } + template + auto format(const EFBCopyParams& uid, FormatContext& ctx) const