2023-07-22 05:08:02 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, git
|
2023-11-22 16:30:37 +00:00
|
|
|
, qt6Packages
|
2023-07-22 05:08:02 +00:00
|
|
|
, openal
|
|
|
|
, glew
|
|
|
|
, vulkan-headers
|
|
|
|
, vulkan-loader
|
|
|
|
, libpng
|
|
|
|
, libSM
|
|
|
|
, ffmpeg
|
|
|
|
, libevdev
|
|
|
|
, libusb1
|
|
|
|
, zlib
|
|
|
|
, curl
|
|
|
|
, wolfssl
|
|
|
|
, python3
|
|
|
|
, pugixml
|
|
|
|
, flatbuffers
|
|
|
|
, llvm_16
|
|
|
|
, cubeb
|
2024-03-01 14:59:37 +00:00
|
|
|
, enableDiscordRpc ? false
|
2023-07-22 05:08:02 +00:00
|
|
|
, faudioSupport ? true
|
|
|
|
, faudio
|
|
|
|
, SDL2
|
|
|
|
, waylandSupport ? true
|
|
|
|
, wayland
|
2019-06-03 16:17:03 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2022-01-24 15:36:23 +00:00
|
|
|
# Keep these separate so the update script can regex them
|
2024-04-30 21:47:53 +00:00
|
|
|
rpcs3GitVersion = "16391-39e946630";
|
|
|
|
rpcs3Version = "0.0.31-16391-39e946630";
|
|
|
|
rpcs3Revision = "39e946630da8e23c4d2d2b763f63145eb9205e43";
|
|
|
|
rpcs3Hash = "sha256-CIPUmcpBc6iRMzZJZ5vKty/Uh4TYiR65xXD4aKRPSKc=";
|
2023-11-22 16:30:37 +00:00
|
|
|
|
2024-02-21 00:21:51 +00:00
|
|
|
inherit (qt6Packages) qtbase qtmultimedia wrapQtAppsHook qtwayland;
|
2019-06-03 16:17:03 +00:00
|
|
|
in
|
2023-05-09 10:27:05 +00:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "rpcs3";
|
2022-01-24 15:36:23 +00:00
|
|
|
version = rpcs3Version;
|
2019-06-03 16:17:03 +00:00
|
|
|
|
2021-05-11 02:39:53 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RPCS3";
|
|
|
|
repo = "rpcs3";
|
2022-01-24 15:36:23 +00:00
|
|
|
rev = rpcs3Revision;
|
2021-05-11 02:39:53 +00:00
|
|
|
fetchSubmodules = true;
|
2023-07-22 05:08:02 +00:00
|
|
|
hash = rpcs3Hash;
|
2019-06-03 16:17:03 +00:00
|
|
|
};
|
|
|
|
|
2021-11-02 09:42:13 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2019-06-03 16:17:03 +00:00
|
|
|
preConfigure = ''
|
|
|
|
cat > ./rpcs3/git-version.h <<EOF
|
2022-01-24 15:36:23 +00:00
|
|
|
#define RPCS3_GIT_VERSION "${rpcs3GitVersion}"
|
2020-12-13 01:16:41 +00:00
|
|
|
#define RPCS3_GIT_FULL_BRANCH "RPCS3/rpcs3/master"
|
2019-06-03 16:17:03 +00:00
|
|
|
#define RPCS3_GIT_BRANCH "HEAD"
|
|
|
|
#define RPCS3_GIT_VERSION_NO_UPDATE 1
|
2018-06-25 09:45:51 +00:00
|
|
|
EOF
|
|
|
|
'';
|
2018-02-23 17:38:29 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
2024-03-01 14:58:51 +00:00
|
|
|
(lib.cmakeBool "USE_SYSTEM_ZLIB" true)
|
|
|
|
(lib.cmakeBool "USE_SYSTEM_LIBUSB" true)
|
|
|
|
(lib.cmakeBool "USE_SYSTEM_LIBPNG" true)
|
|
|
|
(lib.cmakeBool "USE_SYSTEM_FFMPEG" true)
|
|
|
|
(lib.cmakeBool "USE_SYSTEM_CURL" true)
|
|
|
|
(lib.cmakeBool "USE_SYSTEM_WOLFSSL" true)
|
|
|
|
(lib.cmakeBool "USE_SYSTEM_FAUDIO" true)
|
|
|
|
(lib.cmakeBool "USE_SYSTEM_PUGIXML" true)
|
|
|
|
(lib.cmakeBool "USE_SYSTEM_FLATBUFFERS" true)
|
|
|
|
(lib.cmakeBool "USE_SYSTEM_SDL" true)
|
2024-03-01 14:59:37 +00:00
|
|
|
(lib.cmakeBool "USE_SDL" true)
|
2024-03-01 14:58:51 +00:00
|
|
|
(lib.cmakeBool "WITH_LLVM" true)
|
|
|
|
(lib.cmakeBool "BUILD_LLVM" false)
|
|
|
|
(lib.cmakeBool "USE_NATIVE_INSTRUCTIONS" false)
|
2024-03-01 14:59:37 +00:00
|
|
|
(lib.cmakeBool "USE_DISCORD_RPC" enableDiscordRpc)
|
2024-03-01 14:58:51 +00:00
|
|
|
(lib.cmakeBool "USE_FAUDIO" faudioSupport)
|
2018-02-23 17:38:29 +00:00
|
|
|
];
|
|
|
|
|
2021-11-02 09:42:13 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config git wrapQtAppsHook ];
|
2018-02-23 17:38:29 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2023-11-22 16:30:37 +00:00
|
|
|
qtbase qtmultimedia openal glew vulkan-headers vulkan-loader libpng ffmpeg
|
2024-03-01 14:59:37 +00:00
|
|
|
libevdev zlib libusb1 curl wolfssl python3 pugixml SDL2 flatbuffers llvm_16 libSM
|
2023-07-22 05:08:02 +00:00
|
|
|
] ++ cubeb.passthru.backendLibs
|
2024-03-01 14:59:37 +00:00
|
|
|
++ lib.optional faudioSupport faudio
|
2024-02-21 00:21:51 +00:00
|
|
|
++ lib.optionals waylandSupport [ wayland qtwayland ];
|
2018-02-23 17:38:29 +00:00
|
|
|
|
2022-08-22 13:54:01 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2020-03-20 13:59:31 +00:00
|
|
|
meta = with lib; {
|
2018-02-23 17:38:29 +00:00
|
|
|
description = "PS3 emulator/debugger";
|
|
|
|
homepage = "https://rpcs3.net/";
|
2021-11-02 09:42:13 +00:00
|
|
|
maintainers = with maintainers; [ abbradar neonfuz ilian zane ];
|
2021-05-11 02:39:53 +00:00
|
|
|
license = licenses.gpl2Only;
|
2023-02-10 16:36:33 +00:00
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
2023-08-04 18:23:13 +00:00
|
|
|
mainProgram = "rpcs3";
|
2018-02-23 17:38:29 +00:00
|
|
|
};
|
|
|
|
}
|