about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/emulators/duckstation/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/emulators/duckstation/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/emulators/duckstation/default.nix58
1 files changed, 37 insertions, 21 deletions
diff --git a/nixpkgs/pkgs/applications/emulators/duckstation/default.nix b/nixpkgs/pkgs/applications/emulators/duckstation/default.nix
index 87470f561413..e7980e20dddd 100644
--- a/nixpkgs/pkgs/applications/emulators/duckstation/default.nix
+++ b/nixpkgs/pkgs/applications/emulators/duckstation/default.nix
@@ -8,31 +8,45 @@
 , curl
 , extra-cmake-modules
 , libXrandr
+, libbacktrace
 , makeDesktopItem
-, mesa # for libgbm
 , ninja
 , pkg-config
 , qtbase
 , qtsvg
 , qttools
 , qtwayland
+, substituteAll
 , vulkan-loader
 , wayland
 , wrapQtAppsHook
 , enableWayland ? true
 }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation (finalAttrs: {
   pname = "duckstation";
-  version = "unstable-2023-04-14";
+  version = "unstable-2023-09-30";
 
   src = fetchFromGitHub {
     owner = "stenzek";
     repo = "duckstation";
-    rev = "5fee6f5abee7f3aad65da5523e57896e10e2a53a";
-    sha256 = "sha256-sRs/b4GVXhF3zrOef8DSBKJJGYECUER/nNWZAqv7suA=";
+    rev = "d5608bf12df7a7e03750cb94a08a3d7999034ae2";
+    hash = "sha256-ktfZgacjkN6GQb1vLmyTZMr8QmmH12qAvFSIBTjgRSs=";
   };
 
+  patches = [
+    # Tests are not built by default
+    ./001-fix-test-inclusion.diff
+    # Patching yet another script that fills data based on git commands...
+    (substituteAll {
+      src = ./002-hardcode-vars.diff;
+      gitHash = finalAttrs.src.rev;
+      gitBranch = "master";
+      gitTag = "0.1-5889-gd5608bf1";
+      gitDate = "2023-09-30T23:20:09+10:00";
+    })
+  ];
+
   nativeBuildInputs = [
     cmake
     copyDesktopItems
@@ -49,7 +63,7 @@ stdenv.mkDerivation {
     SDL2
     curl
     libXrandr
-    mesa
+    libbacktrace
     qtbase
     qtsvg
     vulkan-loader
@@ -60,10 +74,12 @@ stdenv.mkDerivation {
   ]
   ++ cubeb.passthru.backendLibs;
 
+  strictDeps = true;
+
   cmakeFlags = [
-    "-DUSE_DRMKMS=ON"
-  ]
-  ++ lib.optionals enableWayland [ "-DUSE_WAYLAND=ON" ];
+    (lib.cmakeBool "BUILD_TESTS" true)
+    (lib.cmakeBool "ENABLE_WAYLAND" enableWayland)
+  ];
 
   desktopItems = [
     (makeDesktopItem {
@@ -79,6 +95,13 @@ stdenv.mkDerivation {
     })
   ];
 
+  doCheck = true;
+  checkPhase = ''
+    runHook preCheck
+    bin/common-tests
+    runHook postCheck
+  '';
+
   installPhase = ''
     runHook preInstall
 
@@ -92,23 +115,16 @@ stdenv.mkDerivation {
     runHook postInstall
   '';
 
-  doCheck = true;
-  checkPhase = ''
-    runHook preCheck
-    bin/common-tests
-    runHook postCheck
-  '';
-
   qtWrapperArgs = [
     "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([ vulkan-loader ] ++ cubeb.passthru.backendLibs)}"
   ];
 
-  meta = with lib; {
+  meta = {
     homepage = "https://github.com/stenzek/duckstation";
     description = "Fast PlayStation 1 emulator for x86-64/AArch32/AArch64";
-    license = licenses.gpl3Only;
+    license = lib.licenses.gpl3Only;
     mainProgram = "duckstation-qt";
-    maintainers = with maintainers; [ guibou AndersonTorres ];
-    platforms = platforms.linux;
+    maintainers = with lib.maintainers; [ guibou AndersonTorres ];
+    platforms = lib.platforms.linux;
   };
-}
+})