about summary refs log tree commit diff
path: root/pkgs/by-name/pp
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2024-01-28 11:10:10 -0300
committerAnderson Torres <torres.anderson.85@protonmail.com>2024-01-28 13:11:52 -0300
commita9d7bbb137571d0b5797c7a8b1fe8f40dd2ce5a6 (patch)
treeb2d255ab28678b6cd1b0796dfd00a89aa41e550b /pkgs/by-name/pp
parente63efbf4e95d3ea3c147617e41cee3fb1dee5587 (diff)
ppsspp: refactor
- cosmetic line breaks
- use lib.cmake* functionalities
- meta.longDescriptiom
- meta.mainProgram
Diffstat (limited to 'pkgs/by-name/pp')
-rw-r--r--pkgs/by-name/pp/ppsspp/package.nix39
1 files changed, 27 insertions, 12 deletions
diff --git a/pkgs/by-name/pp/ppsspp/package.nix b/pkgs/by-name/pp/ppsspp/package.nix
index 4b84faee15ab4..4537d21b03cba 100644
--- a/pkgs/by-name/pp/ppsspp/package.nix
+++ b/pkgs/by-name/pp/ppsspp/package.nix
@@ -55,7 +55,7 @@ stdenv.mkDerivation (finalAttrs: {
     makeWrapper
     pkg-config
     python3
-  ] ++ lib.optional enableQt wrapQtAppsHook;
+  ] ++ lib.optionals enableQt [ wrapQtAppsHook ];
 
   buildInputs = [
     SDL2
@@ -67,17 +67,17 @@ stdenv.mkDerivation (finalAttrs: {
   ] ++ lib.optionals enableQt [
     qtbase
     qtmultimedia
-  ] ++ lib.optional enableVulkan vulkan-loader
+  ] ++ lib.optionals enableVulkan [ vulkan-loader ]
   ++ lib.optionals vulkanWayland [ wayland libffi ];
 
   cmakeFlags = [
-    "-DHEADLESS=${if enableQt then "OFF" else "ON"}"
-    "-DOpenGL_GL_PREFERENCE=GLVND"
-    "-DUSE_SYSTEM_FFMPEG=ON"
-    "-DUSE_SYSTEM_LIBZIP=ON"
-    "-DUSE_SYSTEM_SNAPPY=ON"
-    "-DUSE_WAYLAND_WSI=${if vulkanWayland then "ON" else "OFF"}"
-    "-DUSING_QT_UI=${if enableQt then "ON" else "OFF"}"
+    (lib.cmakeBool "HEADLESS" (!enableQt))
+    (lib.cmakeBool "USE_SYSTEM_FFMPEG" true)
+    (lib.cmakeBool "USE_SYSTEM_LIBZIP" true)
+    (lib.cmakeBool "USE_SYSTEM_SNAPPY" true)
+    (lib.cmakeBool "USE_WAYLAND_WSI" vulkanWayland)
+    (lib.cmakeBool "USING_QT_UI" enableQt)
+    (lib.cmakeFeature "OpenGL_GL_PREFERENCE" "GLVND")
   ];
 
   desktopItems = [
@@ -98,7 +98,8 @@ stdenv.mkDerivation (finalAttrs: {
       runHook preInstall
 
       mkdir -p $out/share/{applications,ppsspp,icons}
-    '' + (if enableQt then ''
+    ''
+    + (if enableQt then ''
       install -Dm555 PPSSPPQt $out/bin/ppsspp
       wrapProgram $out/bin/ppsspp \
     '' else ''
@@ -106,9 +107,12 @@ stdenv.mkDerivation (finalAttrs: {
       install -Dm555 PPSSPPSDL $out/share/ppsspp/
       makeWrapper $out/share/ppsspp/PPSSPPSDL $out/bin/ppsspp \
         --set SDL_VIDEODRIVER ${if forceWayland then "wayland" else "x11"} \
-    '') + lib.optionalString enableVulkan ''
+    '')
+    + lib.optionalString enableVulkan ''
         --prefix LD_LIBRARY_PATH : ${vulkanPath} \
-    '' + "\n" + ''
+    ''
+    + ''
+
       mv assets $out/share/ppsspp
       mv ../icons/hicolor $out/share/icons
 
@@ -119,8 +123,19 @@ stdenv.mkDerivation (finalAttrs: {
     homepage = "https://www.ppsspp.org/";
     description = "A HLE Playstation Portable emulator, written in C++ ("
                   + (if enableQt then "Qt" else "SDL + headless") + ")";
+    longDescription = ''
+      PPSSPP is a PSP emulator, which means that it can run games and other
+      software that was originally made for the Sony PSP.
+
+      The PSP had multiple types of software. The two most common are native PSP
+      games on UMD discs and downloadable games (that were stored in the
+      directory PSP/GAME on the "memory stick"). But there were also UMD Video
+      discs, and PS1 games that could run in a proprietary emulator. PPSSPP does
+      not run those.
+    '';
     license = lib.licenses.gpl2Plus;
     maintainers = [ lib.maintainers.AndersonTorres ];
+    mainProgram = "ppsspp";
     platforms = lib.platforms.linux;
   };
 })