@@ -1,33 +1,88 @@
1−{ lib, mkDerivation, fetchFromGitHub, cmake, pkg-config, SDL2, qtbase
2−, wrapQtAppsHook, qttools, ninja, gtk3 }:
1+{ lib
2+, mkDerivation
3+, fetchFromGitHub
4+, cmake
5+, extra-cmake-modules
6+, pkg-config
7+, SDL2
8+, qtbase
9+, wrapQtAppsHook
10+, qttools
11+, ninja
12+, gtk3
13+, libevdev
14+, curl
15+, libpulseaudio
16+, sndio
17+, mesa
18+}:
319mkDerivation rec {
420 pname = "duckstation";
5− version = "unstable-2020-12-29";
21+ version = "unstable-2021-10-01";
622
723 src = fetchFromGitHub {
824 owner = "stenzek";
925 repo = pname;
10− rev = "f8dcfabc44ff8391b2d41eab2e883dc8f21a88b7";
11− sha256 = "0v6w4di4yj1hbxpqqrcw8rbfjg18g9kla8mnb3b5zgv7i4dyzykw";
26+ rev = "a7096f033ecca48827fa55825fc0d0221265f1c2";
27+ sha256 = "sha256-e/Y1TJBuY76q3/0MCAqu9AJzLxIoJ8FJUV5vc/AgcjA=";
1228 };
1329
14− nativeBuildInputs = [ cmake wrapQtAppsHook qttools ];
30+ nativeBuildInputs = [ cmake ninja pkg-config extra-cmake-modules wrapQtAppsHook qttools ];
1531
16− buildInputs = [ SDL2 qtbase gtk3 pkg-config ];
32+ buildInputs = [
33+ SDL2
34+ qtbase
35+ gtk3
36+ libevdev
37+ sndio
38+ mesa
39+ curl
40+ libpulseaudio
41+ ];
42+
43+ cmakeFlags = [
44+ "-DUSE_DRMKMS=ON"
45+ "-DUSE_EGL=ON"
46+ ];
47+
48+ postPatch = ''
49+ substituteInPlace extras/linux-desktop-files/duckstation-qt.desktop \
50+ --replace "duckstation-qt" "duckstation" \
51+ --replace "TryExec=duckstation" "tryExec=duckstation-qt" \
52+ --replace "Exec=duckstation" "Exec=duckstation-qt"
53+ substituteInPlace extras/linux-desktop-files/duckstation-nogui.desktop \
54+ --replace "duckstation-nogui" "duckstation" \
55+ --replace "TryExec=duckstation" "tryExec=duckstation-nogui" \
56+ --replace "Exec=duckstation" "Exec=duckstation-nogui"
57+ '';
1758
1859 installPhase = ''
19− mkdir -p $out/
20− mv bin $out/
60+ runHook preInstall
61+ mkdir -p $out/bin $out/share $out/share/pixmaps $out/share/applications
62+ rm bin/common-tests
63+
64+ cp -r bin $out/share/duckstation
65+ ln -s $out/share/duckstation/duckstation-{qt,nogui} $out/bin/
66+
67+ cp ../extras/icons/icon-256px.png $out/share/pixmaps/duckstation.png
68+ cp ../extras/linux-desktop-files/* $out/share/applications/
69+ runHook postInstall
70+ '';
71+
72+ doCheck = true;
73+ checkPhase = ''
74+ runHook preCheck
75+ ./bin/common-tests
76+ runHook postCheck
2177 '';
2278
2379 # TODO:
2480 # - vulkan graphics backend (OpenGL works).
2581 # - default sound backend (cubeb) does not work, but SDL does.
2682 meta = with lib; {
27− description =
28− "PlayStation 1 emulator focusing on playability, speed and long-term maintainability";
83+ description = "PlayStation 1 emulator focusing on playability, speed and long-term maintainability";
2984 homepage = "https://github.com/stenzek/duckstation";
30− license = licenses.gpl3;
85+ license = licenses.gpl3Only;
3186 platforms = platforms.linux;
3287 maintainers = [ maintainers.guibou ];
3388 };