diff --git a/pkgs/by-name/pc/pcsx2/package.nix b/pkgs/by-name/pc/pcsx2/package.nix index 9aaf2bbedb34..e8375dc46f57 100644 --- a/pkgs/by-name/pc/pcsx2/package.nix +++ b/pkgs/by-name/pc/pcsx2/package.nix @@ -25,6 +25,7 @@ wayland, zip, zstd, + fetchpatch, }: let @@ -36,6 +37,16 @@ let qtwayland wrapQtAppsHook ; + + cubeb' = cubeb.overrideAttrs (old: { + patches = (old.patches or [ ]) ++ [ + (fetchpatch { + url = "https://github.com/PCSX2/pcsx2/commit/430e31abe4a9e09567cb542f1416b011bb9b6ef9.patch"; + stripLen = 2; + hash = "sha256-bbH0c1X3lMeX6hfNKObhcq5xraFpicFV3mODQGYudvQ="; + }) + ]; + }); in llvmPackages.stdenv.mkDerivation (finalAttrs: { inherit (sources.pcsx2) pname version src; @@ -43,6 +54,8 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { patches = [ # Remove PCSX2_GIT_REV ./0000-define-rev.patch + + ./remove-cubeb-vendor.patch ]; cmakeFlags = [ @@ -80,7 +93,8 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { vulkan-headers wayland zstd - ] ++ cubeb.passthru.backendLibs; + cubeb' + ]; strictDeps = true; @@ -94,13 +108,10 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { qtWrapperArgs = let - libs = lib.makeLibraryPath ( - [ - vulkan-loader - shaderc - ] - ++ cubeb.passthru.backendLibs - ); + libs = lib.makeLibraryPath ([ + vulkan-loader + shaderc + ]); in [ "--prefix LD_LIBRARY_PATH : ${libs}" ]; diff --git a/pkgs/by-name/pc/pcsx2/remove-cubeb-vendor.patch b/pkgs/by-name/pc/pcsx2/remove-cubeb-vendor.patch new file mode 100644 index 000000000000..2c98f22746dd --- /dev/null +++ b/pkgs/by-name/pc/pcsx2/remove-cubeb-vendor.patch @@ -0,0 +1,29 @@ +diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake +index ff66f9c..e177c90 100644 +--- a/cmake/SearchForStuff.cmake ++++ b/cmake/SearchForStuff.cmake +@@ -100,9 +100,8 @@ if(USE_VULKAN) + add_subdirectory(3rdparty/vulkan EXCLUDE_FROM_ALL) + endif() + +-add_subdirectory(3rdparty/cubeb EXCLUDE_FROM_ALL) +-disable_compiler_warnings_for_target(cubeb) +-disable_compiler_warnings_for_target(speex) ++find_package(cubeb REQUIRED GLOBAL) ++add_library(cubeb ALIAS cubeb::cubeb) + + # Find the Qt components that we need. + find_package(Qt6 6.7.2 COMPONENTS CoreTools Core GuiTools Gui WidgetsTools Widgets LinguistTools REQUIRED) +diff --git a/pcsx2/Host/CubebAudioStream.cpp b/pcsx2/Host/CubebAudioStream.cpp +index 4cd9993..604635d 100644 +--- a/pcsx2/Host/CubebAudioStream.cpp ++++ b/pcsx2/Host/CubebAudioStream.cpp +@@ -288,7 +288,7 @@ std::vector> AudioStream::GetCubebDriverName + std::vector> names; + names.emplace_back(std::string(), TRANSLATE_STR("AudioStream", "Default")); + +- const char** cubeb_names = cubeb_get_backend_names(); ++ const char* const* cubeb_names = cubeb_get_backend_names(); + for (u32 i = 0; cubeb_names[i] != nullptr; i++) + names.emplace_back(cubeb_names[i], cubeb_names[i]); +