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=";
51 stdenv.mkDerivation (finalAttrs: {
55 src = fetchFromGitHub {
56 owner = "cemu-project";
58 rev = "v${finalAttrs.version}";
59 hash = "sha256-JBd5ntU1fFDvQpNbfP63AQANzuQTdfd4dfB29/BN5LM=";
63 # glslangTargets want SPIRV-Tools-opt to be defined:
64 # > The following imported targets are referenced, but are missing:
66 ./0000-spirv-tools-opt-cmakelists.patch
67 ./0001-glslang-cmake-target.patch
106 (lib.cmakeFeature "CMAKE_C_FLAGS_RELEASE" "-DNDEBUG")
107 (lib.cmakeFeature "CMAKE_CXX_FLAGS_RELEASE" "-DNDEBUG")
108 (lib.cmakeBool "ENABLE_VCPKG" false)
109 (lib.cmakeBool "ENABLE_FERAL_GAMEMODE" true)
111 # PORTABLE: "All data created and maintained by Cemu will be in
112 # the directory where the executable file is located"
113 (lib.cmakeBool "PORTABLE" false)
120 tag = lib.splitString "." (lib.last (lib.splitString "-" finalAttrs.version));
121 majorv = builtins.elemAt tag 0;
122 minorv = builtins.elemAt tag 1;
125 rm -rf dependencies/imgui
126 # cemu expects imgui source code, not just header files
127 ln -s ${imgui'.src} dependencies/imgui
128 substituteInPlace CMakeLists.txt --replace-fail "EMULATOR_VERSION_MAJOR \"0\"" "EMULATOR_VERSION_MAJOR \"${majorv}\""
129 substituteInPlace CMakeLists.txt --replace-fail "EMULATOR_VERSION_MINOR \"0\"" "EMULATOR_VERSION_MINOR \"${minorv}\""
130 substituteInPlace dependencies/gamemode/lib/gamemode_client.h --replace-fail "libgamemode.so.0" "${gamemode.lib}/lib/libgamemode.so.0"
136 install -Dm755 ../bin/Cemu_release $out/bin/Cemu
137 ln -s $out/bin/Cemu $out/bin/cemu
139 mkdir -p $out/share/applications
140 substitute ../dist/linux/info.cemu.Cemu.desktop $out/share/applications/info.cemu.Cemu.desktop \
141 --replace "Exec=Cemu" "Exec=$out/bin/Cemu"
143 install -Dm644 ../dist/linux/info.cemu.Cemu.metainfo.xml -t $out/share/metainfo
144 install -Dm644 ../src/resource/logo_icon.png $out/share/icons/hicolor/128x128/apps/info.cemu.Cemu.png
151 libs = [ vulkan-loader ] ++ cubeb.passthru.backendLibs;
155 --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libs}"
160 updateScript = nix-update-script { };
162 version = testers.testVersion {
163 package = finalAttrs.finalPackage;
169 description = "Software to emulate Wii U games and applications on PC";
170 homepage = "https://cemu.info";
171 license = lib.licenses.mpl20;
172 mainProgram = "cemu";
173 maintainers = with lib.maintainers; [
178 platforms = [ "x86_64-linux" ];