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