Skip to content

Commit

Permalink
Add cemu
Browse files Browse the repository at this point in the history
  • Loading branch information
FireBurn committed Dec 21, 2023
1 parent d3d6d03 commit 4de39eb
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 0 deletions.
2 changes: 2 additions & 0 deletions games-emulation/cemu/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DIST cemu-2.0_p20230625.tar.gz 22968396 BLAKE2B aeef3b6750e248347d32c4bfb584adb696004f53c05bd300ca9d23b6f39be6f47acbeb6abd02b8fc2449fd67daac2226cbfea959c4b2c4133b1f1d4190139755 SHA512 542bf393266663250319663bb0e993ef09b390e29693e277d51159ecb2f705294be9ef0a4c7dffe80d68e319067a3a81d4bda2b10deca555a301e3ec1ac4f555
DIST cemu-imgui-1.88.tar.gz 1488062 BLAKE2B 1c7b05dc6862f1a9bb597e97f9205fad0c4c39052731e27437f475547c7439773b55384ba7764ba38b63a74040acc308e2982bf166bdf76cbe58183dd4d6451d SHA512 bfb7381334f1493d64386321401086e4136129b3cc57bf57505ec6183008dddab1a2056b0af2610bc3286c606bafdf9b6e3ebc103131e0504bab2336662bc2c1
85 changes: 85 additions & 0 deletions games-emulation/cemu/cemu-2.0_p20230625.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake desktop xdg

DESCRIPTION="Wii U emulator."
HOMEPAGE="https://cemu.info/ https://github.com/cemu-project/Cemu"
SHA="9499870cc993f39d8c25f5e434a4d25d9a24b556"
MY_PN="Cemu"
IMGUI_PV="1.88"
SRC_URI="https://github.com/cemu-project/${MY_PN}/archive/${SHA}.tar.gz -> ${P}.tar.gz
https://github.com/ocornut/imgui/archive/refs/tags/v${IMGUI_PV}.tar.gz -> ${PN}-imgui-${IMGUI_PV}.tar.gz"

LICENSE="MPL-2.0 ISC"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+cubeb discord +sdl +vulkan"

DEPEND="app-arch/zarchive
app-arch/zstd
cubeb? ( media-libs/cubeb )
dev-libs/boost
dev-libs/glib
>=dev-libs/libfmt-9.1.0:=
dev-libs/libzip
dev-libs/openssl
dev-libs/pugixml
dev-libs/rapidjson
dev-libs/wayland
dev-util/glslang
media-libs/libglvnd
media-libs/libsdl2[haptic,joystick,threads]
net-misc/curl
sys-libs/zlib
vulkan? ( dev-util/vulkan-headers )
x11-libs/gtk+:3[wayland]
x11-libs/libX11
x11-libs/wxGTK:3.2-gtk3[opengl]"
RDEPEND="${DEPEND}"
BDEPEND="media-libs/glm"

S="${WORKDIR}/${MY_PN}-${SHA}"

PATCHES=(
"${FILESDIR}/${PN}-0002-remove-default-from-system-g.patch"
)

src_prepare() {
sed -re \
's/^target_link_libraries\(CemuBin.*/target_link_libraries(CemuBin PRIVATE wayland-client/' \
-i src/CMakeLists.txt || die
cmake_src_prepare
rmdir dependencies/imgui || die
mv "${WORKDIR}/imgui-${IMGUI_PV}" dependencies/imgui || die
}

src_configure() {
local mycmakeargs=(
-DBUILD_SHARED_LIBS=OFF
"-DENABLE_CUBEB=$(usex cubeb)"
"-DENABLE_DISCORD_RPC=$(usex discord)"
-DENABLE_OPENGL=ON
"-DENABLE_SDL=$(usex sdl)"
-DENABLE_VCPKG=OFF
"-DENABLE_VULKAN=$(usex vulkan)"
-DENABLE_WXWIDGETS=ON
-DPORTABLE=OFF
"-DwxWidgets_CONFIG_EXECUTABLE=/usr/$(get_libdir)/wx/config/gtk3-unicode-3.2-gtk3"
-Wno-dev
)
cmake_src_configure
}

src_install() {
newbin "bin/${MY_PN}_relwithdebinfo" "$MY_PN"
insinto "/usr/share/${PN}/gameProfiles"
doins -r bin/gameProfiles/default/*
insinto "/usr/share/${PN}"
doins -r bin/resources bin/shaderCache
einstalldocs
newicon -s 128 src/resource/logo_icon.png "info.${PN}.${MY_PN}.png"
domenu "dist/linux/info.${PN}.${MY_PN}.desktop"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From 64707c83cd3e060606781b87813ff6b73566d342 Mon Sep 17 00:00:00 2001
From: Andrew Udvare <audvare@gmail.com>
Date: Fri, 2 Sep 2022 00:19:59 -0400
Subject: [PATCH 2/3] Remove /default/ from system gameProfiles path

---
src/Cafe/CafeSystem.cpp | 2 +-
src/Cafe/GameProfile/GameProfile.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Cafe/CafeSystem.cpp b/src/Cafe/CafeSystem.cpp
index 19b6c49..f00c469 100644
--- a/src/Cafe/CafeSystem.cpp
+++ b/src/Cafe/CafeSystem.cpp
@@ -216,7 +216,7 @@ void InfoLog_TitleLoaded()
// game profile info
std::string gameProfilePath;
if(g_current_game_profile->IsDefaultProfile())
- gameProfilePath = fmt::format("gameProfiles/default/{:016x}.ini", titleId);
+ gameProfilePath = fmt::format("gameProfiles/{:016x}.ini", titleId);
else
gameProfilePath = fmt::format("gameProfiles/{:016x}.ini", titleId);
cemuLog_log(LogType::Force, "gameprofile path: {}", g_current_game_profile->IsLoaded() ? gameProfilePath : std::string(" (not present)"));
diff --git a/src/Cafe/GameProfile/GameProfile.cpp b/src/Cafe/GameProfile/GameProfile.cpp
index 24aee64..06f233b 100644
--- a/src/Cafe/GameProfile/GameProfile.cpp
+++ b/src/Cafe/GameProfile/GameProfile.cpp
@@ -185,7 +185,7 @@ bool GameProfile::Load(uint64_t title_id)
std::optional<std::vector<uint8>> profileContents = FileStream::LoadIntoMemory(gameProfilePath);
if (!profileContents)
{
- gameProfilePath = ActiveSettings::GetDataPath("gameProfiles/default/{:016x}.ini", title_id);
+ gameProfilePath = ActiveSettings::GetDataPath("gameProfiles/{:016x}.ini", title_id);
profileContents = FileStream::LoadIntoMemory(gameProfilePath);
if (!profileContents)
return false;
--
2.37.3

1 change: 1 addition & 0 deletions games-emulation/cemu/livecheck.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "branch": "main" }
16 changes: 16 additions & 0 deletions games-emulation/cemu/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>audvare@gmail.com</email>
<name>Andrew Udvare</name>
</maintainer>
<upstream>
<remote-id type="github">cemu-project/Cemu</remote-id>
</upstream>
<use>
<flag name="cubeb">Enable cubeb audio support</flag>
<flag name="discord">Enable rich Discord presence</flag>
<flag name="vulkan">Enable Vulkan graphics support</flag>
</use>
</pkgmetadata>

0 comments on commit 4de39eb

Please sign in to comment.