25 useSystemFfmpeg? false,
26 useSystemSnappy? true,
30 # experimental, see https://github.com/hrydgard/ppsspp/issues/13845
31 vulkanWayland = enableVulkan && forceWayland;
32 inherit (libsForQt5) qtbase qtmultimedia wrapQtAppsHook;
34 # Only SDL frontend needs to specify whether to use Wayland
35 assert forceWayland -> !enableQt;
36 stdenv.mkDerivation (finalAttrs: {
38 + lib.optionalString enableQt "-qt"
39 + lib.optionalString (!enableQt) "-sdl"
40 + lib.optionalString forceWayland "-wayland";
43 src = fetchFromGitHub {
46 rev = "v${finalAttrs.version}";
47 fetchSubmodules = true;
48 hash = "sha256-I84zJqEE1X/eo/ukeGA2iZe3lWKvilk+RNGUzl2wZXY=";
52 substituteInPlace git-version.cmake --replace unknown ${finalAttrs.src.rev}
53 substituteInPlace UI/NativeApp.cpp --replace /usr/share $out/share
63 ++ lib.optionals enableQt [ wrapQtAppsHook ];
71 ++ lib.optionals useSystemFfmpeg [
74 ++ lib.optionals useSystemSnappy [
77 ++ lib.optionals enableQt [
81 ++ lib.optionals enableVulkan [ vulkan-loader ]
82 ++ lib.optionals vulkanWayland [ wayland libffi ];
85 (lib.cmakeBool "HEADLESS" (!enableQt))
86 (lib.cmakeBool "USE_SYSTEM_FFMPEG" useSystemFfmpeg)
87 (lib.cmakeBool "USE_SYSTEM_LIBZIP" true)
88 (lib.cmakeBool "USE_SYSTEM_SNAPPY" useSystemSnappy)
89 (lib.cmakeBool "USE_WAYLAND_WSI" vulkanWayland)
90 (lib.cmakeBool "USING_QT_UI" enableQt)
91 (lib.cmakeFeature "OpenGL_GL_PREFERENCE" "GLVND")
96 desktopName = "PPSSPP";
100 comment = "Play PSP games on your computer";
101 categories = [ "Game" "Emulator" ];
106 lib.concatStringsSep "\n" ([
107 ''runHook preInstall''
110 ''mkdir -p $out/share/{applications,ppsspp/bin,icons}''
112 ++ (if enableQt then [
113 ''install -Dm555 PPSSPPQt $out/share/ppsspp/bin/''
115 ''install -Dm555 PPSSPPHeadless $out/share/ppsspp/bin/''
116 ''makeWrapper $out/share/ppsspp/bin/PPSSPPHeadless $out/bin/ppsspp-headless''
117 ''install -Dm555 PPSSPPSDL $out/share/ppsspp/bin/''
120 ''mv assets $out/share/ppsspp''
121 ''mv ../icons/hicolor $out/share/icons''
124 ''runHook postInstall''
130 lib.concatStringsSep " "
131 (lib.optionals enableVulkan [
132 "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ vulkan-loader ]}"
133 ] ++ lib.optionals (!enableQt) [
134 "--set SDL_VIDEODRIVER ${if forceWayland then "wayland" else "x11"}"
136 binToBeWrapped = if enableQt then "PPSSPPQt" else "PPSSPPSDL";
138 ''makeWrapper $out/share/ppsspp/bin/${binToBeWrapped} $out/bin/ppsspp ${wrapperArgs}'';
141 homepage = "https://www.ppsspp.org/";
142 description = "HLE Playstation Portable emulator, written in C++ ("
143 + (if enableQt then "Qt" else "SDL + headless") + ")";
145 PPSSPP is a PSP emulator, which means that it can run games and other
146 software that was originally made for the Sony PSP.
148 The PSP had multiple types of software. The two most common are native PSP
149 games on UMD discs and downloadable games (that were stored in the
150 directory PSP/GAME on the "memory stick"). But there were also UMD Video
151 discs, and PS1 games that could run in a proprietary emulator. PPSSPP does
154 license = lib.licenses.gpl2Plus;
155 maintainers = [ lib.maintainers.AndersonTorres ];
156 mainProgram = "ppsspp";
157 platforms = lib.platforms.linux;