Skip to content

Commit

Permalink
shadps4: 0.4.0 -> 0.4.0-unstable-2024-12-08
Browse files Browse the repository at this point in the history
  • Loading branch information
OPNA2608 committed Dec 8, 2024
1 parent 7aad709 commit 383458f
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 101 deletions.
30 changes: 0 additions & 30 deletions pkgs/by-name/sh/shadps4/0001-Disable-update-checking.patch

This file was deleted.

28 changes: 0 additions & 28 deletions pkgs/by-name/sh/shadps4/av_err2str_macro.patch

This file was deleted.

19 changes: 0 additions & 19 deletions pkgs/by-name/sh/shadps4/bloodborne.patch

This file was deleted.

22 changes: 17 additions & 5 deletions pkgs/by-name/sh/shadps4/laptop-controls.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
From 0a93bc8850b4b1608d77b123cdb1875f60635e6d Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Sat, 7 Dec 2024 10:47:29 +0100
Subject: [PATCH] Support keypad-less keyboards everywhere

---
src/sdl_window.cpp | 7 -------
1 file changed, 7 deletions(-)

diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp
index bd2cc39d..13438149 100644
index d95e8d63..ac8c5c72 100644
--- a/src/sdl_window.cpp
+++ b/src/sdl_window.cpp
@@ -127,19 +127,12 @@ void WindowSDL::onResize() {
void WindowSDL::onKeyPress(const SDL_Event* event) {
using Libraries::Pad::OrbisPadButtonDataOffset;
@@ -174,19 +174,12 @@ void WindowSDL::OnResize() {
}

void WindowSDL::OnKeyPress(const SDL_Event* event) {
-#ifdef __APPLE__
// Use keys that are more friendly for keyboards without a keypad.
// Once there are key binding options this won't be necessary.
Expand All @@ -20,5 +29,8 @@ index bd2cc39d..13438149 100644
- constexpr SDL_Keycode TriangleKey = SDLK_KP_8;
-#endif

u32 button = 0;
auto button = OrbisPadButtonDataOffset::None;
Input::Axis axis = Input::Axis::AxisMax;
--
2.47.0

32 changes: 13 additions & 19 deletions pkgs/by-name/sh/shadps4/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
alsa-lib,
boost184,
cmake,
cryptopp,
glslang,
ffmpeg,
fmt,
half,
jack2,
libdecor,
libpulseaudio,
Expand All @@ -22,8 +22,9 @@
qt6,
rapidjson,
renderdoc,
robin-map,
sndio,
toml11,
stb,
vulkan-headers,
vulkan-loader,
vulkan-memory-allocator,
Expand All @@ -35,29 +36,19 @@

stdenv.mkDerivation (finalAttrs: {
pname = "shadps4";
version = "0.4.0";
version = "0.4.0-unstable-2024-12-08";

src = fetchFromGitHub {
owner = "shadps4-emu";
repo = "shadPS4";
rev = "refs/tags/v.${finalAttrs.version}";
hash = "sha256-dAhm9XMFnpNmbgi/TGktNHMdFDYPOWj31pZkBoUfQhA=";
rev = "4fb2247196d4626bab8f2c28710b0c34cad053fe";
hash = "sha256-bRURBUhIVQLrBxJFaJirw3n1n7xviRoAZGLZ+rV/UeM=";
fetchSubmodules = true;
};

patches = [
# https://github.com/shadps4-emu/shadPS4/issues/758
./bloodborne.patch
# Fix controls without a numpad
./laptop-controls.patch

# Disable auto-updating, as
# downloading an AppImage and trying to run it just won't work.
# https://github.com/shadps4-emu/shadPS4/issues/1368
./0001-Disable-update-checking.patch

# https://github.com/shadps4-emu/shadPS4/issues/1457
./av_err2str_macro.patch
];

buildInputs = [
Expand All @@ -67,6 +58,7 @@ stdenv.mkDerivation (finalAttrs: {
glslang
ffmpeg
fmt
half
jack2
libdecor
libpulseaudio
Expand All @@ -84,8 +76,9 @@ stdenv.mkDerivation (finalAttrs: {
qt6.qtwayland
rapidjson
renderdoc
robin-map
sndio
toml11
stb
vulkan-headers
vulkan-loader
vulkan-memory-allocator
Expand All @@ -101,6 +94,7 @@ stdenv.mkDerivation (finalAttrs: {

cmakeFlags = [
(lib.cmakeBool "ENABLE_QT_GUI" true)
(lib.cmakeBool "ENABLE_UPDATER" false)
];

# Still in development, help with debugging
Expand All @@ -111,8 +105,9 @@ stdenv.mkDerivation (finalAttrs: {
runHook preInstall
install -D -t $out/bin shadps4
install -Dm644 -t $out/share/icons/hicolor/512x512/apps $src/.github/shadps4.png
install -Dm644 -t $out/share/applications $src/.github/shadps4.desktop
install -Dm644 $src/.github/shadps4.png $out/share/icons/hicolor/512x512/apps/net.shadps4.shadPS4.png
install -Dm644 -t $out/share/applications $src/dist/net.shadps4.shadPS4.desktop
install -Dm644 -t $out/share/metainfo $src/dist/net.shadps4.shadPS4.metainfo.xml
runHook postInstall
'';
Expand All @@ -135,7 +130,6 @@ stdenv.mkDerivation (finalAttrs: {
meta = {
description = "Early in development PS4 emulator";
homepage = "https://github.com/shadps4-emu/shadPS4";
changelog = "https://github.com/shadps4-emu/shadPS4/releases/tag/v.${finalAttrs.version}";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ ryand56 ];
mainProgram = "shadps4";
Expand Down
5 changes: 5 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,11 @@ with pkgs;
withWayland = true;
};

shadps4 = callPackage ../by-name/sh/shadps4/package.nix {
# relies on std::sinf & co, which was broken in GCC until GCC 14: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79700
stdenv = gcc14Stdenv;
};

snes9x-gtk = snes9x.override {
withGtk = true;
};
Expand Down

0 comments on commit 383458f

Please sign in to comment.