about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/rp/rpcs3/package.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-12-01 19:00:09 +0100
committerAlyssa Ross <hi@alyssa.is>2023-12-01 19:00:09 +0100
commit9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d (patch)
tree4368f9e4cb2d5b93a956c085337e45cb70f1e331 /nixpkgs/pkgs/by-name/rp/rpcs3/package.nix
parenta9cbfb6941b47d6f50129e6e36927882392daed7 (diff)
parent2344fe1da14cb08b0c18743b207995f9b8597915 (diff)
downloadnixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.gz
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.bz2
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.lz
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.xz
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.zst
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.zip
Merge https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/by-name/rp/rpcs3/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/rp/rpcs3/package.nix105
1 files changed, 105 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/rp/rpcs3/package.nix b/nixpkgs/pkgs/by-name/rp/rpcs3/package.nix
new file mode 100644
index 000000000000..ef87774636b2
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/rp/rpcs3/package.nix
@@ -0,0 +1,105 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, git
+, qt6Packages
+, 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 = "15726-ebf48800e";
+  rpcs3Version = "0.0.29-15726-ebf48800e";
+  rpcs3Revision = "ebf48800e6bf2569fa0a59974ab2daaeb3a92f23";
+  rpcs3Hash = "sha256-HJQ+DCZy8lwMCfq0N9StKD8bP1hCBxGMAucbQ9esy/I=";
+
+  inherit (qt6Packages) qtbase qtmultimedia wrapQtAppsHook;
+in
+stdenv.mkDerivation {
+  pname = "rpcs3";
+  version = rpcs3Version;
+
+  src = fetchFromGitHub {
+    owner = "RPCS3";
+    repo = "rpcs3";
+    rev = rpcs3Revision;
+    fetchSubmodules = true;
+    hash = rpcs3Hash;
+  };
+
+  passthru.updateScript = ./update.sh;
+
+  preConfigure = ''
+    cat > ./rpcs3/git-version.h <<EOF
+    #define RPCS3_GIT_VERSION "${rpcs3GitVersion}"
+    #define RPCS3_GIT_FULL_BRANCH "RPCS3/rpcs3/master"
+    #define RPCS3_GIT_BRANCH "HEAD"
+    #define RPCS3_GIT_VERSION_NO_UPDATE 1
+    EOF
+  '';
+
+  cmakeFlags = [
+    "-DUSE_SYSTEM_ZLIB=ON"
+    "-DUSE_SYSTEM_LIBUSB=ON"
+    "-DUSE_SYSTEM_LIBPNG=ON"
+    "-DUSE_SYSTEM_FFMPEG=ON"
+    "-DUSE_SYSTEM_CURL=ON"
+    "-DUSE_SYSTEM_WOLFSSL=ON"
+    "-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"
+    "-DUSE_FAUDIO=${if faudioSupport then "ON" else "OFF"}"
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config git wrapQtAppsHook ];
+
+  buildInputs = [
+    qtbase qtmultimedia openal glew vulkan-headers vulkan-loader libpng ffmpeg
+    libevdev zlib libusb1 curl wolfssl python3 pugixml flatbuffers llvm_16 libSM
+  ] ++ cubeb.passthru.backendLibs
+    ++ lib.optionals faudioSupport [ faudio SDL2 ]
+    ++ lib.optional waylandSupport wayland;
+
+  postInstall = ''
+    # Taken from https://wiki.rpcs3.net/index.php?title=Help:Controller_Configuration
+    install -D ${./99-ds3-controllers.rules} $out/etc/udev/rules.d/99-ds3-controllers.rules
+    install -D ${./99-ds4-controllers.rules} $out/etc/udev/rules.d/99-ds4-controllers.rules
+    install -D ${./99-dualsense-controllers.rules} $out/etc/udev/rules.d/99-dualsense-controllers.rules
+  '';
+
+  meta = with lib; {
+    description = "PS3 emulator/debugger";
+    homepage = "https://rpcs3.net/";
+    maintainers = with maintainers; [ abbradar neonfuz ilian zane ];
+    license = licenses.gpl2Only;
+    platforms = [ "x86_64-linux" "aarch64-linux" ];
+    mainProgram = "rpcs3";
+  };
+}