Change:
When adding the ppsspp package (or any of its derivates such as ppsspp-sdl-wayland) and running a game, I would get very severe graphical glitches during cutscene or video playback. After reaching out to the PPSSPP team, they mentioned that building with the USESYSTEMFFMPEG flag set to true can cause these issues and is not recommended. After locally building PPSSPP using the file from this repo modified to have USESYSTEMFFMPEG = false (and removing the ffmpeg4 build inputs), I can confirm that the games that I used to have graphical glitches on, now work perfectly. I can create a pull request for this but this is my first time working with packaging in nix and wanted to see if there was a specific reason why USESYSTEMFFMPEG is used (or if it's maybe against design principles of nix to use bundled ffmpeg libraries in apps) Steps to reproduce the behavior: package ppsspp as normal -you get behaviour similar to the before screenshot package ppsspp using modified that has USESYSTEMFFMPEG = false -you get behaviour similar to the after screenshot The after behaviour is expected. Before: <img width="567" alt="Screenshot 2024-04-16 " src=""<img width="563" alt="Screenshot 2024-04-16 " src=""After: ! Please run and paste the result. Add a :+1: [reaction] to [issues you find important]. [reaction]: [issues you find important]:
By default we prefer to use system libraries, in order to avoid duplication and increase "cache hits" from Hydra. Further, I particularly subscribe to some recommendations from Gentoo team: Nonetheless I will verify this issue tomorrow or asap
I agree with that statement to limit dependency bundling as much as possible, but happy to see what you get out of your testing :). I'm good for now since I build the package myself with my modified
Would be interesting to know why they bundle ffmpeg and what patches they use

Discussion:
<del> { lib , stdenv , fetchFromGitHub , SDL2 , cmake , copyDesktopItems , ffmpeg_4 , glew , libffi , libsForQt5 , libzip , makeDesktopItem , makeWrapper , pkg-config , python3 , snappy , vulkan-loader , wayland , zlib , enableQt ? false , enableVulkan ? true , forceWayland ? false </del> <ins> { lib, SDL2, cmake, copyDesktopItems, fetchFromGitHub, ffmpeg, glew, libffi, libsForQt5, libzip, makeDesktopItem, makeWrapper, pkg-config, python3, snappy, stdenv, vulkan-loader, wayland, zlib, enableQt ? false, enableVulkan ? true, forceWayland ? false, useSystemFfmpeg? false, useSystemSnappy? true, </ins> }: let

makeWrapper pkg-config python3 <del> ] ++ lib.optionals enableQt [ wrapQtAppsHook ]; </del> <ins> ] ++ lib.optionals enableQt [ wrapQtAppsHook ]; </ins> buildInputs = [ SDL2 <del> ffmpeg_4 (glew.override { enableEGL = forceWayland; }) </del> <ins> glew </ins> libzip <del> snappy </del> zlib <del> ] ++ lib.optionals enableQt [ </del> <ins> ] ++ lib.optionals useSystemFfmpeg [ ffmpeg ] ++ lib.optionals useSystemSnappy [ snappy ] ++ lib.optionals enableQt [ </ins> qtbase qtmultimedia <del> ] ++ lib.optionals enableVulkan [ vulkan-loader ] </del> <ins> ] ++ lib.optionals enableVulkan [ vulkan-loader ] </ins> ++ lib.optionals vulkanWayland [ wayland libffi ]; cmakeFlags = [ (lib.cmakeBool "HEADLESS" (!enableQt)) <del> (lib.cmakeBool "USE_SYSTEM_FFMPEG" true) </del> <ins> (lib.cmakeBool "USE_SYSTEM_FFMPEG" useSystemFfmpeg) </ins> (lib.cmakeBool "USE_SYSTEM_LIBZIP" true) <del> (lib.cmakeBool "USE_SYSTEM_SNAPPY" true) </del> <ins> (lib.cmakeBool "USE_SYSTEM_SNAPPY" useSystemSnappy) </ins> (lib.cmakeBool "USE_WAYLAND_WSI" vulkanWayland) (lib.cmakeBool "USING_QT_UI" enableQt) (lib.cmakeFeature "OpenGL_GL_PREFERENCE" "GLVND")

}) ]; <del> installPhase = let vulkanPath = lib.makeLibraryPath [ vulkan-loader ]; in '' runHook preInstall </del> <ins> installPhase = lib.concatStringsSep "n" ([ ''runHook preInstall'' ] ++ [ ''mkdir -p $out/share/{applications,ppsspp/bin,icons}'' ] ++ (if enableQt then [ ''install -Dm555 PPSSPPQt $out/share/ppsspp/bin/'' ] else [ ''install -Dm555 PPSSPPHeadless $out/share/ppsspp/bin/'' ''makeWrapper $out/share/ppsspp/bin/PPSSPPHeadless $out/bin/ppsspp-headless'' ''install -Dm555 PPSSPPSDL $out/share/ppsspp/bin/'' ]) ++ [ ''mv assets $out/share/ppsspp'' ''mv ../icons/hicolor $out/share/icons'' ] ++ [ ''runHook postInstall'' ]); </ins> <del> mkdir -p $out/share/{applications,ppsspp,icons} '' + (if enableQt then '' install -Dm555 PPSSPPQt $out/bin/ppsspp wrapProgram $out/bin/ppsspp  '' else '' install -Dm555 PPSSPPHeadless $out/bin/ppsspp-headless 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 '' --prefix LD_LIBRARY_PATH : ${vulkanPath}  '' + '' mv assets $out/share/ppsspp mv ../icons/hicolor $out/share/icons runHook postInstall ''; </del> <ins> postFixup = let wrapperArgs = lib.concatStringsSep " " (lib.optionals enableVulkan [ "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ vulkan-loader ]}" ] ++ lib.optionals (!enableQt) [ "--set SDL_VIDEODRIVER ${if forceWayland then "wayland" else "x11"}" ]); binToBeWrapped = if enableQt then "PPSSPPQt" else "PPSSPPSDL"; in ''makeWrapper $out/share/ppsspp/bin/${binToBeWrapped} $out/bin/ppsspp ${wrapperArgs}''; </ins> meta = { homepage = "https://www.ppsspp.org/";

pcsxr = callPackage ../applications/emulators/pcsxr { }; <del> ppsspp-sdl = ppsspp.override { enableQt = false; enableVulkan = true; }; ppsspp-sdl-wayland = ppsspp.override { forceWayland = true; enableVulkan = false; # https://github.com/hrydgard/ppsspp/issues/13845 }; ppsspp-qt = ppsspp.override { enableQt = true; enableVulkan = false; # https://github.com/hrydgard/ppsspp/issues/11628 }; </del> <ins> ppsspp-sdl = let argset = { ffmpeg = ffmpeg_4; glew = glew.override { enableEGL = argset.forceWayland; }; enableQt = false; enableVulkan = true; forceWayland = false; }; in ppsspp.override argset; ppsspp-sdl-wayland = let argset = { ffmpeg = ffmpeg_4; glew = glew.override { enableEGL = argset.forceWayland; }; enableQt = false; enableVulkan = false; # https://github.com/hrydgard/ppsspp/issues/13845 forceWayland = true; }; in ppsspp.override argset; ppsspp-qt = let argset = { ffmpeg = ffmpeg_4; glew = glew.override { enableEGL = argset.forceWayland; }; enableQt = true; enableVulkan = false; # https://github.com/hrydgard/ppsspp/issues/11628 forceWayland = false; }; in ppsspp.override argset; </ins> proton-caller = callPackage ../applications/emulators/proton-caller { };