anchor.diff:      runHook postCheck
     '';
   
  +  qtWrapperArgs = [
  +    "--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib"
  +  ];
  +
     # TODO:
  -  # - vulkan graphics backend (OpenGL works).
  -  # - default sound backend (cubeb) does not work, but SDL does.
  +  # - default sound backend (cubeb) does not work, but SDL does. Strangely, switching to cubeb while a game is running makes it work.
  +
     meta = with lib; {
       description = "PlayStation 1 emulator focusing on playability, speed and long-term maintainability";
       homepage = "https://github.com/stenzek/duckstation";
  
positive.code:     mesa
      curl
      libpulseaudio
    ];
  
    cmakeFlags = [
      "-DUSE_DRMKMS=ON"
      "-DUSE_EGL=ON"
    ];
  
    postPatch = ''
  
negative.code: , libpulseaudio
  , sndio
  , mesa
  , vulkan-loader
  , wayland
  }:
  mkDerivation rec {
    pname = "duckstation";
    version = "unstable-2021-10-19";
  
    src = fetchFromGitHub {
      owner = "stenzek";
      repo = pname;
      rev = "96f4fdf8d88ff3a120f3bc409a6a6487cdcbd55f";
      sha256 = "sha256-WWsi7kmFEYES2BoNKIFF1+lKHJGP3hbTZ9o3eWp+EcE=";
    };
  
    nativeBuildInputs = [ cmake ninja pkg-config extra-cmake-modules wrapQtAppsHook qttools ];
  