2021-10-04 06:27:33 +02:00
|
|
|
{ lib
|
|
|
|
, mkDerivation
|
|
|
|
, fetchFromGitHub
|
2021-12-19 16:19:14 +01:00
|
|
|
, SDL2
|
2021-10-04 06:27:33 +02:00
|
|
|
, cmake
|
2021-12-19 16:19:14 +01:00
|
|
|
, curl
|
2021-10-04 06:27:33 +02:00
|
|
|
, extra-cmake-modules
|
|
|
|
, gtk3
|
|
|
|
, libevdev
|
|
|
|
, libpulseaudio
|
|
|
|
, mesa
|
2021-12-19 16:19:14 +01:00
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, qtbase
|
|
|
|
, qttools
|
|
|
|
, sndio
|
2021-10-24 20:17:55 +02:00
|
|
|
, vulkan-loader
|
|
|
|
, wayland
|
2021-12-19 16:19:14 +01:00
|
|
|
, wrapQtAppsHook
|
2021-10-04 06:27:33 +02:00
|
|
|
}:
|
2021-12-19 16:19:14 +01:00
|
|
|
|
2020-12-30 01:35:04 +01:00
|
|
|
mkDerivation rec {
|
|
|
|
pname = "duckstation";
|
2022-02-02 12:19:26 +01:00
|
|
|
version = "0.pre+date=2022-01-18";
|
2020-12-30 01:35:04 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stenzek";
|
|
|
|
repo = pname;
|
2022-02-02 12:19:26 +01:00
|
|
|
rev = "51041e47f70123eda41d999701f5651830a0a95e";
|
|
|
|
sha256 = "sha256-nlF6ctDU8KCK7MN2pniPLLqUbPUygX9rl0hjzVQ+mPo=";
|
2020-12-30 01:35:04 +01:00
|
|
|
};
|
|
|
|
|
2021-12-19 16:19:14 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
extra-cmake-modules
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
qttools
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
2020-12-30 01:35:04 +01:00
|
|
|
|
2021-10-04 06:27:33 +02:00
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
2021-12-19 16:19:14 +01:00
|
|
|
curl
|
2021-10-04 06:27:33 +02:00
|
|
|
gtk3
|
|
|
|
libevdev
|
|
|
|
libpulseaudio
|
2021-12-19 16:19:14 +01:00
|
|
|
mesa
|
|
|
|
qtbase
|
|
|
|
sndio
|
2021-10-24 20:17:55 +02:00
|
|
|
vulkan-loader
|
2021-12-19 16:19:14 +01:00
|
|
|
wayland
|
2021-10-04 06:27:33 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2021-12-19 16:19:14 +01:00
|
|
|
"-DUSE_DRMKMS=ON"
|
2021-10-24 20:17:55 +02:00
|
|
|
"-DUSE_WAYLAND=ON"
|
2021-10-04 06:27:33 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace extras/linux-desktop-files/duckstation-qt.desktop \
|
|
|
|
--replace "duckstation-qt" "duckstation" \
|
|
|
|
--replace "TryExec=duckstation" "tryExec=duckstation-qt" \
|
|
|
|
--replace "Exec=duckstation" "Exec=duckstation-qt"
|
|
|
|
substituteInPlace extras/linux-desktop-files/duckstation-nogui.desktop \
|
|
|
|
--replace "duckstation-nogui" "duckstation" \
|
|
|
|
--replace "TryExec=duckstation" "tryExec=duckstation-nogui" \
|
|
|
|
--replace "Exec=duckstation" "Exec=duckstation-nogui"
|
|
|
|
'';
|
2020-12-30 01:35:04 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-10-04 06:27:33 +02:00
|
|
|
runHook preInstall
|
2021-12-19 16:19:14 +01:00
|
|
|
|
2021-10-04 06:27:33 +02:00
|
|
|
mkdir -p $out/bin $out/share $out/share/pixmaps $out/share/applications
|
|
|
|
rm bin/common-tests
|
|
|
|
|
|
|
|
cp -r bin $out/share/duckstation
|
|
|
|
ln -s $out/share/duckstation/duckstation-{qt,nogui} $out/bin/
|
|
|
|
|
|
|
|
cp ../extras/icons/icon-256px.png $out/share/pixmaps/duckstation.png
|
|
|
|
cp ../extras/linux-desktop-files/* $out/share/applications/
|
2021-12-19 16:19:14 +01:00
|
|
|
|
2021-10-04 06:27:33 +02:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
./bin/common-tests
|
|
|
|
runHook postCheck
|
2020-12-30 01:35:04 +01:00
|
|
|
'';
|
|
|
|
|
2021-10-24 20:17:55 +02:00
|
|
|
qtWrapperArgs = [
|
|
|
|
"--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib"
|
|
|
|
];
|
|
|
|
|
2020-12-30 01:35:04 +01:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/stenzek/duckstation";
|
2021-12-19 16:19:14 +01:00
|
|
|
description = "Fast PlayStation 1 emulator for x86-64/AArch32/AArch64";
|
2021-10-04 06:27:33 +02:00
|
|
|
license = licenses.gpl3Only;
|
2021-12-19 16:19:14 +01:00
|
|
|
maintainers = with maintainers; [ guibou AndersonTorres ];
|
2020-12-30 01:35:04 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|
2021-12-19 16:19:14 +01:00
|
|
|
# TODO: default sound backend (cubeb) does not work, but SDL does. Strangely,
|
|
|
|
# switching to cubeb while a game is running makes it work.
|