39 # cemu doesn't build with imgui 1.90.2 or newer:
40 # error: 'struct ImGuiIO' has no member named 'ImeWindowHandle'
41 imgui' = imgui.overrideAttrs rec {
43 src = fetchFromGitHub {
47 hash = "sha256-gf47uLeNiXQic43buB5ZnMqiotlUfIyAsP+3H7yJuFg=";
50 in stdenv.mkDerivation (finalAttrs: {
54 src = fetchFromGitHub {
55 owner = "cemu-project";
57 rev = "v${finalAttrs.version}";
58 hash = "sha256-bjt+2RzmG8iKcdyka4HsHM5NEzCwGah4s9eiywSHXbw=";
62 # glslangTargets want SPIRV-Tools-opt to be defined:
63 # > The following imported targets are referenced, but are missing:
65 ./0000-spirv-tools-opt-cmakelists.patch
104 (lib.cmakeFeature "CMAKE_C_FLAGS_RELEASE" "-DNDEBUG")
105 (lib.cmakeFeature "CMAKE_CXX_FLAGS_RELEASE" "-DNDEBUG")
106 (lib.cmakeBool "ENABLE_VCPKG" false)
107 (lib.cmakeBool "ENABLE_FERAL_GAMEMODE" true)
109 # PORTABLE: "All data created and maintained by Cemu will be in
110 # the directory where the executable file is located"
111 (lib.cmakeBool "PORTABLE" false)
117 tag = lib.last (lib.splitString "-" finalAttrs.version);
119 rm -rf dependencies/imgui
120 # cemu expects imgui source code, not just header files
121 ln -s ${imgui'.src} dependencies/imgui
122 substituteInPlace src/Common/version.h --replace-fail " (experimental)" "-${tag} (experimental)"
123 substituteInPlace dependencies/gamemode/lib/gamemode_client.h --replace-fail "libgamemode.so.0" "${gamemode.lib}/lib/libgamemode.so.0"
129 install -Dm755 ../bin/Cemu_release $out/bin/Cemu
130 ln -s $out/bin/Cemu $out/bin/cemu
132 mkdir -p $out/share/applications
133 substitute ../dist/linux/info.cemu.Cemu.desktop $out/share/applications/info.cemu.Cemu.desktop \
134 --replace "Exec=Cemu" "Exec=$out/bin/Cemu"
136 install -Dm644 ../dist/linux/info.cemu.Cemu.metainfo.xml -t $out/share/metainfo
137 install -Dm644 ../src/resource/logo_icon.png $out/share/icons/hicolor/128x128/apps/info.cemu.Cemu.png
143 libs = [ vulkan-loader ] ++ cubeb.passthru.backendLibs;
146 --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libs}"
151 updateScript = nix-update-script { };
153 version = testers.testVersion {
154 package = finalAttrs.finalPackage;
160 description = "Software to emulate Wii U games and applications on PC";
161 homepage = "https://cemu.info";
162 license = lib.licenses.mpl20;
163 mainProgram = "cemu";
164 maintainers = with lib.maintainers; [ zhaofengli baduhai AndersonTorres ];
165 platforms = [ "x86_64-linux" ];