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