diff --git a/emulators/citra/Makefile b/emulators/citra/Makefile index 2cdcdb03103..eef8565db0a 100644 --- a/emulators/citra/Makefile +++ b/emulators/citra/Makefile @@ -7,10 +7,9 @@ USE_WXNEEDED = Yes COMMENT = nintendo 3DS emulator -V = 729 -DISTNAME = citra-nightly-${V} +DISTNAME = citra-unified-source-20230110-ad2cbe2 +V = 1827 PKGNAME = citra-0.0.0.${V} -REVISION = 8 CATEGORIES = emulators @@ -19,35 +18,50 @@ CATEGORIES = emulators # BSD-3-clause (nihstro), LGPLv2.1 (soundtouch), BSD-style (xbyak) PERMIT_PACKAGE = Yes -WANTLIB += ${COMPILER_LIBCXX} Qt5Core Qt5Gui Qt5Multimedia Qt5Network Qt5OpenGL -WANTLIB += Qt5Widgets SDL2 c cryptopp enet iconv m +WANTLIB += ${COMPILER_LIBCXX} Qt5Core Qt5Gui Qt5Multimedia Qt5Widgets +WANTLIB += SDL2 avcodec avformat avutil boost_serialization-mt +WANTLIB += c cryptopp enet fmt m swresample swscale usb-1.0 -MASTER_SITES = https://spacehopper.org/mirrors/ +MASTER_SITES = https://github.com/citra-emu/citra-nightly/releases/download/nightly-${V}/ EXTRACT_SUFX = .tar.xz MODULES = devel/cmake \ x11/qt5 -# XXX Enable with the next update -#BUILD_DEPENDS = devel/catch2 +# C++20 +COMPILER = base-clang ports-clang + +BUILD_DEPENDS = devel/catch2 \ + devel/robin-map -BUILD_DEPENDS = devel/boost RUN_DEPENDS = devel/desktop-file-utils \ misc/shared-mime-info \ x11/gtk+3,-guic -LIB_DEPENDS = devel/cryptopp \ + +LIB_DEPENDS = devel/boost \ + devel/cryptopp \ + graphics/ffmpeg \ + devel/fmt \ devel/sdl2 \ net/enet \ x11/qt5/qtmultimedia CONFIGURE_ARGS = -DENABLE_CUBEB=OFF \ - -DENABLE_WEB_SERVICE=OFF - -CXXFLAGS += -I${LOCALBASE}/include -I${LOCALBASE}/lib/qt5/cmake/Qt5/ + -DENABLE_WEB_SERVICE=OFF \ + -DENABLE_WEB_SERVICE=OFF \ + -DUSE_SYSTEM_BOOST=ON \ + -DUSE_SYSTEM_SDL2=ON \ + -DENABLE_FFMPEG_AUDIO_DECODER=ON \ + -DENABLE_FFMPEG_VIDEO_DUMPER=ON \ + -DCITRA_USE_PRECOMPILED_HEADERS=OFF MODCMAKE_LDFLAGS = -L${LOCALBASE}/lib -do-test: - cd ${WRKBUILD}/src/tests && ./tests +WRKDIST = ${WRKDIR}/${DISTNAME} + +CXXFLAGS += -I${LOCALBASE}/include -I${LOCALBASE}/lib/qt5/cmake/Qt5/ + +post-extract: + rm -rf ${WRKSRC}/externals/{sdl2,catch2,fmt,boost,cryptopp} .include diff --git a/emulators/citra/distinfo b/emulators/citra/distinfo index af3006e9fb2..68210099210 100644 --- a/emulators/citra/distinfo +++ b/emulators/citra/distinfo @@ -1,2 +1,2 @@ -SHA256 (citra-nightly-729.tar.xz) = kJblK81dOGA98vkR9FKGLZvcKjJJ99ylBaq/VADdu94= -SIZE (citra-nightly-729.tar.xz) = 10912304 +SHA256 (citra-unified-source-20230110-ad2cbe2.tar.xz) = aMHLApv2CMToeZVXk9D5WwKslfnfCsj1gJy2n0uTKzo= +SIZE (citra-unified-source-20230110-ad2cbe2.tar.xz) = 29916568 diff --git a/emulators/citra/patches/patch-CMakeLists_txt b/emulators/citra/patches/patch-CMakeLists_txt index 624f6b509bc..c9995f1996d 100644 --- a/emulators/citra/patches/patch-CMakeLists_txt +++ b/emulators/citra/patches/patch-CMakeLists_txt @@ -4,37 +4,44 @@ fix man path Index: CMakeLists.txt --- CMakeLists.txt.orig +++ CMakeLists.txt -@@ -29,20 +29,6 @@ endif() +@@ -102,18 +102,6 @@ endif() # Sanity check : Check that all submodules are present # ======================================================================= -function(check_submodules_present) -- file(READ "${CMAKE_SOURCE_DIR}/.gitmodules" gitmodules) +- file(READ "${PROJECT_SOURCE_DIR}/.gitmodules" gitmodules) - string(REGEX MATCHALL "path *= *[^ \t\r\n]*" gitmodules ${gitmodules}) - foreach(module ${gitmodules}) - string(REGEX REPLACE "path *= *" "" module ${module}) -- if (NOT EXISTS "${CMAKE_SOURCE_DIR}/${module}/.git") +- if (NOT EXISTS "${PROJECT_SOURCE_DIR}/${module}/.git") - message(SEND_ERROR "Git submodule ${module} not found." - "Please run: git submodule update --init --recursive") - endif() - endforeach() -endfunction() -check_submodules_present() -- -- - configure_file(${CMAKE_SOURCE_DIR}/dist/compatibility_list/compatibility_list.qrc - ${CMAKE_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc - COPYONLY) -@@ -397,11 +383,11 @@ endif() + + configure_file(${PROJECT_SOURCE_DIR}/dist/compatibility_list/compatibility_list.qrc + ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc +@@ -189,6 +177,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DI + # Prefer the -pthread flag on Linux. + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) ++find_package(fmt REQUIRED) ++find_package(Catch2 REQUIRED) + + if (ENABLE_QT) + if (CITRA_USE_BUNDLED_QT) +@@ -426,11 +416,11 @@ endif() if(UNIX) if(ENABLE_SDL2) - install(FILES "${CMAKE_SOURCE_DIR}/dist/citra.6" + install(FILES "${PROJECT_SOURCE_DIR}/dist/citra.6" - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man6") + DESTINATION "${CMAKE_INSTALL_PREFIX}/man/man6") endif() if (ENABLE_QT) - install(FILES "${CMAKE_SOURCE_DIR}/dist/citra-qt.6" + install(FILES "${PROJECT_SOURCE_DIR}/dist/citra-qt.6" - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man6") + DESTINATION "${CMAKE_INSTALL_PREFIX}/man/man6") endif() diff --git a/emulators/citra/patches/patch-externals_CMakeLists_txt b/emulators/citra/patches/patch-externals_CMakeLists_txt index 0caa7953b8d..469d7cd5871 100644 --- a/emulators/citra/patches/patch-externals_CMakeLists_txt +++ b/emulators/citra/patches/patch-externals_CMakeLists_txt @@ -3,24 +3,48 @@ remove cryptopp, enet from builtins Index: externals/CMakeLists.txt --- externals/CMakeLists.txt.orig +++ externals/CMakeLists.txt -@@ -7,9 +7,6 @@ include(DownloadExternals) - add_library(catch-single-include INTERFACE) - target_include_directories(catch-single-include INTERFACE catch/single_include) +@@ -9,33 +9,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_S + include(DownloadExternals) + include(ExternalProject) +-# Boost +-set(BOOST_ROOT "${CMAKE_SOURCE_DIR}/externals/boost") +-set(Boost_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/externals/boost") +-set(Boost_NO_SYSTEM_PATHS ON) +-add_library(boost INTERFACE) +-target_include_directories(boost SYSTEM INTERFACE ${Boost_INCLUDE_DIR}) +- +-# Boost::serialization +-file(GLOB boost_serialization_SRC "${CMAKE_SOURCE_DIR}/externals/boost/libs/serialization/src/*.cpp") +-add_library(boost_serialization STATIC ${boost_serialization_SRC}) +-target_link_libraries(boost_serialization PUBLIC boost) +- + # Add additional boost libs here; remember to ALIAS them in the root CMakeLists! + +-# Catch2 +-set(CATCH_INSTALL_DOCS OFF) +-set(CATCH_INSTALL_EXTRAS OFF) +-add_subdirectory(catch2) +- -# Crypto++ -add_subdirectory(cryptopp) - - # Dynarmic - if (ARCHITECTURE_x86_64) - # Dynarmic will skip defining xbyak if it's already defined, we then define it below -@@ -54,10 +51,6 @@ if (ARCHITECTURE_x86_64) - target_include_directories(xbyak INTERFACE ./xbyak/xbyak) - target_compile_definitions(xbyak INTERFACE XBYAK_NO_OP_NAMES) - endif() +-# fmt and Xbyak need to be added before dynarmic +-# libfmt +-option(FMT_INSTALL "" ON) +-add_subdirectory(fmt) +- + # Xbyak + if ("x86_64" IN_LIST ARCHITECTURE) + add_subdirectory(xbyak) +@@ -89,10 +64,6 @@ set(ZSTD_BUILD_PROGRAMS OFF) + set(ZSTD_BUILD_SHARED OFF) + add_subdirectory(zstd/build/cmake EXCLUDE_FROM_ALL) + target_include_directories(libzstd_static INTERFACE $) - -# ENet -add_subdirectory(enet) -target_include_directories(enet INTERFACE ./enet/include) - if (ENABLE_WEB_SERVICE) - # LibreSSL + # Cubeb + if (ENABLE_CUBEB) diff --git a/emulators/citra/patches/patch-externals_cubeb_CMakeLists_txt b/emulators/citra/patches/patch-externals_cubeb_CMakeLists_txt deleted file mode 100644 index 81103f49c53..00000000000 --- a/emulators/citra/patches/patch-externals_cubeb_CMakeLists_txt +++ /dev/null @@ -1,14 +0,0 @@ -attempt to fix path to include directory of cubeb - -Index: externals/cubeb/CMakeLists.txt ---- externals/cubeb/CMakeLists.txt.orig -+++ externals/cubeb/CMakeLists.txt -@@ -78,7 +78,7 @@ target_include_directories(cubeb - PUBLIC $ - ) - --install(DIRECTORY ${CMAKE_SOURCE_DIR}/include DESTINATION ${CMAKE_INSTALL_PREFIX}) -+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include DESTINATION ${CMAKE_INSTALL_PREFIX}) - install(DIRECTORY ${CMAKE_BINARY_DIR}/exports/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/cubeb) - - include(CMakePackageConfigHelpers) diff --git a/emulators/citra/patches/patch-externals_dynarmic_src_dynarmic_backend_exception_handler_posix_cpp b/emulators/citra/patches/patch-externals_dynarmic_src_dynarmic_backend_exception_handler_posix_cpp new file mode 100644 index 00000000000..2f86cb8fb84 --- /dev/null +++ b/emulators/citra/patches/patch-externals_dynarmic_src_dynarmic_backend_exception_handler_posix_cpp @@ -0,0 +1,49 @@ +Index: externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp +--- externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp.orig ++++ externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp +@@ -10,8 +10,10 @@ + # include + #else + # include ++#if !defined(__OpenBSD__) + # include + #endif ++#endif + + #include + #include +@@ -130,7 +132,11 @@ void SigHandler::RemoveCodeBlock(u64 host_pc) { + void SigHandler::SigAction(int sig, siginfo_t* info, void* raw_context) { + ASSERT(sig == SIGSEGV || sig == SIGBUS); + ++#if defined(__OpenBSD__) ++ sigcontext* mctx = ((sigcontext*)raw_context); ++#else + auto& mctx = ((ucontext_t*)raw_context)->uc_mcontext; ++#endif + + #if defined(MCL_ARCHITECTURE_X86_64) + +@@ -143,6 +149,9 @@ void SigHandler::SigAction(int sig, siginfo_t* info, v + # elif defined(__FreeBSD__) + # define CTX_RIP (mctx.mc_rip) + # define CTX_RSP (mctx.mc_rsp) ++# elif defined(__OpenBSD__) ++# define CTX_RIP (mctx->sc_rip) ++# define CTX_RSP (mctx->sc_rsp) + # else + # error "Unknown platform" + # endif +@@ -192,6 +201,12 @@ void SigHandler::SigAction(int sig, siginfo_t* info, v + # define CTX_LR (mctx.mc_gpregs.gp_lr) + # define CTX_X(i) (mctx.mc_gpregs.gp_x[i]) + # define CTX_Q(i) (mctx.mc_fpregs.fp_q[i]) ++# elif defined(__OpenBSD__) ++# define CTX_PC (mctx->sc_elr) ++# define CTX_SP (mctx->sc_sp) ++# define CTX_LR (mctx->sc_x [ARMREG_R0) ++# define CTX_X(i) (mctx->sc_x) ++# define CTX_Q(i) (mctx->sc_y) + # else + # error "Unknown platform" + # endif diff --git a/emulators/citra/pkg/PLIST b/emulators/citra/pkg/PLIST index 3837230d925..082a7c72596 100644 --- a/emulators/citra/pkg/PLIST +++ b/emulators/citra/pkg/PLIST @@ -1,6 +1,172 @@ @bin bin/citra @bin bin/citra-qt @bin bin/citra-room +include/dynarmic/ +include/dynarmic/backend/ +include/dynarmic/backend/arm64/ +include/dynarmic/backend/arm64/a32_address_space.h +include/dynarmic/backend/arm64/a32_core.h +include/dynarmic/backend/arm64/a32_jitstate.h +include/dynarmic/backend/arm64/a64_address_space.h +include/dynarmic/backend/arm64/a64_core.h +include/dynarmic/backend/arm64/a64_jitstate.h +include/dynarmic/backend/arm64/abi.h +include/dynarmic/backend/arm64/address_space.h +include/dynarmic/backend/arm64/devirtualize.h +include/dynarmic/backend/arm64/emit_arm64.h +include/dynarmic/backend/arm64/emit_arm64_memory.h +include/dynarmic/backend/arm64/emit_context.h +include/dynarmic/backend/arm64/fastmem.h +include/dynarmic/backend/arm64/fpsr_manager.h +include/dynarmic/backend/arm64/reg_alloc.h +include/dynarmic/backend/arm64/stack_layout.h +include/dynarmic/backend/exception_handler.h +include/dynarmic/backend/x64/ +include/dynarmic/backend/x64/a32_emit_x64.h +include/dynarmic/backend/x64/a32_jitstate.h +include/dynarmic/backend/x64/a64_emit_x64.h +include/dynarmic/backend/x64/a64_jitstate.h +include/dynarmic/backend/x64/abi.h +include/dynarmic/backend/x64/block_of_code.h +include/dynarmic/backend/x64/block_range_information.h +include/dynarmic/backend/x64/callback.h +include/dynarmic/backend/x64/constant_pool.h +include/dynarmic/backend/x64/constants.h +include/dynarmic/backend/x64/devirtualize.h +include/dynarmic/backend/x64/emit_x64.h +include/dynarmic/backend/x64/emit_x64_memory.h +include/dynarmic/backend/x64/exclusive_monitor_friend.h +include/dynarmic/backend/x64/host_feature.h +include/dynarmic/backend/x64/hostloc.h +include/dynarmic/backend/x64/jitstate_info.h +include/dynarmic/backend/x64/nzcv_util.h +include/dynarmic/backend/x64/oparg.h +include/dynarmic/backend/x64/perf_map.h +include/dynarmic/backend/x64/reg_alloc.h +include/dynarmic/backend/x64/stack_layout.h +include/dynarmic/common/ +include/dynarmic/common/atomic.h +include/dynarmic/common/cast_util.h +include/dynarmic/common/crypto/ +include/dynarmic/common/crypto/aes.h +include/dynarmic/common/crypto/crc32.h +include/dynarmic/common/crypto/sm4.h +include/dynarmic/common/fp/ +include/dynarmic/common/fp/fpcr.h +include/dynarmic/common/fp/fpsr.h +include/dynarmic/common/fp/fused.h +include/dynarmic/common/fp/info.h +include/dynarmic/common/fp/mantissa_util.h +include/dynarmic/common/fp/op/ +include/dynarmic/common/fp/op.h +include/dynarmic/common/fp/op/FPCompare.h +include/dynarmic/common/fp/op/FPConvert.h +include/dynarmic/common/fp/op/FPMulAdd.h +include/dynarmic/common/fp/op/FPNeg.h +include/dynarmic/common/fp/op/FPRSqrtEstimate.h +include/dynarmic/common/fp/op/FPRSqrtStepFused.h +include/dynarmic/common/fp/op/FPRecipEstimate.h +include/dynarmic/common/fp/op/FPRecipExponent.h +include/dynarmic/common/fp/op/FPRecipStepFused.h +include/dynarmic/common/fp/op/FPRoundInt.h +include/dynarmic/common/fp/op/FPToFixed.h +include/dynarmic/common/fp/process_exception.h +include/dynarmic/common/fp/process_nan.h +include/dynarmic/common/fp/rounding_mode.h +include/dynarmic/common/fp/unpacked.h +include/dynarmic/common/fp/util.h +include/dynarmic/common/llvm_disassemble.h +include/dynarmic/common/lut_from_list.h +include/dynarmic/common/math_util.h +include/dynarmic/common/memory_pool.h +include/dynarmic/common/safe_ops.h +include/dynarmic/common/spin_lock.h +include/dynarmic/common/spin_lock_arm64.h +include/dynarmic/common/spin_lock_x64.h +include/dynarmic/common/string_util.h +include/dynarmic/common/u128.h +include/dynarmic/common/variant_util.h +include/dynarmic/common/x64_disassemble.h +include/dynarmic/frontend/ +include/dynarmic/frontend/A32/ +include/dynarmic/frontend/A32/FPSCR.h +include/dynarmic/frontend/A32/ITState.h +include/dynarmic/frontend/A32/PSR.h +include/dynarmic/frontend/A32/a32_ir_emitter.h +include/dynarmic/frontend/A32/a32_location_descriptor.h +include/dynarmic/frontend/A32/a32_types.h +include/dynarmic/frontend/A32/decoder/ +include/dynarmic/frontend/A32/decoder/arm.h +include/dynarmic/frontend/A32/decoder/asimd.h +include/dynarmic/frontend/A32/decoder/thumb16.h +include/dynarmic/frontend/A32/decoder/thumb32.h +include/dynarmic/frontend/A32/decoder/vfp.h +include/dynarmic/frontend/A32/disassembler/ +include/dynarmic/frontend/A32/disassembler/disassembler.h +include/dynarmic/frontend/A32/translate/ +include/dynarmic/frontend/A32/translate/a32_translate.h +include/dynarmic/frontend/A32/translate/conditional_state.h +include/dynarmic/frontend/A32/translate/impl/ +include/dynarmic/frontend/A32/translate/impl/a32_translate_impl.h +include/dynarmic/frontend/A32/translate/translate_callbacks.h +include/dynarmic/frontend/A64/ +include/dynarmic/frontend/A64/a64_ir_emitter.h +include/dynarmic/frontend/A64/a64_location_descriptor.h +include/dynarmic/frontend/A64/a64_types.h +include/dynarmic/frontend/A64/decoder/ +include/dynarmic/frontend/A64/decoder/a64.h +include/dynarmic/frontend/A64/translate/ +include/dynarmic/frontend/A64/translate/a64_translate.h +include/dynarmic/frontend/A64/translate/impl/ +include/dynarmic/frontend/A64/translate/impl/impl.h +include/dynarmic/frontend/decoder/ +include/dynarmic/frontend/decoder/decoder_detail.h +include/dynarmic/frontend/decoder/matcher.h +include/dynarmic/frontend/imm.h +include/dynarmic/interface/ +include/dynarmic/interface/A32/ +include/dynarmic/interface/A32/a32.h +include/dynarmic/interface/A32/arch_version.h +include/dynarmic/interface/A32/config.h +include/dynarmic/interface/A32/context.h +include/dynarmic/interface/A32/coprocessor.h +include/dynarmic/interface/A32/coprocessor_util.h +include/dynarmic/interface/A32/disassembler.h +include/dynarmic/interface/A64/ +include/dynarmic/interface/A64/a64.h +include/dynarmic/interface/A64/config.h +include/dynarmic/interface/exclusive_monitor.h +include/dynarmic/interface/halt_reason.h +include/dynarmic/interface/optimization_flags.h +include/dynarmic/ir/ +include/dynarmic/ir/acc_type.h +include/dynarmic/ir/basic_block.h +include/dynarmic/ir/cond.h +include/dynarmic/ir/ir_emitter.h +include/dynarmic/ir/location_descriptor.h +include/dynarmic/ir/microinstruction.h +include/dynarmic/ir/opcodes.h +include/dynarmic/ir/opt/ +include/dynarmic/ir/opt/ir_matcher.h +include/dynarmic/ir/opt/passes.h +include/dynarmic/ir/terminal.h +include/dynarmic/ir/type.h +include/dynarmic/ir/value.h +include/xbyak/ +include/xbyak/xbyak.h +include/xbyak/xbyak_bin2hex.h +include/xbyak/xbyak_mnemonic.h +include/xbyak/xbyak_util.h +lib/cmake/dynarmic/ +lib/cmake/dynarmic/dynarmicConfig.cmake +lib/cmake/dynarmic/dynarmicConfigVersion.cmake +lib/cmake/dynarmic/dynarmicTargets${MODCMAKE_BUILD_SUFFIX} +lib/cmake/dynarmic/dynarmicTargets.cmake +lib/cmake/xbyak/ +lib/cmake/xbyak/xbyak-config-version.cmake +lib/cmake/xbyak/xbyak-config.cmake +lib/cmake/xbyak/xbyak-targets.cmake +@static-lib lib/libdynarmic.a @man man/man6/citra-qt.6 @man man/man6/citra.6 share/applications/citra.desktop