Skip to content

Commit

Permalink
rpcs3: 0.0.27-14840-842edbcbe -> 0.0.28-15372-38a5313ed
Browse files Browse the repository at this point in the history
* Cubeb support is unconditional now, remove the check.
* SDL is only required for FAudio, so rename the check to faudioSupport.
* Use system LLVM now that upstream supports it 🎉
  • Loading branch information
vs49688 authored and AndersonTorres committed Jul 29, 2023
1 parent 52858df commit e6ab469
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 90 deletions.

This file was deleted.

68 changes: 44 additions & 24 deletions pkgs/applications/emulators/rpcs3/default.nix
Original file line number Diff line number Diff line change
@@ -1,24 +1,43 @@
{ lib, stdenv, fetchFromGitHub, wrapQtAppsHook, cmake, pkg-config, git
, qtbase, qtquickcontrols, qtmultimedia, openal, glew, vulkan-headers, vulkan-loader, libpng
, ffmpeg, libevdev, libusb1, zlib, curl, wolfssl, python3, pugixml, faudio, flatbuffers
, sdl2Support ? true, SDL2
, cubebSupport ? true, cubeb
, waylandSupport ? true, wayland
{ lib
, stdenv
, fetchFromGitHub
, wrapQtAppsHook
, cmake
, pkg-config
, git
, qtbase
, qtquickcontrols
, qtmultimedia
, openal
, glew
, vulkan-headers
, vulkan-loader
, libpng
, libSM
, ffmpeg
, libevdev
, libusb1
, zlib
, curl
, wolfssl
, python3
, pugixml
, flatbuffers
, llvm_16
, cubeb
, faudioSupport ? true
, faudio
, SDL2
, waylandSupport ? true
, wayland
}:

let
# Keep these separate so the update script can regex them
rpcs3GitVersion = "14840-842edbcbe";
rpcs3Version = "0.0.27-14840-842edbcbe";
rpcs3Revision = "842edbcbe795941981993c667c2d8a866126b5b0";
rpcs3Sha256 = "1al4dx93f02k56k62dxjqqb46cwg0nkpjax1xnjc8v3bx4gsp6f6";

ittapi = fetchFromGitHub {
owner = "intel";
repo = "ittapi";
rev = "v3.18.12";
sha256 = "0c3g30rj1y8fbd2q4kwlpg1jdy02z4w5ryhj3yr9051pdnf4kndz";
};
rpcs3GitVersion = "15372-38a5313ed";
rpcs3Version = "0.0.28-15372-38a5313ed";
rpcs3Revision = "38a5313ed2c4ebb626017a4f7f28ed0c0a89f931";
rpcs3Hash = "sha256-tiByoxPf++TK/Xowo2VQ+OEojoYIpX/B8caDyaMZ3Qc=";
in
stdenv.mkDerivation {
pname = "rpcs3";
Expand All @@ -29,11 +48,9 @@ stdenv.mkDerivation {
repo = "rpcs3";
rev = rpcs3Revision;
fetchSubmodules = true;
sha256 = rpcs3Sha256;
hash = rpcs3Hash;
};

patches = [ ./0001-llvm-ExecutionEngine-IntelJITEvents-only-use-ITTAPI_.patch ];

passthru.updateScript = ./update.sh;

preConfigure = ''
Expand All @@ -55,17 +72,20 @@ stdenv.mkDerivation {
"-DUSE_SYSTEM_FAUDIO=ON"
"-DUSE_SYSTEM_PUGIXML=ON"
"-DUSE_SYSTEM_FLATBUFFERS=ON"
"-DUSE_SYSTEM_SDL=ON"
"-DWITH_LLVM=ON"
"-DBUILD_LLVM=OFF"
"-DUSE_NATIVE_INSTRUCTIONS=OFF"
"-DITTAPI_SOURCE_DIR=${ittapi}"
"-DUSE_FAUDIO=${if faudioSupport then "ON" else "OFF"}"
];

nativeBuildInputs = [ cmake pkg-config git wrapQtAppsHook ];

buildInputs = [
qtbase qtquickcontrols qtmultimedia openal glew vulkan-headers vulkan-loader libpng ffmpeg
libevdev zlib libusb1 curl wolfssl python3 pugixml faudio flatbuffers
] ++ lib.optional sdl2Support SDL2
++ lib.optionals cubebSupport cubeb.passthru.backendLibs
libevdev zlib libusb1 curl wolfssl python3 pugixml flatbuffers llvm_16 libSM
] ++ cubeb.passthru.backendLibs
++ lib.optionals faudioSupport [ faudio SDL2 ]
++ lib.optional waylandSupport wayland;

postInstall = ''
Expand Down
9 changes: 5 additions & 4 deletions pkgs/applications/emulators/rpcs3/update.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash --pure --keep GITHUB_TOKEN -p gnused jq nix-prefetch-git curl cacert
#!nix-shell -i bash --pure --keep GITHUB_TOKEN -p nix gnused jq nix-prefetch-git curl cacert

set -eou pipefail

Expand Down Expand Up @@ -48,12 +48,13 @@ final_ver="$major_ver-$git_ver"
echo "INFO: Latest commit is $commit_sha"
echo "INFO: Latest version is $final_ver"

nix_sha256=$(nix-prefetch-git --quiet --fetch-submodules https://github.com/RPCS3/rpcs3.git "$commit_sha" | jq -r .sha256)
echo "INFO: SHA256 is $nix_sha256"
nix_hash=$(nix-prefetch-git --quiet --fetch-submodules https://github.com/RPCS3/rpcs3.git "$commit_sha" | jq -r .sha256)
nix_hash=$(nix hash to-sri --type sha256 "$nix_hash")
echo "INFO: Hash is $nix_hash"

sed -i -E \
-e "s/rpcs3GitVersion\s*=\s*\"[\.a-z0-9-]+\";$/rpcs3GitVersion = \"${git_ver}\";/g" \
-e "s/rpcs3Version\s*=\s*\"[\.a-z0-9-]+\";$/rpcs3Version = \"${final_ver}\";/g" \
-e "s/rpcs3Revision\s*=\s*\"[a-z0-9]+\";$/rpcs3Revision = \"${commit_sha}\";/g" \
-e "s/rpcs3Sha256\s*=\s*\"[a-z0-9]+\";$/rpcs3Sha256 = \"${nix_sha256}\";/g" \
-e "s|rpcs3Hash\s*=\s*\"sha256-.*\";$|rpcs3Hash = \"${nix_hash}\";|g" \
"$ROOT/default.nix"

0 comments on commit e6ab469

Please sign in to comment.