nixpkgs/pkgs/applications/emulators/pcsx2/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

131 lines
2.8 KiB
Nix
Raw Normal View History

2022-05-30 12:36:31 +00:00
{ cmake
, fetchFromGitHub
2022-05-30 12:36:31 +00:00
, lib
, llvmPackages_16
2023-06-08 19:30:19 +00:00
, cubeb
2022-05-30 12:36:31 +00:00
, curl
, extra-cmake-modules
2022-05-30 12:36:31 +00:00
, ffmpeg
, fmt_8
, gettext
, harfbuzz
, libaio
2022-05-30 12:36:31 +00:00
, libbacktrace
, libpcap
, libsamplerate
2022-05-30 12:36:31 +00:00
, libXrandr
, libzip
2021-01-17 02:30:45 +00:00
, pkg-config
2022-05-30 12:36:31 +00:00
, qtbase
, qtsvg
, qttools
, qtwayland
, rapidyaml
, SDL2
, soundtouch
2023-06-10 03:49:31 +00:00
, strip-nondeterminism
, vulkan-headers
, vulkan-loader
2021-12-07 19:46:56 +00:00
, wayland
2022-05-30 12:36:31 +00:00
, wrapQtAppsHook
, xz
, zip
2020-01-08 11:32:45 +00:00
}:
2016-02-26 09:21:31 +00:00
2022-05-30 12:36:31 +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";
rev = "04d727b3bf451da11b6594602036e4f7f5580610";
sha256 = "sha256-zrulsSMRNLPFvrC/jeYzl53i4ZvFQ4Yl2nB0bA6Y8KU=";
2022-05-30 12:36:31 +00:00
};
in
llvmPackages_16.stdenv.mkDerivation rec {
pname = "pcsx2";
version = "1.7.5004";
2016-02-26 09:21:31 +00:00
src = fetchFromGitHub {
owner = "PCSX2";
repo = "pcsx2";
fetchSubmodules = true;
2021-12-07 19:44:45 +00:00
rev = "v${version}";
sha256 = "sha256-o+9VSuoZgTkS75rZ6qYM8ITD+0OcwXp+xh/hdUGpVK4=";
2016-02-26 09:21:31 +00:00
};
2020-01-08 11:32:45 +00:00
cmakeFlags = [
"-DDISABLE_ADVANCE_SIMD=TRUE"
2022-05-30 12:36:31 +00:00
"-DUSE_SYSTEM_LIBS=ON"
"-DUSE_LINKED_FFMPEG=ON"
2022-05-30 12:36:31 +00:00
"-DDISABLE_BUILD_DATE=TRUE"
2020-01-08 11:32:45 +00:00
];
2016-02-26 09:21:31 +00:00
2023-06-10 05:21:40 +00:00
nativeBuildInputs = [
cmake
extra-cmake-modules
2023-06-10 05:21:40 +00:00
pkg-config
2023-06-10 03:49:31 +00:00
strip-nondeterminism
2023-06-10 05:21:40 +00:00
wrapQtAppsHook
zip
];
2016-02-26 09:21:31 +00:00
buildInputs = [
2022-05-30 12:36:31 +00:00
curl
ffmpeg
fmt_8
2020-01-08 11:32:45 +00:00
gettext
harfbuzz
libaio
2022-05-30 12:36:31 +00:00
libbacktrace
2020-01-08 11:32:45 +00:00
libpcap
libsamplerate
2022-05-30 12:36:31 +00:00
libXrandr
libzip
qtbase
qtsvg
qttools
qtwayland
rapidyaml
2020-01-08 11:32:45 +00:00
SDL2
soundtouch
2022-05-30 12:36:31 +00:00
vulkan-headers
vulkan-loader
2021-12-07 19:46:56 +00:00
wayland
2022-05-30 12:36:31 +00:00
xz
2023-06-08 19:30:19 +00:00
]
++ cubeb.passthru.backendLibs;
2016-02-26 09:21:31 +00:00
2022-05-30 12:36:31 +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
2022-05-30 12:36:31 +00:00
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/*
2023-06-10 03:49:31 +00:00
strip-nondeterminism $out/bin/resources/patches.zip
'';
2022-05-30 12:36:31 +00:00
qtWrapperArgs = [
2023-06-08 19:30:19 +00:00
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([
2022-05-30 12:36:31 +00:00
vulkan-loader
2023-06-08 19:30:19 +00:00
] ++ cubeb.passthru.backendLibs)}"
2022-05-30 12:36:31 +00:00
];
meta = with lib; {
2016-02-26 09:21:31 +00:00
description = "Playstation 2 emulator";
2021-12-07 19:44:45 +00:00
longDescription = ''
2016-02-26 09:21:31 +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.
'';
2020-01-08 11:32:45 +00:00
homepage = "https://pcsx2.net";
2022-05-30 12:36:31 +00:00
license = with licenses; [ gpl3 lgpl3 ];
maintainers = with maintainers; [ hrdinka govanify ];
2022-05-30 12:36:31 +00:00
mainProgram = "pcsx2-qt";
platforms = platforms.x86_64;
2016-02-26 09:21:31 +00:00
};
}