games-emulation/yuzu: new ebuild

Signed-off-by: Samuel Bauer <samuel.bauer@yahoo.fr>
This commit is contained in:
Samuel Bauer
2021-04-28 17:59:36 +02:00
parent 03dee06634
commit 4b611a5c84
4 changed files with 172 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
AUX yuzu-9999-assert.patch 2145 BLAKE2B 140ace2db8a6621205b65e8f7585a624a792198ded7949b2baafc549dbe70afc3faa0eae62d440d8d02a6f7272c2a5290aa185d68cf92417c50b20fafb96daf1 SHA512 89930366f369ccb1a978cd0eb7c32ecd03f77ffa04a5439450e5e3264a79b92cdddc9468f88e5b1adacbf340c8aa2c7614ca5b12cf7062a069bb519a6dc009b1
EBUILD yuzu-9999.ebuild 4296 BLAKE2B 487ef667564ad7e04afcfe5f13276c547311432a435381a9dae7b8a317ae527ac2fa7f9ade61c20577c42bf7b3484621a3a3c1471d0a78e39a151491da7df95f SHA512 a53f40d05363fb5059b4318026a130f84c2f97ca9be9222688c9f93a0382621d9b53193db47e7acef48b1c0cacb0b598233338ace26fcdf38e0155dc21ef6dcf
MISC metadata.xml 613 BLAKE2B 4d4bddfd2fa545273ac302e325fccff48bd3690009f76533a0fc1240ed543bb940096f8918e0c22700ea55e0cc2b5211e98cef067f96afaaa76563762b3c6ea3 SHA512 a816a2e2dd9bf374ed15128fb87d5db011dcc42e913f6f24eb98eee9642b302fd2b5d9e50ec07f2a11f2cfe65c3e819c3b6cb36f4f401cbb7ddc86ac0b0ab573

View File

@@ -0,0 +1,34 @@
--- a/src/common/assert.h
+++ b/src/common/assert.h
@@ -28,22 +28,19 @@ __declspec(noinline, noreturn)
}
#define ASSERT(_a_) \
- do \
- if (!(_a_)) { \
- assert_noinline_call([] { LOG_CRITICAL(Debug, "Assertion Failed!"); }); \
- } \
- while (0)
+ if (!(_a_)) { \
+ LOG_CRITICAL(Debug, "Assertion Failed!"); \
+ }
#define ASSERT_MSG(_a_, ...) \
- do \
- if (!(_a_)) { \
- assert_noinline_call([&] { LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \
- } \
- while (0)
+ if (!(_a_)) { \
+ LOG_CRITICAL(Debug, "Assertion Failed! " __VA_ARGS__); \
+ }
-#define UNREACHABLE() assert_noinline_call([] { LOG_CRITICAL(Debug, "Unreachable code!"); })
+#define UNREACHABLE() \
+ { LOG_CRITICAL(Debug, "Unreachable code!"); }
#define UNREACHABLE_MSG(...) \
- assert_noinline_call([&] { LOG_CRITICAL(Debug, "Unreachable code!\n" __VA_ARGS__); })
+ { LOG_CRITICAL(Debug, "Unreachable code!\n" __VA_ARGS__); }
#ifdef _DEBUG
#define DEBUG_ASSERT(_a_) ASSERT(_a_)

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<name>mazes-80</name>
<email>mazes-80@github.com</email>
</maintainer>
<use>
<flag name="boxcat">Enable the Boxcat service, a yuzu high-level implementation of BCAT</flag>
<flag name="cubeb">Enables the cubeb audio backend</flag>
<flag name="discord">Enables Discord Rich Presence</flag>
<flag name="webengine">Use QtWebEngine for web applet implementation</flag>
<flag name="webservice">Enable web services (telemetry, etc.)</flag>
</use>
</pkgmetadata>

View File

@@ -0,0 +1,120 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
# PYTHON_COMPAT=( python2_7 )
#inherit cmake git-r3 flag-o-matic python-any-r1 toolchain-funcs xdg
inherit cmake git-r3 flag-o-matic toolchain-funcs xdg
DESCRIPTION="An emulator for Nintendo Switch"
HOMEPAGE="https://yuzu-emu.org"
EGIT_REPO_URI="https://github.com/yuzu-emu/yuzu"
EGIT_SUBMODULES=( '*' '-ffmpeg' '-inih' '-libressl' '-libusb' '-libzip' '-opus' )
# TODO '-Vulkan-Headers' need to fix API in code
# TODO '-xbyak' wait for bump in tree
# TODO cubeb auto-links to jack, pulse, alsa .., allow determining cubeb output
# media-libs/cubeb would benefit to a lot of packages: dolphin-emu, firefox, citra, self, ...
# 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
# TODO python2 code should be needed only for submodules test
# until verified keep track of python specific ebuild stuffs as comment
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+boxcat +cubeb discord +qt5 sdl webengine +webservice"
DEPEND="
discord? ( >=dev-libs/rapidjson-1.1.0 )
qt5? (
>=dev-qt/qtgui-5.15
>=dev-qt/qtwidgets-5.15
)
sdl? (
media-libs/libsdl2
>=dev-libs/inih-52
)
>=app-arch/lz4-1.8
>=app-arch/zstd-1.4
>=dev-cpp/catch-2.13:0
>=dev-cpp/nlohmann_json-3.8.0
>=dev-libs/boost-1.73:=[context]
>=dev-libs/libfmt-7.1.0
>=dev-libs/libzip-1.5
>=media-libs/opus-1.3.1
>=sys-libs/zlib-1.2
virtual/libusb:1
"
# >=dev-libs/xbyak-5.96
RDEPEND="${DEPEND}"
REQUIRED_USE="boxcat? ( webservice ) || ( qt5 sdl )"
PATCHES=( "${FILESDIR}"/${P}-assert.patch )
pkg_setup() {
if [ tc-is-gcc -a $(gcc-major-version) -lt 10 ]; then
die "You need gcc version 10 or clang to compile this package"
fi
}
src_unpack() {
git-r3_src_unpack
# Do not fetch via sources because this file always changes
curl https://api.yuzu-emu.org/gamedb/ > "${S}"/compatibility_list.json
}
src_prepare() {
# Set yuzu dev flags
filter-flags '-*'
append-cflags '-O3 -DNDEBUG'
append-cxxflags '-O3 -DNDEBUG'
# headers is not a valid boost component
sed -i -e '/find_package(Boost/s/headers //' CMakeLists.txt || die
# Allow skip submodule downloading
rm .gitmodules
# unbundle opus (thx to https://github.com/Alex-Aralis/yuzu-overlay/blob/master/games-emulation/yuzu/files/unbundle-opus.patch)
sed -i -e "s!add_subdirectory(opus)!add_library(opus INTERFACE)\ntarget_include_directories(opus SYSTEM INTERFACE /usr/include/opus)\ntarget_link_libraries(opus INTERFACE /usr/$(get_libdir)/libopus.so)!" externals/CMakeLists.txt || die
# Fix libzip detection
sed -i -e '/Libzip/s:.*:include(find-modules/FindLibzip.cmake)\n&:' externals/CMakeLists.txt || die
# Unbundle inih
sed -i -e '/inih/d' externals/CMakeLists.txt || die
sed -i -e '1afind_package(PkgConfig REQUIRED)\npkg_check_modules(INIH REQUIRED INIReader)' \
-e '/target_link_libraries/s/inih/${INIH_LIBRARIES}/' src/yuzu_cmd/CMakeLists.txt || die
sed -i -e 's:inih/cpp/::' src/yuzu_cmd/config.cpp || die
# Unbundle xbyak ( uncomment when xbyak version is ok or never as it is only headers )
# sed -i -e '/target_include_directories(xbyak/s:./xbyak/xbyak:/usr/include/xbyak/:' externals/CMakeLists.txt
# Unbundle vulkan headers
# 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
# Unbundle discord rapidjson
sed -i '/NOT RAPIDJSONTEST/,/endif(NOT RAPIDJSONTEST)/d;/find_file(RAPIDJSON/d;s:\${RAPIDJSON}:"/usr/include/rapidjson":' externals/discord-rpc/CMakeLists.txt || die
cmake_src_prepare
}
src_configure() {
local -a mycmakeargs=(
-DBUILD_SHARED_LIBS=OFF
-DENABLE_CUBEB=$(usex cubeb ON OFF)
-DENABLE_QT=$(usex qt5)
-DENABLE_QT_TRANSLATION=$(usex qt5)
-DENABLE_SDL2=$(usex sdl)
-DENABLE_WEB_SERVICE=$(usex webservice ON OFF)
-DUSE_DISCORD_PRESENCE=$(usex discord ON OFF)
-DYUZU_ENABLE_BOXCAT=$(usex boxcat ON OFF)
-DYUZU_USE_QT_WEB_ENGINE=$(usex webengine ON OFF)
)
cmake_src_configure
# This would be better in src_unpack but it would be unlinked
mv "${S}"/compatibility_list.json "${BUILD_DIR}"/dist/compatibility_list/ || die
}