From a9d7bbb137571d0b5797c7a8b1fe8f40dd2ce5a6 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 28 Jan 2024 11:10:10 -0300 Subject: [PATCH 1/2] ppsspp: refactor - cosmetic line breaks - use lib.cmake* functionalities - meta.longDescriptiom - meta.mainProgram --- pkgs/by-name/pp/ppsspp/package.nix | 39 +++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/pp/ppsspp/package.nix b/pkgs/by-name/pp/ppsspp/package.nix index 4b84faee15ab..4537d21b03cb 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; }; }) From ed17c32c97efb1487071a02ffce7a967c57f03d8 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 28 Jan 2024 13:12:24 -0300 Subject: [PATCH 2/2] ppsspp: 1.16.1 -> 1.17 Co-authored-by: R. RyanTM --- pkgs/by-name/pp/ppsspp/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/pp/ppsspp/package.nix b/pkgs/by-name/pp/ppsspp/package.nix index 4537d21b03cb..9e02fba4546f 100644 --- a/pkgs/by-name/pp/ppsspp/package.nix +++ b/pkgs/by-name/pp/ppsspp/package.nix @@ -34,14 +34,14 @@ stdenv.mkDerivation (finalAttrs: { + lib.optionalString enableQt "-qt" + lib.optionalString (!enableQt) "-sdl" + lib.optionalString forceWayland "-wayland"; - version = "1.16.6"; + version = "1.17"; src = fetchFromGitHub { owner = "hrydgard"; repo = "ppsspp"; rev = "v${finalAttrs.version}"; fetchSubmodules = true; - hash = "sha256-FCdYvYKcV+0TpQUSWiooNlTXKYtqbfnAWwjk7M8iF1Q="; + hash = "sha256-BJWcaxUUxNDiSX3YnhwXhgbp3iymcrR493BKrtivn3U="; }; postPatch = ''