2021-10-06 13:57:05 +00:00
|
|
|
{ lib
|
|
|
|
, mkDerivation
|
|
|
|
, fetchFromGitHub
|
2021-12-21 02:18:32 +00:00
|
|
|
, SDL2
|
2021-10-06 13:57:05 +00:00
|
|
|
, cmake
|
2021-12-21 02:18:32 +00:00
|
|
|
, curl
|
2021-10-06 13:57:05 +00:00
|
|
|
, extra-cmake-modules
|
|
|
|
, gtk3
|
|
|
|
, libevdev
|
|
|
|
, libpulseaudio
|
|
|
|
, mesa
|
2021-12-21 02:18:32 +00:00
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, qtbase
|
|
|
|
, qttools
|
|
|
|
, sndio
|
2021-10-28 06:52:43 +00:00
|
|
|
, vulkan-loader
|
|
|
|
, wayland
|
2021-12-21 02:18:32 +00:00
|
|
|
, wrapQtAppsHook
|
2021-10-06 13:57:05 +00:00
|
|
|
}:
|
2021-12-21 02:18:32 +00:00
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
mkDerivation rec {
|
|
|
|
pname = "duckstation";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "0.pre+date=2022-01-18";
|
2021-01-05 17:05:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stenzek";
|
|
|
|
repo = pname;
|
2022-02-10 20:34:41 +00:00
|
|
|
rev = "51041e47f70123eda41d999701f5651830a0a95e";
|
|
|
|
sha256 = "sha256-nlF6ctDU8KCK7MN2pniPLLqUbPUygX9rl0hjzVQ+mPo=";
|
2021-01-05 17:05:55 +00:00
|
|
|
};
|
|
|
|
|
2021-12-21 02:18:32 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
extra-cmake-modules
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
qttools
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
2021-01-05 17:05:55 +00:00
|
|
|
|
2021-10-06 13:57:05 +00:00
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
2021-12-21 02:18:32 +00:00
|
|
|
curl
|
2021-10-06 13:57:05 +00:00
|
|
|
gtk3
|
|
|
|
libevdev
|
|
|
|
libpulseaudio
|
2021-12-21 02:18:32 +00:00
|
|
|
mesa
|
|
|
|
qtbase
|
|
|
|
sndio
|
2021-10-28 06:52:43 +00:00
|
|
|
vulkan-loader
|
2021-12-21 02:18:32 +00:00
|
|
|
wayland
|
2021-10-06 13:57:05 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2021-12-21 02:18:32 +00:00
|
|
|
"-DUSE_DRMKMS=ON"
|
2021-10-28 06:52:43 +00:00
|
|
|
"-DUSE_WAYLAND=ON"
|
2021-10-06 13:57:05 +00: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"
|
|
|
|
'';
|
2021-01-05 17:05:55 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-10-06 13:57:05 +00:00
|
|
|
runHook preInstall
|
2021-12-21 02:18:32 +00:00
|
|
|
|
2021-10-06 13:57:05 +00: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-21 02:18:32 +00:00
|
|
|
|
2021-10-06 13:57:05 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
./bin/common-tests
|
|
|
|
runHook postCheck
|
2021-01-05 17:05:55 +00:00
|
|
|
'';
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
# Libpulseaudio fixes https://github.com/NixOS/nixpkgs/issues/171173
|
2021-10-28 06:52:43 +00:00
|
|
|
qtWrapperArgs = [
|
2022-05-18 14:49:53 +00:00
|
|
|
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libpulseaudio vulkan-loader ]}"
|
2021-10-28 06:52:43 +00:00
|
|
|
];
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/stenzek/duckstation";
|
2021-12-21 02:18:32 +00:00
|
|
|
description = "Fast PlayStation 1 emulator for x86-64/AArch32/AArch64";
|
2021-10-06 13:57:05 +00:00
|
|
|
license = licenses.gpl3Only;
|
2021-12-21 02:18:32 +00:00
|
|
|
maintainers = with maintainers; [ guibou AndersonTorres ];
|
2021-01-05 17:05:55 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|