nixpkgs/pkgs/by-name/pc/pcsx2/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

141 lines
3.1 KiB
Nix

{
lib,
SDL2,
callPackage,
cmake,
cubeb,
curl,
extra-cmake-modules,
ffmpeg,
libXrandr,
libaio,
libbacktrace,
libpcap,
libwebp,
llvmPackages_17,
lz4,
makeWrapper,
pkg-config,
qt6,
shaderc,
soundtouch,
strip-nondeterminism,
vulkan-headers,
vulkan-loader,
wayland,
zip,
zstd,
}:
let
sources = callPackage ./sources.nix { };
inherit (qt6)
qtbase
qtsvg
qttools
qtwayland
wrapQtAppsHook
;
in
llvmPackages_17.stdenv.mkDerivation (finalAttrs: {
inherit (sources.pcsx2) pname version src;
patches = [
# Remove PCSX2_GIT_REV
./0000-define-rev.patch
];
cmakeFlags = [
(lib.cmakeBool "PACKAGE_MODE" true)
(lib.cmakeBool "DISABLE_ADVANCE_SIMD" true)
(lib.cmakeBool "USE_LINKED_FFMPEG" true)
(lib.cmakeFeature "PCSX2_GIT_REV" finalAttrs.src.rev)
];
nativeBuildInputs = [
cmake
pkg-config
strip-nondeterminism
wrapQtAppsHook
zip
];
buildInputs = [
curl
extra-cmake-modules
ffmpeg
libaio
libbacktrace
libpcap
libwebp
libXrandr
lz4
qtbase
qtsvg
qttools
qtwayland
SDL2
shaderc
soundtouch
vulkan-headers
wayland
zstd
] ++ cubeb.passthru.backendLibs;
strictDeps = true;
postInstall = ''
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/share/PCSX2/resources/patches.zip ${sources.pcsx2_patches.src}/patches/*
strip-nondeterminism $out/share/PCSX2/resources/patches.zip
'';
qtWrapperArgs =
let
libs = lib.makeLibraryPath (
[
vulkan-loader
shaderc
]
++ 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'
'';
meta = {
homepage = "https://pcsx2.net";
description = "Playstation 2 emulator";
longDescription = ''
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.
'';
changelog = "https://github.com/PCSX2/pcsx2/releases/tag/v${finalAttrs.version}";
downloadPage = "https://github.com/PCSX2/pcsx2";
license = with lib.licenses; [
gpl3Plus
lgpl3Plus
];
mainProgram = "pcsx2-qt";
maintainers = with lib.maintainers; [
AndersonTorres
hrdinka
govanify
matteopacini
];
platforms = lib.systems.inspect.patternLogicalAnd lib.systems.inspect.patterns.isLinux lib.systems.inspect.patterns.isx86_64;
};
})