2023-07-15 17:15:38 +00:00
|
|
|
{ cmake
|
2020-11-19 00:13:47 +00:00
|
|
|
, fetchFromGitHub
|
2023-07-15 17:15:38 +00:00
|
|
|
, lib
|
2024-01-02 11:29:13 +00:00
|
|
|
, llvmPackages_17
|
2023-07-15 17:15:38 +00:00
|
|
|
, cubeb
|
|
|
|
, curl
|
2023-10-09 19:29:22 +00:00
|
|
|
, extra-cmake-modules
|
2023-07-15 17:15:38 +00:00
|
|
|
, ffmpeg
|
2020-11-19 00:13:47 +00:00
|
|
|
, libaio
|
2023-07-15 17:15:38 +00:00
|
|
|
, libbacktrace
|
2020-11-19 00:13:47 +00:00
|
|
|
, libpcap
|
2024-01-25 14:12:00 +00:00
|
|
|
, libwebp
|
2023-07-15 17:15:38 +00:00
|
|
|
, libXrandr
|
|
|
|
, libzip
|
2024-01-25 14:12:00 +00:00
|
|
|
, lz4
|
2024-01-02 11:29:13 +00:00
|
|
|
, makeWrapper
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2023-07-15 17:15:38 +00:00
|
|
|
, qtbase
|
|
|
|
, qtsvg
|
|
|
|
, qttools
|
|
|
|
, qtwayland
|
2020-11-19 00:13:47 +00:00
|
|
|
, SDL2
|
|
|
|
, soundtouch
|
2023-07-15 17:15:38 +00:00
|
|
|
, strip-nondeterminism
|
2022-05-18 14:49:53 +00:00
|
|
|
, vulkan-headers
|
|
|
|
, vulkan-loader
|
2021-12-19 01:06:50 +00:00
|
|
|
, wayland
|
2023-07-15 17:15:38 +00:00
|
|
|
, wrapQtAppsHook
|
|
|
|
, xz
|
|
|
|
, zip
|
2024-01-25 14:12:00 +00:00
|
|
|
, zstd
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
let
|
|
|
|
# The pre-zipped files in releases don't have a versioned link, we need to zip them ourselves
|
|
|
|
pcsx2_patches = fetchFromGitHub {
|
|
|
|
owner = "PCSX2";
|
|
|
|
repo = "pcsx2_patches";
|
2024-04-21 15:54:59 +00:00
|
|
|
rev = "e3b354f144de71d2b87471166cca8911867c1dfd";
|
|
|
|
sha256 = "sha256-H7cFyBYZumcCZ0/FFOFZoChoi0XPs4siA4dHcFt9U7k=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
in
|
2024-01-02 11:29:13 +00:00
|
|
|
llvmPackages_17.stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "pcsx2";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.7.5587";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PCSX2";
|
|
|
|
repo = "pcsx2";
|
2020-11-19 00:13:47 +00:00
|
|
|
fetchSubmodules = true;
|
2021-12-19 01:06:50 +00:00
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-PCZ1r6x28Z5FEVMXWm4oxpTknz/XEiwo0rRGhn4B33g=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
patches = [
|
|
|
|
./define-rev.patch
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
cmakeFlags = [
|
2024-01-02 11:29:13 +00:00
|
|
|
"-DDISABLE_ADVANCE_SIMD=ON"
|
2023-07-15 17:15:38 +00:00
|
|
|
"-DUSE_LINKED_FFMPEG=ON"
|
2024-01-25 14:12:00 +00:00
|
|
|
"-DPCSX2_GIT_REV=v${version}"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2023-10-09 19:29:22 +00:00
|
|
|
extra-cmake-modules
|
2023-07-15 17:15:38 +00:00
|
|
|
pkg-config
|
|
|
|
strip-nondeterminism
|
|
|
|
wrapQtAppsHook
|
|
|
|
zip
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2023-07-15 17:15:38 +00:00
|
|
|
curl
|
|
|
|
ffmpeg
|
2020-04-24 23:36:52 +00:00
|
|
|
libaio
|
2023-07-15 17:15:38 +00:00
|
|
|
libbacktrace
|
2020-04-24 23:36:52 +00:00
|
|
|
libpcap
|
2024-01-25 14:12:00 +00:00
|
|
|
libwebp
|
2023-07-15 17:15:38 +00:00
|
|
|
libXrandr
|
|
|
|
libzip
|
2024-01-25 14:12:00 +00:00
|
|
|
lz4
|
2023-07-15 17:15:38 +00:00
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qttools
|
|
|
|
qtwayland
|
2020-04-24 23:36:52 +00:00
|
|
|
SDL2
|
|
|
|
soundtouch
|
2023-07-15 17:15:38 +00:00
|
|
|
vulkan-headers
|
2021-12-19 01:06:50 +00:00
|
|
|
wayland
|
2023-07-15 17:15:38 +00:00
|
|
|
xz
|
2024-01-25 14:12:00 +00:00
|
|
|
zstd
|
2023-07-15 17:15:38 +00:00
|
|
|
]
|
|
|
|
++ cubeb.passthru.backendLibs;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -a bin/pcsx2-qt bin/resources $out/bin/
|
|
|
|
|
|
|
|
install -Dm644 $src/pcsx2-qt/resources/icons/AppIcon64.png $out/share/pixmaps/PCSX2.png
|
|
|
|
install -Dm644 $src/.github/workflows/scripts/linux/pcsx2-qt.desktop $out/share/applications/PCSX2.desktop
|
|
|
|
|
|
|
|
zip -jq $out/bin/resources/patches.zip ${pcsx2_patches}/patches/*
|
|
|
|
strip-nondeterminism $out/bin/resources/patches.zip
|
2022-05-18 14:49:53 +00:00
|
|
|
'';
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
qtWrapperArgs =
|
|
|
|
let
|
|
|
|
libs = lib.makeLibraryPath ([
|
|
|
|
vulkan-loader
|
|
|
|
] ++ cubeb.passthru.backendLibs);
|
|
|
|
in [
|
|
|
|
"--prefix LD_LIBRARY_PATH : ${libs}"
|
|
|
|
];
|
|
|
|
|
|
|
|
# https://github.com/PCSX2/pcsx2/pull/10200
|
|
|
|
# Can't avoid the double wrapping, the binary wrapper from qtWrapperArgs doesn't support --run
|
|
|
|
postFixup = ''
|
|
|
|
source "${makeWrapper}/nix-support/setup-hook"
|
|
|
|
wrapProgram $out/bin/pcsx2-qt \
|
|
|
|
--run 'if [[ -z $I_WANT_A_BROKEN_WAYLAND_UI ]]; then export QT_QPA_PLATFORM=xcb; fi'
|
|
|
|
'';
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Playstation 2 emulator";
|
2021-12-19 01:06:50 +00:00
|
|
|
longDescription = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
PCSX2 is an open-source PlayStation 2 (AKA PS2) emulator. Its purpose
|
|
|
|
is to emulate the PS2 hardware, using a combination of MIPS CPU
|
|
|
|
Interpreters, Recompilers and a Virtual Machine which manages hardware
|
|
|
|
states and PS2 system memory. This allows you to play PS2 games on your
|
|
|
|
PC, with many additional features and benefits.
|
|
|
|
'';
|
|
|
|
homepage = "https://pcsx2.net";
|
2023-07-15 17:15:38 +00:00
|
|
|
license = with licenses; [ gpl3 lgpl3 ];
|
2021-04-05 15:23:46 +00:00
|
|
|
maintainers = with maintainers; [ hrdinka govanify ];
|
2023-07-15 17:15:38 +00:00
|
|
|
mainProgram = "pcsx2-qt";
|
2022-05-18 14:49:53 +00:00
|
|
|
platforms = platforms.x86_64;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|