games-emulation/yuzu: unbundle mbedtls, update SDL2, skip qtconcurrent fix, review comments

Signed-off-by: Samuel Bauer <samuel.bauer@yahoo.fr>
This commit is contained in:
Samuel Bauer
2022-01-21 04:30:20 +01:00
parent e3a27aef75
commit 7a70fb27ee

View File

@@ -8,12 +8,10 @@ inherit cmake git-r3 toolchain-funcs xdg
DESCRIPTION="An emulator for Nintendo Switch"
HOMEPAGE="https://yuzu-emu.org"
EGIT_REPO_URI="https://github.com/yuzu-emu/yuzu-mainline"
EGIT_SUBMODULES=( '-*' 'dynarmic' 'soundtouch' 'sirit' 'mbedtls' 'xbyak' 'externals/cpp-httplib' )
EGIT_SUBMODULES=( '-*' 'dynarmic' 'soundtouch' 'sirit' 'xbyak' 'externals/cpp-httplib' )
# Soundtouch cannot be unbundled -> custom version
# Dynarmic is heavily tweaked to emulate switch cpu non sense to unbundle
# Dynarmic is intended to be tailored on purpose, not to be generic
# TODO wait 'xbyak' for bump in tree, require 5.96
# TODO many submodules produce static libraries which forces to unset BUILD_SHARED_LIBS
# this may be better to generate shared libraries and install them under /usr/$(get_libdir)/yuzu
LICENSE="|| ( Apache-2.0 GPL-2+ ) 0BSD BSD GPL-2+ ISC MIT
!system-vulkan? ( Apache-2.0 )"
@@ -30,6 +28,7 @@ RDEPEND="
>=media-libs/opus-1.3.1
>=media-video/ffmpeg-4.3:=
>=sys-libs/zlib-1.2
net-libs/mbedtls[cmac]
virtual/libusb:1
cubeb? ( media-libs/cubeb )
qt5? (
@@ -38,7 +37,7 @@ RDEPEND="
>=dev-qt/qtwidgets-5.15:5
)
sdl? (
>=media-libs/libsdl2-2.0.16
>=media-libs/libsdl2-2.0.18
>=dev-libs/inih-52
)
"
@@ -62,8 +61,6 @@ pkg_setup() {
[[ "$(gcc-major-version)" -lt 11 ]] && \
die "You need gcc version 11 or clang to compile this package"
fi
grep -q 'ThreadEngineStarter<void>' /usr/include/qt5/QtConcurrent/qtconcurrentthreadengine.h \
|| die "add user patch for dev-qt/qtconcurrent: https://github.com/qt/qtbase/commit/659f7a06e91c04b239e3f4c0bcfccbe3581af1c3.diff"
}
src_unpack() {
@@ -101,15 +98,21 @@ src_prepare() {
sed -i -e 's:../../externals/Vulkan-Headers/include:/usr/include/vulkan/:' src/video_core/CMakeLists.txt src/yuzu/CMakeLists.txt src/yuzu_cmd/CMakeLists.txt || die
fi
# Unbundle mbedtls: undefined reference to `mbedtls_cipher_cmac'
sed -i -e '/mbedtls/d' externals/CMakeLists.txt || die
sed -i -e 's/mbedtls/& mbedcrypto mbedx509/' \
-e '1ifind_path(MBEDTLS_INCLUDE_DIR NAMES mbedtls/ssl.h)' \
-e '1ifind_library(MBEDTLS_LIB NAMES mbedtls)' \
-e '1ifind_library(MBEDX509_LIB NAMES mbedx509)' \
-e '1ifind_library(MBEDCRYPTO_LIB NAMES mbedcrypto)' \
src/core/CMakeLists.txt
# Workaround: GenerateSCMRev fails
sed -i -e "s/@GIT_BRANCH@/${EGIT_BRANCH:-master}/" \
-e "s/@GIT_REV@/$(git rev-parse --short HEAD)/" \
-e "s/@GIT_DESC@/$(git describe --always --long)/" \
src/common/scm_rev.cpp.in || die
# Lower sdl requirement
sed -i -e '/SDL2/s/18/16/' CMakeLists.txt || die
# Use system SPIRV headers
sed -i -e '/SPIRV/d' externals/sirit/CMakeLists.txt || die
@@ -130,6 +133,7 @@ src_prepare() {
src_configure() {
local -a mycmakeargs=(
# Libraries are private and rely on circular dependency resolution.
-DBUILD_SHARED_LIBS=OFF
-DDYNARMIC_NO_BUNDLED_ROBIN_MAP=ON
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=$(usex compatibility-list)
@@ -139,6 +143,7 @@ src_configure() {
-DENABLE_SDL2=$(usex sdl)
-DENABLE_WEB_SERVICE=$(usex webservice)
-DUSE_DISCORD_PRESENCE=$(usex discord)
-DYUZU_USE_BUNDLED_OPUS=OFF
-DYUZU_USE_EXTERNAL_SDL2=OFF
-DYUZU_USE_QT_WEB_ENGINE=$(usex webengine)
)