2021-10-06 13:57:05 +00:00
|
|
|
{ lib
|
2022-10-21 18:38:19 +00:00
|
|
|
, stdenv
|
2021-10-06 13:57:05 +00:00
|
|
|
, fetchFromGitHub
|
2021-12-21 02:18:32 +00:00
|
|
|
, SDL2
|
2021-10-06 13:57:05 +00:00
|
|
|
, cmake
|
2022-10-21 18:38:19 +00:00
|
|
|
, copyDesktopItems
|
|
|
|
, makeDesktopItem
|
2021-12-21 02:18:32 +00:00
|
|
|
, curl
|
2021-10-06 13:57:05 +00:00
|
|
|
, extra-cmake-modules
|
|
|
|
, libevdev
|
|
|
|
, libpulseaudio
|
2022-10-21 18:38:19 +00:00
|
|
|
, libXrandr
|
|
|
|
, mesa # for libgbm
|
2021-12-21 02:18:32 +00:00
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, qtbase
|
|
|
|
, qttools
|
2021-10-28 06:52:43 +00:00
|
|
|
, vulkan-loader
|
2022-10-21 18:38:19 +00:00
|
|
|
#, wayland # Wayland doesn't work correctly this version
|
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
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-01-05 17:05:55 +00:00
|
|
|
pname = "duckstation";
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "unstable-2022-07-08";
|
2021-01-05 17:05:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stenzek";
|
|
|
|
repo = pname;
|
2022-10-21 18:38:19 +00:00
|
|
|
rev = "82965f741e81e4d2f7e1b2abdc011e1f266bfe7f";
|
|
|
|
sha256 = "sha256-D8Ps/EQRcHLsps/KEUs56koeioOdE/GPA0QJSrbSdYs=";
|
2021-01-05 17:05:55 +00:00
|
|
|
};
|
|
|
|
|
2021-12-21 02:18:32 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
extra-cmake-modules
|
2022-10-21 18:38:19 +00:00
|
|
|
copyDesktopItems
|
2021-12-21 02:18:32 +00:00
|
|
|
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
|
|
|
libevdev
|
|
|
|
libpulseaudio
|
2022-10-21 18:38:19 +00:00
|
|
|
libXrandr
|
2021-12-21 02:18:32 +00:00
|
|
|
mesa
|
|
|
|
qtbase
|
2021-10-28 06:52:43 +00:00
|
|
|
vulkan-loader
|
2022-10-21 18:38:19 +00:00
|
|
|
#wayland
|
2021-10-06 13:57:05 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2021-12-21 02:18:32 +00:00
|
|
|
"-DUSE_DRMKMS=ON"
|
2022-10-21 18:38:19 +00:00
|
|
|
#"-DUSE_WAYLAND=ON"
|
2021-10-06 13:57:05 +00:00
|
|
|
];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "duckstation-qt";
|
|
|
|
desktopName = "DuckStation";
|
|
|
|
genericName = "PlayStation 1 Emulator";
|
|
|
|
icon = "duckstation";
|
|
|
|
tryExec = "duckstation-qt";
|
|
|
|
exec = "duckstation-qt %f";
|
|
|
|
comment = "Fast PlayStation 1 emulator";
|
|
|
|
categories = [ "Game" "Emulator" "Qt" ];
|
|
|
|
type = "Application";
|
|
|
|
})
|
|
|
|
];
|
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
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
mkdir -p $out/bin $out/share
|
2021-10-06 13:57:05 +00:00
|
|
|
|
|
|
|
cp -r bin $out/share/duckstation
|
2022-10-21 18:38:19 +00:00
|
|
|
ln -s $out/share/duckstation/duckstation-qt $out/bin/
|
2021-10-06 13:57:05 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
install -Dm644 ../extras/icons/icon-256px.png $out/share/pixmaps/duckstation.png
|
2021-12-21 02:18:32 +00:00
|
|
|
|
2021-10-06 13:57:05 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
2022-10-21 18:38:19 +00:00
|
|
|
bin/common-tests
|
2021-10-06 13:57:05 +00:00
|
|
|
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-10-21 18:38:19 +00:00
|
|
|
"--set QT_QPA_PLATFORM xcb"
|
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;
|
|
|
|
};
|
|
|
|
}
|