Unverified Commit 6cdec389 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #324113 from matteo-pacini/pcsx2

parents e3e90f7b 7da8f10d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4,14 +4,14 @@
  pname,
  version,
  meta,
  makeWrapper
  makeWrapper,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
  inherit pname version meta;

  src = fetchurl {
    url = "https://github.com/PCSX2/pcsx2/releases/download/v${version}/pcsx2-v${version}-macos-Qt.tar.xz";
    hash = "sha256-QdYV63lrAwYSDhUOy4nB8qL5LfZkrg/EYHtY2smtZuk=";
    hash = "sha256-NYgHsYXoIhI2pxqqiMgz5sKBAezEFf4AfEfu5S3diMg=";
  };

  nativeBuildInputs = [ makeWrapper ];
+12 −18
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@
  cubeb,
  curl,
  extra-cmake-modules,
  fetchpatch,
  ffmpeg,
  libaio,
  libbacktrace,
@@ -38,8 +37,8 @@ let
  pcsx2_patches = fetchFromGitHub {
    owner = "PCSX2";
    repo = "pcsx2_patches";
    rev = "b3a788e16ea12efac006cbbe1ece45b6b9b34326";
    sha256 = "sha256-Uvpz2Gpj533Sr6wLruubZxssoXefQDey8GHIDKWhW3s=";
    rev = "9e71956797332471010e563a4b75a5934bef9d4e";
    hash = "sha256-jpaRpvJox78zRGyrVIGYVoSEo/ICBlBfw3dTMz9QGuU=";
  };
  inherit (qt6)
    qtbase
@@ -55,23 +54,12 @@ llvmPackages_17.stdenv.mkDerivation (finalAttrs: {
  src = fetchFromGitHub {
    owner = "PCSX2";
    repo = "pcsx2";
    fetchSubmodules = true;
    rev = "v${finalAttrs.version}";
    sha256 = "sha256-WiwnP5yoBy8bRLUPuCZ7z4nhIzrY8P29KS5ZjErM/A4=";
    # NOTE: Don't forget to change the hash in shaderc-patched.nix as well.
    hash = "sha256-cDugEbbz40uLPW64bcDGxfo1Y3ahYnEVaalfMp/J95s=";
  };

  patches = [
    ./define-rev.patch
    # Backport patches to fix random crashes on startup
    (fetchpatch {
      url = "https://github.com/PCSX2/pcsx2/commit/e47bcf8d80df9a93201eefbaf169ec1a0673a833.patch";
      sha256 = "sha256-7CL1Kpu+/JgtKIenn9rQKAs3A+oJ40W5XHlqSg77Q7Y=";
    })
    (fetchpatch {
      url = "https://github.com/PCSX2/pcsx2/commit/92b707db994f821bccc35d6eef67727ea3ab496b.patch";
      sha256 = "sha256-HWJ8KZAY/qBBotAJerZg6zi5QUHuTD51zKH1rAtZ3tc=";
    })
  ];
  patches = [ ./define-rev.patch ];

  cmakeFlags = [
    (lib.cmakeBool "DISABLE_ADVANCE_SIMD" true)
@@ -122,7 +110,13 @@ llvmPackages_17.stdenv.mkDerivation (finalAttrs: {

  qtWrapperArgs =
    let
      libs = lib.makeLibraryPath ([ vulkan-loader ] ++ cubeb.passthru.backendLibs);
      libs = lib.makeLibraryPath (
        [
          vulkan-loader
          shaderc-patched
        ]
        ++ cubeb.passthru.backendLibs
      );
    in
    [ "--prefix LD_LIBRARY_PATH : ${libs}" ];

+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
}:
let
  pname = "pcsx2";
  version = "1.7.5779";
  version = "1.7.5919";
  meta = with lib; {
    description = "Playstation 2 emulator";
    longDescription = ''
+18 −3
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  fetchpatch,
  pcsx2,
  shaderc,
}:

let
  version = "2024.1";
in
shaderc.overrideAttrs (old: {
  inherit version;
  pname = "shaderc-patched-for-pcsx2";
  src = fetchFromGitHub {
    owner = "google";
    repo = "shaderc";
    rev = "v${version}";
    hash = "sha256-2L/8n6KLVZWXt6FrYraVlZV5YqbPHD7rzXPCkD0d4kg=";
  };
  patches = (old.patches or [ ]) ++ [
    (fetchpatch {
      url = "file://${pcsx2.src}/.github/workflows/scripts/common/shaderc-changes.patch";
      hash = "sha256-Ps/D+CdSbjVWg3ZGOEcgbpQbCNkI5Nuizm4E5qiM9Wo=";
      hash = "sha256-/qX2yD0RBuPh4Cf7n6OjVA2IyurpaCgvCEsIX/hXFdQ=";
      excludes = [
        "CHANGES"
        "CMakeLists.txt"
        "libshaderc/CMakeLists.txt"
        "third_party/CMakeLists.txt"
      ];
    })
  ];
  cmakeFlags = (old.cmakeFlags or [ ]) ++ [
    (lib.cmakeBool "SHADERC_SKIP_EXAMPLES" true)
    (lib.cmakeBool "SHADERC_SKIP_TESTS" true)
  ];
})