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
|
|
|
|
, llvmPackages_16
|
|
|
|
, cubeb
|
|
|
|
, curl
|
2023-10-09 19:29:22 +00:00
|
|
|
, extra-cmake-modules
|
2023-07-15 17:15:38 +00:00
|
|
|
, ffmpeg
|
|
|
|
, fmt_8
|
2020-11-19 00:13:47 +00:00
|
|
|
, gettext
|
|
|
|
, harfbuzz
|
|
|
|
, libaio
|
2023-07-15 17:15:38 +00:00
|
|
|
, libbacktrace
|
2020-11-19 00:13:47 +00:00
|
|
|
, libpcap
|
|
|
|
, libsamplerate
|
2023-07-15 17:15:38 +00:00
|
|
|
, libXrandr
|
|
|
|
, libzip
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2023-07-15 17:15:38 +00:00
|
|
|
, qtbase
|
|
|
|
, qtsvg
|
|
|
|
, qttools
|
|
|
|
, qtwayland
|
|
|
|
, rapidyaml
|
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
|
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";
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "04d727b3bf451da11b6594602036e4f7f5580610";
|
|
|
|
sha256 = "sha256-zrulsSMRNLPFvrC/jeYzl53i4ZvFQ4Yl2nB0bA6Y8KU=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
llvmPackages_16.stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "pcsx2";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.7.5004";
|
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}";
|
2023-10-09 19:29:22 +00:00
|
|
|
sha256 = "sha256-o+9VSuoZgTkS75rZ6qYM8ITD+0OcwXp+xh/hdUGpVK4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DDISABLE_ADVANCE_SIMD=TRUE"
|
2023-07-15 17:15:38 +00:00
|
|
|
"-DUSE_SYSTEM_LIBS=ON"
|
|
|
|
"-DUSE_LINKED_FFMPEG=ON"
|
|
|
|
"-DDISABLE_BUILD_DATE=TRUE"
|
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
|
|
|
|
fmt_8
|
2020-04-24 23:36:52 +00:00
|
|
|
gettext
|
|
|
|
harfbuzz
|
|
|
|
libaio
|
2023-07-15 17:15:38 +00:00
|
|
|
libbacktrace
|
2020-04-24 23:36:52 +00:00
|
|
|
libpcap
|
2020-11-19 00:13:47 +00:00
|
|
|
libsamplerate
|
2023-07-15 17:15:38 +00:00
|
|
|
libXrandr
|
|
|
|
libzip
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qttools
|
|
|
|
qtwayland
|
|
|
|
rapidyaml
|
2020-04-24 23:36:52 +00:00
|
|
|
SDL2
|
|
|
|
soundtouch
|
2023-07-15 17:15:38 +00:00
|
|
|
vulkan-headers
|
2022-05-18 14:49:53 +00:00
|
|
|
vulkan-loader
|
2021-12-19 01:06:50 +00:00
|
|
|
wayland
|
2023-07-15 17:15:38 +00:00
|
|
|
xz
|
|
|
|
]
|
|
|
|
++ 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
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
qtWrapperArgs = [
|
|
|
|
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([
|
|
|
|
vulkan-loader
|
|
|
|
] ++ cubeb.passthru.backendLibs)}"
|
|
|
|
];
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|