Gentoo Archives: gentoo-commits

From: Samuel Bauer <samuel.bauer@×××××.fr>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: games-emulation/yuzu/files/, games-emulation/yuzu/
Date: Thu, 02 Feb 2023 18:47:35
Message-Id: 1675363617.bef015d946b03ba7fe5cabeeed1d0cec6017b9fe.samuel.bauer@gentoo
1 commit: bef015d946b03ba7fe5cabeeed1d0cec6017b9fe
2 Author: Samuel Bauer <samuel.bauer <AT> yahoo <DOT> fr>
3 AuthorDate: Thu Feb 2 18:46:57 2023 +0000
4 Commit: Samuel Bauer <samuel.bauer <AT> yahoo <DOT> fr>
5 CommitDate: Thu Feb 2 18:46:57 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=bef015d9
7
8 games-emulation/yuzu: update snapshot
9
10 Signed-off-by: Samuel Bauer <samuel.bauer <AT> yahoo.fr>
11
12 games-emulation/yuzu/files/yuzu-0_p20230202.patch | 169 ++++++++++++++++++++++
13 games-emulation/yuzu/yuzu-0_p20230202.ebuild | 124 ++++++++++++++++
14 2 files changed, 293 insertions(+)
15
16 diff --git a/games-emulation/yuzu/files/yuzu-0_p20230202.patch b/games-emulation/yuzu/files/yuzu-0_p20230202.patch
17 new file mode 100644
18 index 000000000..df8a04d95
19 --- /dev/null
20 +++ b/games-emulation/yuzu/files/yuzu-0_p20230202.patch
21 @@ -0,0 +1,169 @@
22 +diff --git a/CMakeLists.txt b/CMakeLists.txt
23 +index 8896fe0..f2a09e2 100644
24 +--- a/CMakeLists.txt
25 ++++ b/CMakeLists.txt
26 +@@ -216,7 +215,7 @@ find_package(ZLIB 1.2 REQUIRED)
27 + find_package(zstd 1.5 REQUIRED)
28 +
29 + if (NOT YUZU_USE_EXTERNAL_VULKAN_HEADERS)
30 +- find_package(Vulkan 1.3.238 REQUIRED)
31 ++ find_package(Vulkan 1.3.236 REQUIRED)
32 + endif()
33 +
34 + if (ENABLE_LIBUSB)
35 +diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
36 +index 8532fd7..67bed9a 100644
37 +--- a/externals/CMakeLists.txt
38 ++++ b/externals/CMakeLists.txt
39 +@@ -29,13 +29,7 @@ endif()
40 + add_subdirectory(glad)
41 +
42 + # inih
43 +-if (NOT TARGET inih::INIReader)
44 +- add_subdirectory(inih)
45 +-endif()
46 +
47 +-# mbedtls
48 +-add_subdirectory(mbedtls EXCLUDE_FROM_ALL)
49 +-target_include_directories(mbedtls PUBLIC ./mbedtls/include)
50 +
51 + # MicroProfile
52 + add_library(microprofile INTERFACE)
53 +@@ -77,18 +71,8 @@ if (YUZU_USE_EXTERNAL_SDL2)
54 + endif()
55 +
56 + # ENet
57 +-if (NOT TARGET enet::enet)
58 +- add_subdirectory(enet EXCLUDE_FROM_ALL)
59 +- target_include_directories(enet INTERFACE ./enet/include)
60 +- add_library(enet::enet ALIAS enet)
61 +-endif()
62 +
63 + # Cubeb
64 +-if (ENABLE_CUBEB AND NOT TARGET cubeb::cubeb)
65 +- set(BUILD_TESTS OFF)
66 +- add_subdirectory(cubeb EXCLUDE_FROM_ALL)
67 +- add_library(cubeb::cubeb ALIAS cubeb)
68 +-endif()
69 +
70 + # DiscordRPC
71 + if (USE_DISCORD_PRESENCE AND NOT TARGET DiscordRPC::discord-rpc)
72 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
73 +index c7283e8..123a745 100644
74 +--- a/src/CMakeLists.txt
75 ++++ b/src/CMakeLists.txt
76 +@@ -101,11 +101,6 @@ if (MSVC)
77 + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /MANIFEST:NO /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE)
78 + else()
79 + add_compile_options(
80 +- -Werror=all
81 +- -Werror=extra
82 +- -Werror=missing-declarations
83 +- -Werror=shadow
84 +- -Werror=unused
85 +
86 + -Wno-attributes
87 + -Wno-invalid-offsetof
88 +diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
89 +index 9884a4a..46df96b 100644
90 +--- a/src/common/CMakeLists.txt
91 ++++ b/src/common/CMakeLists.txt
92 +@@ -177,7 +177,7 @@ endif()
93 + create_target_directory_groups(common)
94 +
95 + target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile Threads::Threads)
96 +-target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd LLVM::Demangle)
97 ++target_link_libraries(common PRIVATE lz4 zstd::zstd LLVM::Demangle)
98 +
99 + if (YUZU_USE_PRECOMPILED_HEADERS)
100 + target_precompile_headers(common PRIVATE precompiled_headers.h)
101 +diff --git a/src/common/scm_rev.cpp.in b/src/common/scm_rev.cpp.in
102 +index f0c124d..739c4a6 100644
103 +--- a/src/common/scm_rev.cpp.in
104 ++++ b/src/common/scm_rev.cpp.in
105 +@@ -3,9 +3,9 @@
106 +
107 + #include "common/scm_rev.h"
108 +
109 +-#define GIT_REV "@GIT_REV@"
110 +-#define GIT_BRANCH "@GIT_BRANCH@"
111 +-#define GIT_DESC "@GIT_DESC@"
112 ++#define GIT_REV "d5f6201"
113 ++#define GIT_BRANCH "master"
114 ++#define GIT_DESC "d5f6201"
115 + #define BUILD_NAME "@REPO_NAME@"
116 + #define BUILD_DATE "@BUILD_DATE@"
117 + #define BUILD_FULLNAME "@BUILD_FULLNAME@"
118 +diff --git a/src/dedicated_room/CMakeLists.txt b/src/dedicated_room/CMakeLists.txt
119 +index 136109a..6a6924c 100644
120 +--- a/src/dedicated_room/CMakeLists.txt
121 ++++ b/src/dedicated_room/CMakeLists.txt
122 +@@ -15,7 +15,7 @@ if (ENABLE_WEB_SERVICE)
123 + target_link_libraries(yuzu-room PRIVATE web_service)
124 + endif()
125 +
126 +-target_link_libraries(yuzu-room PRIVATE mbedtls mbedcrypto)
127 ++target_link_libraries(yuzu-room PRIVATE mbedtls mbedcrypto mbedx509 mbedcrypto)
128 + if (MSVC)
129 + target_link_libraries(yuzu-room PRIVATE getopt)
130 + endif()
131 +diff --git a/src/network/network.cpp b/src/network/network.cpp
132 +index 6652a18..8513d52 100644
133 +--- a/src/network/network.cpp
134 ++++ b/src/network/network.cpp
135 +@@ -3,7 +3,7 @@
136 +
137 + #include "common/assert.h"
138 + #include "common/logging/log.h"
139 +-#include "enet/enet.h"
140 ++#include <enet/enet.h>
141 + #include "network/network.h"
142 +
143 + namespace Network {
144 +diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp
145 +index 486d4df..abad557 100644
146 +--- a/src/video_core/vulkan_common/vulkan_wrapper.cpp
147 ++++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp
148 +@@ -337,18 +337,6 @@ const char* ToString(VkResult result) noexcept {
149 + return "VK_ERROR_VALIDATION_FAILED_EXT";
150 + case VkResult::VK_ERROR_INVALID_SHADER_NV:
151 + return "VK_ERROR_INVALID_SHADER_NV";
152 +- case VkResult::VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR:
153 +- return "VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR";
154 +- case VkResult::VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR:
155 +- return "VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR";
156 +- case VkResult::VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR:
157 +- return "VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR";
158 +- case VkResult::VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR:
159 +- return "VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR";
160 +- case VkResult::VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR:
161 +- return "VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR";
162 +- case VkResult::VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR:
163 +- return "VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR";
164 + case VkResult::VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT:
165 + return "VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT";
166 + case VkResult::VK_ERROR_FRAGMENTATION_EXT:
167 +diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt
168 +index 46eddf4..afbe9ff 100644
169 +--- a/src/yuzu_cmd/CMakeLists.txt
170 ++++ b/src/yuzu_cmd/CMakeLists.txt
171 +@@ -1,4 +1,6 @@
172 + # SPDX-FileCopyrightText: 2018 yuzu Emulator Project
173 ++find_package(PkgConfig REQUIRED)
174 ++pkg_check_modules(INIH REQUIRED INIReader)
175 + # SPDX-License-Identifier: GPL-2.0-or-later
176 +
177 + # Credits to Samantas5855 and others for this function.
178 +diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
179 +index 3eee1cf..8775f79 100644
180 +--- a/src/core/CMakeLists.txt
181 ++++ b/src/core/CMakeLists.txt
182 +@@ -808,7 +808,7 @@ endif()
183 + create_target_directory_groups(core)
184 +
185 + target_link_libraries(core PUBLIC common PRIVATE audio_core network video_core)
186 +-target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls Opus::opus)
187 ++target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls mbedcrypto mbedx509 Opus::opus)
188 + if (MINGW)
189 + target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY})
190 + endif()
191
192 diff --git a/games-emulation/yuzu/yuzu-0_p20230202.ebuild b/games-emulation/yuzu/yuzu-0_p20230202.ebuild
193 new file mode 100644
194 index 000000000..3dc94d471
195 --- /dev/null
196 +++ b/games-emulation/yuzu/yuzu-0_p20230202.ebuild
197 @@ -0,0 +1,124 @@
198 +# Copyright 2020-2023 Gentoo Authors
199 +# Distributed under the terms of the GNU General Public License v2
200 +
201 +EAPI=8
202 +
203 +inherit cmake toolchain-funcs xdg
204 +
205 +DESCRIPTION="An emulator for Nintendo Switch"
206 +HOMEPAGE="https://yuzu-emu.org"
207 +SRC_URI="https://github.com/yuzu-emu/yuzu-mainline/archive/d5f6201521cdfd0be09a187d62f95d3a38f18c3e.tar.gz -> ${P}.tar.gz
208 + https://github.com/merryhime/dynarmic/archive/befe547d5631024a70d81d2ccee808bbfcb3854e.tar.gz -> ${PN}-dynarmic-${PV}.tar.gz
209 + https://github.com/herumi/xbyak/archive/a1ac3750f9a639b5a6c6d6c7da4259b8d6790989.tar.gz -> ${PN}-xbyak-${PV}.tar.gz
210 + https://github.com/yuzu-emu/sirit/archive/ab75463999f4f3291976b079d42d52ee91eebf3f.tar.gz -> ${PN}-sirit-${PV}.tar.gz
211 + compatibility-list? ( https://gist.githubusercontent.com/mazes-80/e3f1518e67c3292656a9055ba338994f/raw/b975f96366294d9cf65f844ed8df9189a488463d/yuzu-0_p20230202-compatibility_list.json )
212 + discord? ( https://github.com/yuzu-emu/discord-rpc/archive/20cc99aeffa08a4834f156b6ab49ed68618cf94a.tar.gz -> ${PN}-discord-${PV}.tar.gz )"
213 +# Dynarmic is not intended to be generic, it is tweaked to fit emulated processor
214 +# TODO wait 'xbyak' waiting version bump. see #860816
215 +
216 +LICENSE="|| ( Apache-2.0 GPL-2+ ) 0BSD BSD GPL-2+ ISC MIT
217 + !system-vulkan? ( Apache-2.0 )"
218 +SLOT="0"
219 +KEYWORDS="~amd64"
220 +IUSE="+compatibility-list +cubeb discord +qt5 sdl +system-vulkan webengine webservice"
221 +
222 +RDEPEND="
223 + <net-libs/mbedtls-3.1[cmac]
224 + >=app-arch/zstd-1.5
225 + >=dev-libs/libfmt-9:=
226 + >=dev-libs/openssl-1.1:=
227 + >=media-video/ffmpeg-4.3:=
228 + >=net-libs/enet-1.3
229 + app-arch/lz4:=
230 + dev-libs/boost:=[context]
231 + media-libs/opus
232 + sys-libs/zlib
233 + virtual/libusb:1
234 + cubeb? ( media-libs/cubeb )
235 + qt5? (
236 + >=dev-qt/qtcore-5.15:5
237 + >=dev-qt/qtgui-5.15:5
238 + >=dev-qt/qtmultimedia-5.15:5
239 + >=dev-qt/qtwidgets-5.15:5
240 + )
241 + sdl? (
242 + >=media-libs/libsdl2-2.0.18
243 + >=dev-libs/inih-52
244 + )
245 +"
246 +DEPEND="${RDEPEND}
247 + dev-cpp/cpp-httplib
248 + dev-cpp/cpp-jwt
249 + system-vulkan? ( >=dev-util/vulkan-headers-1.3.236 )
250 +"
251 +BDEPEND="
252 + >=dev-cpp/nlohmann_json-3.8.0
253 + dev-cpp/robin-map
254 + dev-util/glslang
255 + discord? ( >=dev-libs/rapidjson-1.1.0 )
256 +"
257 +S="${WORKDIR}"/yuzu-mainline-d5f6201521cdfd0be09a187d62f95d3a38f18c3e
258 +PATCHES=( "${FILESDIR}/${P}.patch" )
259 +
260 +REQUIRED_USE="|| ( qt5 sdl )"
261 +
262 +pkg_setup() {
263 + if tc-is-gcc; then
264 + [[ "$(gcc-major-version)" -lt 11 ]] && \
265 + die "You need gcc version 11 or clang to compile this package"
266 + fi
267 +}
268 +
269 +src_unpack() {
270 + default
271 + mv "${WORKDIR}"/dynarmic*/* "${S}/externals/dynarmic" || die
272 + mv "${WORKDIR}"/sirit*/* "${S}/externals/sirit" || die
273 + mv "${WORKDIR}"/xbyak*/* "${S}/externals/xbyak" || die
274 + if use discord; then
275 + mv "${WORKDIR}"/discord*/* "${S}/externals/discord-rpc" || die
276 + fi
277 +}
278 +
279 +src_prepare() {
280 + # Allow skip submodule downloading
281 + rm .gitmodules || die
282 +
283 + # Unbundle cubeb
284 + use cubeb && sed -i '$afind_package(Threads REQUIRED)' CMakeLists.txt || die
285 +
286 + if ! use discord; then
287 + sed -i -e '/^if.*discord-rpc/,/^endif()/d' externals/CMakeLists.txt || die
288 + else
289 + # Unbundle discord rapidjson
290 + sed -i '/NOT RAPIDJSONTEST/,/endif(NOT RAPIDJSONTEST)/d;/find_file(RAPIDJSON/d;s:\${RAPIDJSON}:"/usr/include/rapidjson":' \
291 + externals/discord-rpc/CMakeLists.txt || die
292 + fi
293 +
294 + cmake_src_prepare
295 +}
296 +
297 +src_configure() {
298 + local -a mycmakeargs=(
299 + # Libraries are private and rely on circular dependency resolution.
300 + -DBUILD_SHARED_LIBS=OFF # dynarmic
301 + -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=$(usex compatibility-list)
302 + -DENABLE_CUBEB=$(usex cubeb)
303 + -DENABLE_LIBUSB=ON
304 + -DENABLE_QT=$(usex qt5)
305 + -DENABLE_QT_TRANSLATION=$(usex qt5)
306 + -DENABLE_SDL2=$(usex sdl)
307 + -DENABLE_WEB_SERVICE=$(usex webservice)
308 + -DSIRIT_USE_SYSTEM_SPIRV_HEADERS=yes
309 + -DUSE_DISCORD_PRESENCE=$(usex discord)
310 + -DYUZU_TESTS=OFF
311 + -DYUZU_USE_EXTERNAL_VULKAN_HEADERS=$(use system-vulkan no yes)
312 + -DYUZU_USE_EXTERNAL_SDL2=OFF
313 + -DYUZU_USE_QT_WEB_ENGINE=$(usex webengine)
314 + )
315 +
316 + cmake_src_configure
317 +
318 + if use compatibility-list; then
319 + cp "${DISTDIR}"/${P}-compatibility_list.json "${BUILD_DIR}"/dist/compatibility_list/ || die
320 + fi
321 +}