From 4fdf97b652e92ef527a3ba56b29a6b96f7ca0266 Mon Sep 17 00:00:00 2001 From: Ryan Omasta Date: Sat, 7 Feb 2026 17:11:36 -0700 Subject: [PATCH 1/2] shadps4: 0.13.0 -> 0.15.0 https://github.com/shadps4-emu/shadPS4/releases/tag/v.0.15.0 Diff: https://github.com/shadps4-emu/shadPS4/compare/v.0.13.0...v.0.15.0 (cherry picked from commit 9e945edf7f107d1e4fa6d46458c78674557fc9b4) --- pkgs/by-name/sh/shadps4/package.nix | 89 ++++++++++++++++------------- 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/pkgs/by-name/sh/shadps4/package.nix b/pkgs/by-name/sh/shadps4/package.nix index 3ff4dd9e4d3e..a5820c0f0314 100644 --- a/pkgs/by-name/sh/shadps4/package.nix +++ b/pkgs/by-name/sh/shadps4/package.nix @@ -1,28 +1,27 @@ { lib, - gcc14Stdenv, + stdenv, fetchFromGitHub, + makeWrapper, nixosTests, alsa-lib, boost, + cli11, cmake, cryptopp, - game-music-emu, - glslang, ffmpeg, - flac, - fluidsynth, fmt, half, jack2, libdecor, - libGL, + libpng, libpulseaudio, libunwind, libusb1, - libvorbis, - libxmp, + magic-enum, + miniz, + nlohmann_json, libgbm, libx11, libxcb, @@ -32,14 +31,14 @@ libxrandr, libxscrnsaver, libxtst, - magic-enum, - mpg123, pipewire, pkg-config, pugixml, rapidjson, renderdoc, robin-map, + sdl3, + sdl3-mixer, sndio, stb, toml11, @@ -49,29 +48,38 @@ vulkan-memory-allocator, xbyak, xxhash, - zlib-ng, - zydis, + zlib, nix-update-script, }: -# relies on std::sinf & co, which was broken in GCC until GCC 14: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79700 -gcc14Stdenv.mkDerivation (finalAttrs: { +stdenv.mkDerivation (finalAttrs: { pname = "shadps4"; - version = "0.13.0"; + version = "0.15.0"; src = fetchFromGitHub { owner = "shadps4-emu"; repo = "shadPS4"; tag = "v.${finalAttrs.version}"; - hash = "sha256-zc3zhFTphty/vwioFEOfhgXttpD9MG2F7+YJYcW0H2w="; - fetchSubmodules = true; + hash = "sha256-76rbxOf4grDWPVILy8nF35wQ6/NcxHQkmiQOB0u4oJo="; - leaveDotGit = true; - postFetch = '' + postCheckout = '' cd "$out" + git rev-parse --short=8 HEAD > $out/COMMIT date -u -d "@$(git log -1 --pretty=%ct)" "+%Y-%m-%dT%H:%M:%SZ" > $out/SOURCE_DATE_EPOCH - find "$out" -name .git -print0 | xargs -0 rm -rf + + git -C externals submodule update --init --recursive \ + glslang \ + zydis \ + sirit \ + tracy \ + ext-libusb \ + discord-rpc \ + hwinfo \ + openal-soft \ + dear_imgui \ + LibAtrac9 \ + aacdec/fdk-aac ''; }; @@ -82,27 +90,26 @@ gcc14Stdenv.mkDerivation (finalAttrs: { --replace-fail @GIT_BRANCH@ ${finalAttrs.version} \ --replace-fail @GIT_DESC@ nixpkgs \ --replace-fail @BUILD_DATE@ $(cat SOURCE_DATE_EPOCH) + + substituteInPlace src/core/libraries/np/trophy_ui.cpp \ + --replace-fail "MIX_SetMasterGain" "MIX_SetMixerGain" \ + --replace-fail "MIX_GetMasterGain" "MIX_GetMixerGain" ''; buildInputs = [ alsa-lib boost + cli11 cryptopp - game-music-emu - glslang ffmpeg - flac - fluidsynth fmt half jack2 libdecor - libGL + libpng libpulseaudio libunwind libusb1 - libvorbis - libxmp libx11 libxcb libxcursor @@ -111,14 +118,17 @@ gcc14Stdenv.mkDerivation (finalAttrs: { libxrandr libxscrnsaver libxtst - libgbm magic-enum - mpg123 + miniz + libgbm + nlohmann_json pipewire pugixml rapidjson renderdoc robin-map + sdl3 + sdl3-mixer sndio stb toml11 @@ -128,13 +138,13 @@ gcc14Stdenv.mkDerivation (finalAttrs: { vulkan-memory-allocator xbyak xxhash - zlib-ng - zydis + zlib ]; nativeBuildInputs = [ cmake pkg-config + makeWrapper ]; cmakeFlags = [ @@ -145,15 +155,14 @@ gcc14Stdenv.mkDerivation (finalAttrs: { cmakeBuildType = "RelWithDebugInfo"; dontStrip = true; - installPhase = '' - runHook preInstall - - install -D -t $out/bin shadps4 - 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 + postInstall = '' + wrapProgram $out/bin/shadps4 \ + --prefix LD_LIBRARY_PATH : ${ + lib.makeLibraryPath [ + libpulseaudio + pipewire + ] + } ''; runtimeDependencies = [ From 886e007f97bcb84fe03f5abe9a2ef266c2dbb3b3 Mon Sep 17 00:00:00 2001 From: Ryan Omasta Date: Sat, 27 Dec 2025 18:46:38 -0700 Subject: [PATCH 2/2] shadps4-qtlauncher: init at 224 (cherry picked from commit 8de3589aa7eef694921497aa371555b0b8334c98) --- .../by-name/sh/shadps4-qtlauncher/package.nix | 104 ++++++++++++++++++ .../sh/shadps4-qtlauncher/qt-paths.patch | 50 +++++++++ pkgs/by-name/sh/shadps4-qtlauncher/qt_ui.ini | 2 + .../version-directory.patch | 37 +++++++ .../sh/shadps4-qtlauncher/versions.json | 8 ++ 5 files changed, 201 insertions(+) create mode 100644 pkgs/by-name/sh/shadps4-qtlauncher/package.nix create mode 100644 pkgs/by-name/sh/shadps4-qtlauncher/qt-paths.patch create mode 100644 pkgs/by-name/sh/shadps4-qtlauncher/qt_ui.ini create mode 100644 pkgs/by-name/sh/shadps4-qtlauncher/version-directory.patch create mode 100644 pkgs/by-name/sh/shadps4-qtlauncher/versions.json diff --git a/pkgs/by-name/sh/shadps4-qtlauncher/package.nix b/pkgs/by-name/sh/shadps4-qtlauncher/package.nix new file mode 100644 index 000000000000..8b0a0888bef2 --- /dev/null +++ b/pkgs/by-name/sh/shadps4-qtlauncher/package.nix @@ -0,0 +1,104 @@ +{ + lib, + stdenv, + fetchFromGitHub, + + cmake, + pkg-config, + qt6, + + fmt, + sdl3, + toml11, + + shadps4, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "shadps4-qtlauncher"; + version = "224"; + + src = fetchFromGitHub { + owner = "shadps4-emu"; + repo = "shadps4-qtlauncher"; + tag = "v${finalAttrs.version}"; + hash = "sha256-lRZH9fokUKN/n3m/ZkTsRHwkwZZ04buvqBMXYLrqqLE="; + + postCheckout = '' + cd "$out" + + git rev-parse --short=8 HEAD > $out/COMMIT + date -u -d "@$(git log -1 --pretty=%ct)" "+%Y-%m-%dT%H:%M:%SZ" > $out/SOURCE_DATE_EPOCH + + git -C externals submodule update --init --recursive \ + volk \ + json + ''; + }; + + strictDeps = true; + __structuredAttrs = true; + + patches = [ + ./qt-paths.patch + # https://github.com/shadps4-emu/shadps4-qtlauncher/pull/335 + ./version-directory.patch + ]; + + postPatch = '' + substituteInPlace src/common/scm_rev.cpp.in \ + --replace-fail @APP_VERSION@ ${finalAttrs.version} \ + --replace-fail @GIT_REV@ $(cat COMMIT) \ + --replace-fail @GIT_BRANCH@ ${finalAttrs.version} \ + --replace-fail @GIT_DESC@ nixpkgs \ + --replace-fail @BUILD_DATE@ $(cat SOURCE_DATE_EPOCH) + + substituteInPlace src/common/versions.cpp \ + --replace-fail "@shadps4-qt@" "$out" + + substituteInPlace src/qt_gui/gui_settings.cpp \ + --replace-fail "@shadps4-qt@" "$out" + + substituteInPlace src/qt_gui/version_dialog.cpp \ + --replace-fail "@shadps4-qt@" "$out" + ''; + + nativeBuildInputs = [ + cmake + pkg-config + qt6.wrapQtAppsHook + ]; + + buildInputs = [ + fmt + sdl3 + toml11 + qt6.qtbase + qt6.qttools + qt6.qtmultimedia + ]; + + cmakeFlags = [ + (lib.cmakeBool "ENABLE_UPDATER" false) + (lib.cmakeBool "HIDE_VERSION_MANAGER" true) + ]; + + postInstall = '' + substitute ${./versions.json} $out/share/versions.json \ + --replace-fail @shadps4@ ${lib.getExe shadps4} + + substitute ${./qt_ui.ini} $out/share/qt_ui.ini \ + --replace-fail @shadps4@ ${lib.getExe shadps4} + ''; + + meta = { + inherit (shadps4.meta) + platforms + license + maintainers + ; + + description = shadps4.meta.description + " (Qt UI)"; + homepage = "https://github.com/shadps4-emu/shadps4-qtlauncher"; + mainProgram = "shadPS4QtLauncher"; + }; +}) diff --git a/pkgs/by-name/sh/shadps4-qtlauncher/qt-paths.patch b/pkgs/by-name/sh/shadps4-qtlauncher/qt-paths.patch new file mode 100644 index 000000000000..45d41ddbf425 --- /dev/null +++ b/pkgs/by-name/sh/shadps4-qtlauncher/qt-paths.patch @@ -0,0 +1,50 @@ +diff --git a/src/common/versions.cpp b/src/common/versions.cpp +index b935bb6..8625989 100644 +--- a/src/common/versions.cpp ++++ b/src/common/versions.cpp +@@ -18,7 +18,7 @@ namespace VersionManager { + + std::vector GetVersionList(std::filesystem::path const& path) { + std::filesystem::path cfg_path = +- path.empty() ? Common::FS::GetUserPath(Common::FS::PathType::LauncherDir) / "versions.json" ++ path.empty() ? "@shadps4-qt@/share/versions.json" + : path; + + std::ifstream ifs{cfg_path}; +@@ -76,7 +76,7 @@ std::vector GetVersionList(std::filesystem::path const& path) { + + void SaveVersionList(std::vector const& versions, std::filesystem::path const& path) { + std::filesystem::path out_path = +- path.empty() ? Common::FS::GetUserPath(Common::FS::PathType::LauncherDir) / "versions.json" ++ path.empty() ? "@shadps4-qt@/share/versions.json" + : path; + + json root = json::array(); +diff --git a/src/qt_gui/gui_settings.cpp b/src/qt_gui/gui_settings.cpp +index 707131c..40e3f14 100644 +--- a/src/qt_gui/gui_settings.cpp ++++ b/src/qt_gui/gui_settings.cpp +@@ -5,7 +5,9 @@ + #include "gui_settings.h" + + gui_settings::gui_settings(QObject* parent) : settings(parent) { +- m_settings = std::make_unique(ComputeSettingsDir() + "qt_ui.ini", ++ QString currentPath; ++ Common::FS::PathToQString(currentPath, "@shadps4-qt@/share/qt_ui.ini"); ++ m_settings = std::make_unique(currentPath, + QSettings::Format::IniFormat, parent); + } + +diff --git a/src/qt_gui/version_dialog.cpp b/src/qt_gui/version_dialog.cpp +index 2ed0418..13c6788 100644 +--- a/src/qt_gui/version_dialog.cpp ++++ b/src/qt_gui/version_dialog.cpp +@@ -638,7 +638,7 @@ tr("First you need to choose a location to save the versions in\n'Path to save v + } + + void VersionDialog::LoadInstalledList() { +- const auto path = Common::FS::GetUserPath(Common::FS::PathType::LauncherDir) / "versions.json"; ++ const auto path = "@shadps4-qt@/share/versions.json"; + auto versions = VersionManager::GetVersionList(path); + const auto& selected_version = + m_gui_settings->GetValue(gui::vm_versionSelected).toString().toStdString(); diff --git a/pkgs/by-name/sh/shadps4-qtlauncher/qt_ui.ini b/pkgs/by-name/sh/shadps4-qtlauncher/qt_ui.ini new file mode 100644 index 000000000000..dd5bc8fef4d1 --- /dev/null +++ b/pkgs/by-name/sh/shadps4-qtlauncher/qt_ui.ini @@ -0,0 +1,2 @@ +[version_manager] +versionSelected=@shadps4@ diff --git a/pkgs/by-name/sh/shadps4-qtlauncher/version-directory.patch b/pkgs/by-name/sh/shadps4-qtlauncher/version-directory.patch new file mode 100644 index 000000000000..77b80208c18e --- /dev/null +++ b/pkgs/by-name/sh/shadps4-qtlauncher/version-directory.patch @@ -0,0 +1,37 @@ +diff --git a/src/qt_gui/game_install_dialog.cpp b/src/qt_gui/game_install_dialog.cpp +index 8a9b94d..919d4a5 100644 +--- a/src/qt_gui/game_install_dialog.cpp ++++ b/src/qt_gui/game_install_dialog.cpp +@@ -144,7 +144,9 @@ void GameInstallDialog::Save() { + // Check games directory. + auto gamesDirectory = m_gamesDirectory->text(); + auto addonsDirectory = m_addonsDirectory->text(); ++#ifndef HIDE_VERSION_MANAGER + auto versionDirectory = m_versionDirectory->text(); ++#endif + + if (gamesDirectory.isEmpty() || !QDir(gamesDirectory).exists() || + !QDir::isAbsolutePath(gamesDirectory)) { +@@ -167,6 +169,7 @@ void GameInstallDialog::Save() { + } + } + ++#ifndef HIDE_VERSION_MANAGER + if (versionDirectory.isEmpty() || !QDir::isAbsolutePath(versionDirectory)) { + QMessageBox::critical(this, tr("Error"), + "The value for location to install emulator versions is not valid."); +@@ -181,11 +184,14 @@ void GameInstallDialog::Save() { + return; + } + } ++#endif + + // Save the directories + Config::addGameInstallDir(Common::FS::PathFromQString(gamesDirectory)); + Config::setAddonInstallDir(Common::FS::PathFromQString(addonsDirectory)); ++#ifndef HIDE_VERSION_MANAGER + m_gui_settings->SetValue(gui::vm_versionPath, versionDirectory); ++#endif + + const auto config_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir); + Config::save(config_dir / "config.toml"); diff --git a/pkgs/by-name/sh/shadps4-qtlauncher/versions.json b/pkgs/by-name/sh/shadps4-qtlauncher/versions.json new file mode 100644 index 000000000000..abe7564b8e74 --- /dev/null +++ b/pkgs/by-name/sh/shadps4-qtlauncher/versions.json @@ -0,0 +1,8 @@ +[ + { + "codename": "built-in", + "name": "built-in", + "path": "@shadps4@", + "type": 0 + } +]