Skip to content

Commit

Permalink
Cemu: 2.0-92 -> 2.2 (#353870)
Browse files Browse the repository at this point in the history
  • Loading branch information
jopejoe1 authored Nov 6, 2024
2 parents 336f37f + cd31998 commit 9c8b539
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 23 deletions.
2 changes: 1 addition & 1 deletion maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2351,7 +2351,7 @@
email = "[email protected]";
github = "baduhai";
githubId = 31864305;
name = "William";
name = "William Hai";
};
baitinq = {
email = "[email protected]";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/ce/cemu/0000-spirv-tools-opt-cmakelists.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b2b789..48d9be0 100644
index 54e2012..a9b6b0e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -92,6 +92,7 @@ find_package(pugixml REQUIRED)
@@ -149,6 +149,7 @@ find_package(pugixml REQUIRED)
find_package(RapidJSON REQUIRED)
find_package(Boost COMPONENTS program_options filesystem nowide REQUIRED)
find_package(libzip REQUIRED)
Expand Down
13 changes: 13 additions & 0 deletions pkgs/by-name/ce/cemu/0001-glslang-cmake-target.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/Cafe/CMakeLists.txt.orig b/src/Cafe/CMakeLists.txt
index 91d257b..cff779a 100644
--- a/src/Cafe/CMakeLists.txt
+++ b/src/Cafe/CMakeLists.txt
@@ -545,7 +545,7 @@ target_link_libraries(CemuCafe PRIVATE
Boost::nowide
CURL::libcurl
fmt::fmt
- glslang::SPIRV
+ glslang::glslang
ih264d
OpenSSL::Crypto
OpenSSL::SSL
53 changes: 33 additions & 20 deletions pkgs/by-name/ce/cemu/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,24 @@ let
hash = "sha256-gf47uLeNiXQic43buB5ZnMqiotlUfIyAsP+3H7yJuFg=";
};
};
in stdenv.mkDerivation (finalAttrs: {
in
stdenv.mkDerivation (finalAttrs: {
pname = "cemu";
version = "2.0-92";
version = "2.2";

src = fetchFromGitHub {
owner = "cemu-project";
repo = "Cemu";
rev = "v${finalAttrs.version}";
hash = "sha256-bjt+2RzmG8iKcdyka4HsHM5NEzCwGah4s9eiywSHXbw=";
hash = "sha256-d4FMAj99SPj5S1p5nAUFNo386ZJvWxOKD9iGxHJYVBI=";
};

patches = [
# glslangTargets want SPIRV-Tools-opt to be defined:
# > The following imported targets are referenced, but are missing:
# > SPIRV-Tools-opt
./0000-spirv-tools-opt-cmakelists.patch
./0001-glslang-cmake-target.patch
];

nativeBuildInputs = [
Expand Down Expand Up @@ -113,15 +115,20 @@ in stdenv.mkDerivation (finalAttrs: {

strictDeps = true;

preConfigure = let
tag = lib.last (lib.splitString "-" finalAttrs.version);
in ''
rm -rf dependencies/imgui
# cemu expects imgui source code, not just header files
ln -s ${imgui'.src} dependencies/imgui
substituteInPlace src/Common/version.h --replace-fail " (experimental)" "-${tag} (experimental)"
substituteInPlace dependencies/gamemode/lib/gamemode_client.h --replace-fail "libgamemode.so.0" "${gamemode.lib}/lib/libgamemode.so.0"
'';
preConfigure =
let
tag = lib.splitString "." (lib.last (lib.splitString "-" finalAttrs.version));
majorv = builtins.elemAt tag 0;
minorv = builtins.elemAt tag 1;
in
''
rm -rf dependencies/imgui
# cemu expects imgui source code, not just header files
ln -s ${imgui'.src} dependencies/imgui
substituteInPlace CMakeLists.txt --replace-fail "EMULATOR_VERSION_MAJOR \"0\"" "EMULATOR_VERSION_MAJOR \"${majorv}\""
substituteInPlace CMakeLists.txt --replace-fail "EMULATOR_VERSION_MINOR \"0\"" "EMULATOR_VERSION_MINOR \"${minorv}\""
substituteInPlace dependencies/gamemode/lib/gamemode_client.h --replace-fail "libgamemode.so.0" "${gamemode.lib}/lib/libgamemode.so.0"
'';

installPhase = ''
runHook preInstall
Expand All @@ -139,13 +146,15 @@ in stdenv.mkDerivation (finalAttrs: {
runHook postInstall
'';

preFixup = let
libs = [ vulkan-loader ] ++ cubeb.passthru.backendLibs;
in ''
gappsWrapperArgs+=(
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libs}"
)
'';
preFixup =
let
libs = [ vulkan-loader ] ++ cubeb.passthru.backendLibs;
in
''
gappsWrapperArgs+=(
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libs}"
)
'';

passthru = {
updateScript = nix-update-script { };
Expand All @@ -161,7 +170,11 @@ in stdenv.mkDerivation (finalAttrs: {
homepage = "https://cemu.info";
license = lib.licenses.mpl20;
mainProgram = "cemu";
maintainers = with lib.maintainers; [ zhaofengli baduhai AndersonTorres ];
maintainers = with lib.maintainers; [
zhaofengli
baduhai
AndersonTorres
];
platforms = [ "x86_64-linux" ];
};
})

0 comments on commit 9c8b539

Please sign in to comment.