cubeb: 0-unstable-2025-04-02 -> 0-unstable-2025-05-29

Signed-off-by: Marcin Serwin <marcin@serwin.dev>

+25 -293
-208
pkgs/by-name/cu/cubeb/0001-cmake-add-pkg-config-file-generation.patch
··· 1 - From e0cbc1049b9a3a3322cd48d32af148f87d5007c2 Mon Sep 17 00:00:00 2001 2 - From: Marcin Serwin <marcin@serwin.dev> 3 - Date: Mon, 19 May 2025 22:36:53 +0200 4 - Subject: [PATCH] cmake: add pkg-config file generation 5 - 6 - Signed-off-by: Marcin Serwin <marcin@serwin.dev> 7 - --- 8 - CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 9 - libcubeb.pc.in | 12 ++++++++++++ 10 - 2 files changed, 62 insertions(+) 11 - create mode 100644 libcubeb.pc.in 12 - 13 - diff --git a/CMakeLists.txt b/CMakeLists.txt 14 - index 07618fa..6470837 100644 15 - --- a/CMakeLists.txt 16 - +++ b/CMakeLists.txt 17 - @@ -23,6 +23,17 @@ if(NOT CMAKE_BUILD_TYPE) 18 - "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) 19 - endif() 20 - 21 - +set(private_requires) 22 - +set(private_libs) 23 - +set(private_libs_flags) 24 - +if(UNIX AND NOT APPLE) 25 - + if(BSD OR ANDROID) 26 - + list(APPEND private_libs c++) 27 - + else() 28 - + list(APPEND private_libs stdc++) 29 - + endif() 30 - +endif() 31 - + 32 - set(CMAKE_C_STANDARD 99) 33 - set(CMAKE_CXX_STANDARD 17) 34 - set(CMAKE_CXX_STANDARD_REQUIRED ON) 35 - @@ -141,6 +152,7 @@ if(NOT BUNDLE_SPEEX) 36 - pkg_check_modules(speexdsp IMPORTED_TARGET speexdsp) 37 - if(speexdsp_FOUND) 38 - add_library(speex ALIAS PkgConfig::speexdsp) 39 - + list(APPEND private_requires speexdsp) 40 - endif() 41 - endif() 42 - endif() 43 - @@ -155,6 +167,7 @@ if(NOT TARGET speex) 44 - EXPORT= 45 - RANDOM_PREFIX=speex 46 - ) 47 - + list(APPEND private_libs speex) 48 - endif() 49 - 50 - # $<BUILD_INTERFACE:> required because of https://gitlab.kitware.com/cmake/cmake/-/issues/15415 51 - @@ -166,6 +179,7 @@ include(CheckIncludeFiles) 52 - set(THREADS_PREFER_PTHREAD_FLAG ON) 53 - find_package(Threads) 54 - target_link_libraries(cubeb PRIVATE Threads::Threads) 55 - +list(APPEND private_libs ${CMAKE_THREAD_LIBS_INIT}) 56 - 57 - if(LAZY_LOAD_LIBS) 58 - check_include_files(pulse/pulseaudio.h USE_PULSE) 59 - @@ -176,6 +190,7 @@ if(LAZY_LOAD_LIBS) 60 - 61 - if(USE_PULSE OR USE_ALSA OR USE_JACK OR USE_SNDIO OR USE_AAUDIO) 62 - target_link_libraries(cubeb PRIVATE ${CMAKE_DL_LIBS}) 63 - + list(APPEND private_libs ${CMAKE_DL_LIBS}) 64 - 65 - if(ANDROID) 66 - target_compile_definitions(cubeb PRIVATE __ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__) 67 - @@ -191,6 +206,7 @@ else() 68 - set(USE_PULSE ON) 69 - target_compile_definitions(cubeb PRIVATE DISABLE_LIBPULSE_DLOPEN) 70 - target_link_libraries(cubeb PRIVATE PkgConfig::libpulse) 71 - + list(APPEND private_requires libpulse) 72 - endif() 73 - 74 - pkg_check_modules(alsa IMPORTED_TARGET alsa) 75 - @@ -198,6 +214,7 @@ else() 76 - set(USE_ALSA ON) 77 - target_compile_definitions(cubeb PRIVATE DISABLE_LIBASOUND_DLOPEN) 78 - target_link_libraries(cubeb PRIVATE PkgConfig::alsa) 79 - + list(APPEND private_requires alsa) 80 - endif() 81 - 82 - pkg_check_modules(jack IMPORTED_TARGET jack) 83 - @@ -205,18 +222,21 @@ else() 84 - set(USE_JACK ON) 85 - target_compile_definitions(cubeb PRIVATE DISABLE_LIBJACK_DLOPEN) 86 - target_link_libraries(cubeb PRIVATE PkgConfig::jack) 87 - + list(APPEND private_requires jack) 88 - endif() 89 - 90 - check_include_files(sndio.h USE_SNDIO) 91 - if(USE_SNDIO) 92 - target_compile_definitions(cubeb PRIVATE DISABLE_LIBSNDIO_DLOPEN) 93 - target_link_libraries(cubeb PRIVATE sndio) 94 - + list(APPEND private_libs sndio) 95 - endif() 96 - 97 - check_include_files(aaudio/AAudio.h USE_AAUDIO) 98 - if(USE_AAUDIO) 99 - target_compile_definitions(cubeb PRIVATE DISABLE_LIBAAUDIO_DLOPEN) 100 - target_link_libraries(cubeb PRIVATE aaudio) 101 - + list(APPEND private_libs aaudio) 102 - endif() 103 - endif() 104 - 105 - @@ -263,6 +283,7 @@ if(USE_AUDIOUNIT) 106 - src/cubeb_osx_run_loop.cpp) 107 - target_compile_definitions(cubeb PRIVATE USE_AUDIOUNIT) 108 - target_link_libraries(cubeb PRIVATE "-framework AudioUnit" "-framework CoreAudio" "-framework CoreServices") 109 - + list(APPEND private_libs_flags "-framework AudioUnit" "-framework CoreAudio" "-framework CoreServices") 110 - endif() 111 - 112 - check_include_files(audioclient.h USE_WASAPI) 113 - @@ -271,6 +292,7 @@ if(USE_WASAPI) 114 - src/cubeb_wasapi.cpp) 115 - target_compile_definitions(cubeb PRIVATE USE_WASAPI) 116 - target_link_libraries(cubeb PRIVATE avrt ole32 ksuser) 117 - + list(APPEND private_libs avrt ole32 ksuser) 118 - endif() 119 - 120 - check_include_files("windows.h;mmsystem.h" USE_WINMM) 121 - @@ -279,6 +301,7 @@ if(USE_WINMM) 122 - src/cubeb_winmm.c) 123 - target_compile_definitions(cubeb PRIVATE USE_WINMM) 124 - target_link_libraries(cubeb PRIVATE winmm) 125 - + list(APPEND private_libs winmm) 126 - endif() 127 - 128 - check_include_files(SLES/OpenSLES.h USE_OPENSL) 129 - @@ -288,6 +311,7 @@ if(USE_OPENSL) 130 - src/cubeb-jni.cpp) 131 - target_compile_definitions(cubeb PRIVATE USE_OPENSL) 132 - target_link_libraries(cubeb PRIVATE OpenSLES) 133 - + list(APPEND private_libs OpenSLES) 134 - endif() 135 - 136 - check_include_files(sys/soundcard.h HAVE_SYS_SOUNDCARD_H) 137 - @@ -303,6 +327,7 @@ if(HAVE_SYS_SOUNDCARD_H) 138 - pkg_check_modules(libbsd-overlay IMPORTED_TARGET libbsd-overlay) 139 - if(libbsd-overlay_FOUND) 140 - target_link_libraries(cubeb PRIVATE PkgConfig::libbsd-overlay) 141 - + list(APPEND private_requires libbsd-overlay) 142 - set(HAVE_STRLCPY true) 143 - endif() 144 - endif() 145 - @@ -320,6 +345,7 @@ if(USE_AUDIOTRACK) 146 - src/cubeb_audiotrack.c) 147 - target_compile_definitions(cubeb PRIVATE USE_AUDIOTRACK) 148 - target_link_libraries(cubeb PRIVATE log) 149 - + list(APPEND private_libs log) 150 - endif() 151 - 152 - check_include_files(sys/audioio.h USE_SUN) 153 - @@ -335,6 +361,7 @@ if(USE_KAI) 154 - src/cubeb_kai.c) 155 - target_compile_definitions(cubeb PRIVATE USE_KAI) 156 - target_link_libraries(cubeb PRIVATE kai) 157 - + list(APPEND private_libs kai) 158 - endif() 159 - 160 - if(USE_PULSE AND USE_PULSE_RUST) 161 - @@ -452,3 +479,26 @@ add_custom_target(clang-format-check 162 - | xargs -0 ${CLANG_FORMAT_BINARY} -Werror -n 163 - COMMENT "Check formatting with clang-format" 164 - VERBATIM) 165 - + 166 - + 167 - +list(TRANSFORM private_libs PREPEND "-l") 168 - +string(JOIN " " CUBEB_PC_PRIVATE_LIBS ${private_libs} ${private_libs_flags}) 169 - + 170 - +string(JOIN " " CUBEB_PC_PRIVATE_REQUIRES ${private_requires}) 171 - + 172 - +if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}") 173 - + set(CUBEB_PC_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}") 174 - +else() 175 - + set(CUBEB_PC_INCLUDEDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") 176 - +endif() 177 - +if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}") 178 - + set(CUBEB_PC_LIBDIR "${CMAKE_INSTALL_LIBDIR}") 179 - +else() 180 - + set(CUBEB_PC_LIBDIR "\${prefix}/${CMAKE_INSTALL_LIBDIR}") 181 - +endif() 182 - + 183 - +configure_file(libcubeb.pc.in libcubeb.pc @ONLY) 184 - +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libcubeb.pc" 185 - + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig 186 - +) 187 - + 188 - diff --git a/libcubeb.pc.in b/libcubeb.pc.in 189 - new file mode 100644 190 - index 0000000..2310ae6 191 - --- /dev/null 192 - +++ b/libcubeb.pc.in 193 - @@ -0,0 +1,12 @@ 194 - +prefix=@CMAKE_INSTALL_PREFIX@ 195 - +exec_prefix=${prefix} 196 - +libdir=@CUBEB_PC_LIBDIR@ 197 - +includedir=@CUBEB_PC_INCLUDEDIR@ 198 - + 199 - +Name: libcubeb 200 - +Description: Cross platform audio library 201 - +Version: @PROJECT_VERSION@ 202 - +Requires.private: @CUBEB_PC_PRIVATE_REQUIRES@ 203 - +Libs: -L${libdir} -lcubeb 204 - +Libs.private: @CUBEB_PC_PRIVATE_LIBS@ 205 - +Cflags: -I${includedir} 206 - -- 207 - 2.49.0 208 -
-31
pkgs/by-name/cu/cubeb/0001-cmake-don-t-hardcode-include-as-the-includedir.patch
··· 1 - From 4f8dff52e99bdd70d07d7cb47d357bb91dc5f1a9 Mon Sep 17 00:00:00 2001 2 - From: Marcin Serwin <marcin@serwin.dev> 3 - Date: Sat, 24 May 2025 16:20:51 +0200 4 - Subject: [PATCH] cmake: don't hardcode "include" as the includedir 5 - 6 - When the default CMAKE_INSTALL_INCLUDEDIR is changed 7 - headers are installed to a different location, however, the 8 - INTERFACE_INCLUDE_DIRECTORIES in exported cmake configuration still 9 - point to <prefix>/include. 10 - 11 - Signed-off-by: Marcin Serwin <marcin@serwin.dev> 12 - --- 13 - CMakeLists.txt | 2 +- 14 - 1 file changed, 1 insertion(+), 1 deletion(-) 15 - 16 - diff --git a/CMakeLists.txt b/CMakeLists.txt 17 - index 07618fa..bdf2212 100644 18 - --- a/CMakeLists.txt 19 - +++ b/CMakeLists.txt 20 - @@ -91,7 +91,7 @@ add_library(cubeb 21 - src/cubeb_utils.cpp 22 - ) 23 - target_include_directories(cubeb 24 - - PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include> 25 - + PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> 26 - ) 27 - set_target_properties(cubeb PROPERTIES 28 - VERSION ${cubeb_VERSION} 29 - -- 30 - 2.49.0 31 -
+4 -19
pkgs/by-name/cu/cubeb/package.nix
··· 14 14 15 15 # passthru.tests 16 16 testers, 17 - pcsx2, 18 - duckstation, 19 17 20 18 alsaSupport ? !stdenv.hostPlatform.isDarwin, 21 19 pulseSupport ? !stdenv.hostPlatform.isDarwin, ··· 26 24 27 25 stdenv.mkDerivation (finalAttrs: { 28 26 pname = "cubeb"; 29 - version = "0-unstable-2025-04-02"; 27 + version = "0-unstable-2025-05-29"; 30 28 31 29 src = fetchFromGitHub { 32 30 owner = "mozilla"; 33 31 repo = "cubeb"; 34 - rev = "975a727e5e308a04cfb9ecdf7ddaf1150ea3f733"; 35 - hash = "sha256-3IP++tdiJUwXR6t5mf/MkPd524K/LYESNMkQ8vy10jo="; 32 + rev = "78ee5f0efaaa395e3e1806e8ef85dcb15c7c063d"; 33 + hash = "sha256-PsBlZQTPiBt8Y3okFOZYhiFn58adxVlaf/hLA0doX0o="; 36 34 }; 37 35 38 36 outputs = [ ··· 56 54 ++ lib.optional pulseSupport libpulseaudio 57 55 ++ lib.optional sndioSupport sndio; 58 56 59 - patches = [ 60 - # https://github.com/mozilla/cubeb/pull/813 61 - ./0001-cmake-add-pkg-config-file-generation.patch 62 - 63 - # https://github.com/mozilla/cubeb/pull/814 64 - ./0001-cmake-don-t-hardcode-include-as-the-includedir.patch 65 - ]; 66 - 67 57 cmakeFlags = [ 68 58 (lib.cmakeBool "BUILD_SHARED_LIBS" enableShared) 69 59 (lib.cmakeBool "BUILD_TESTS" false) # tests require an audio server ··· 76 66 77 67 passthru = { 78 68 updateScript = unstableGitUpdater { hardcodeZeroVersion = true; }; 79 - 80 - tests = { 81 - # These packages depend on a patched version of cubeb 82 - inherit pcsx2 duckstation; 83 - pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 84 - }; 69 + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 85 70 }; 86 71 87 72 meta = {
+2 -1
pkgs/by-name/du/duckstation/package.nix
··· 6 6 callPackage, 7 7 cmake, 8 8 cpuinfo, 9 + cubeb, 9 10 curl, 10 11 extra-cmake-modules, 11 12 libXrandr, ··· 56 57 buildInputs = [ 57 58 SDL2 58 59 cpuinfo 59 - sources.cubeb 60 + cubeb 60 61 curl 61 62 libXrandr 62 63 libbacktrace
+9 -5
pkgs/by-name/du/duckstation/remove-cubeb-vendor.patch
··· 15 15 disable_compiler_warnings_for_target(kissfft) 16 16 17 17 diff --git a/src/util/cubeb_audio_stream.cpp b/src/util/cubeb_audio_stream.cpp 18 - index 85579c4..526d168 100644 18 + index 85579c4..339190a 100644 19 19 --- a/src/util/cubeb_audio_stream.cpp 20 20 +++ b/src/util/cubeb_audio_stream.cpp 21 - @@ -261,7 +261,7 @@ std::vector<std::pair<std::string, std::string>> AudioStream::GetCubebDriverName 21 + @@ -261,9 +261,9 @@ std::vector<std::pair<std::string, std::string>> AudioStream::GetCubebDriverName 22 22 std::vector<std::pair<std::string, std::string>> names; 23 23 names.emplace_back(std::string(), TRANSLATE_STR("AudioStream", "Default")); 24 24 25 25 - const char** cubeb_names = cubeb_get_backend_names(); 26 - + const char*const * cubeb_names = cubeb_get_backend_names(); 27 - for (u32 i = 0; cubeb_names[i] != nullptr; i++) 28 - names.emplace_back(cubeb_names[i], cubeb_names[i]); 26 + - for (u32 i = 0; cubeb_names[i] != nullptr; i++) 27 + - names.emplace_back(cubeb_names[i], cubeb_names[i]); 28 + + cubeb_backend_names backends = cubeb_get_backend_names(); 29 + + for (u32 i = 0; i < backends.count; i++) 30 + + names.emplace_back(backends.names[i], backends.names[i]); 29 31 return names; 32 + } 33 +
-12
pkgs/by-name/du/duckstation/sources.nix
··· 9 9 stdenv, 10 10 cmake, 11 11 ninja, 12 - cubeb, 13 12 }: 14 13 15 14 { ··· 163 162 license = lib.licenses.mit; 164 163 platforms = lib.platforms.linux; 165 164 }; 166 - }); 167 - 168 - cubeb = cubeb.overrideAttrs (old: { 169 - pname = "cubeb-patched-for-duckstation"; 170 - patches = (old.patches or [ ]) ++ [ 171 - (fetchpatch { 172 - url = "https://github.com/PCSX2/pcsx2/commit/430e31abe4a9e09567cb542f1416b011bb9b6ef9.patch"; 173 - stripLen = 2; 174 - hash = "sha256-bbH0c1X3lMeX6hfNKObhcq5xraFpicFV3mODQGYudvQ="; 175 - }) 176 - ]; 177 165 }); 178 166 }
+1 -12
pkgs/by-name/pc/pcsx2/package.nix
··· 25 25 wayland, 26 26 zip, 27 27 zstd, 28 - fetchpatch, 29 28 }: 30 29 31 30 let ··· 37 36 qtwayland 38 37 wrapQtAppsHook 39 38 ; 40 - 41 - cubeb' = cubeb.overrideAttrs (old: { 42 - patches = (old.patches or [ ]) ++ [ 43 - (fetchpatch { 44 - url = "https://github.com/PCSX2/pcsx2/commit/430e31abe4a9e09567cb542f1416b011bb9b6ef9.patch"; 45 - stripLen = 2; 46 - hash = "sha256-bbH0c1X3lMeX6hfNKObhcq5xraFpicFV3mODQGYudvQ="; 47 - }) 48 - ]; 49 - }); 50 39 in 51 40 llvmPackages.stdenv.mkDerivation (finalAttrs: { 52 41 inherit (sources.pcsx2) pname version src; ··· 93 82 vulkan-headers 94 83 wayland 95 84 zstd 96 - cubeb' 85 + cubeb 97 86 ]; 98 87 99 88 strictDeps = true;
+9 -5
pkgs/by-name/pc/pcsx2/remove-cubeb-vendor.patch
··· 15 15 # Find the Qt components that we need. 16 16 find_package(Qt6 6.7.2 COMPONENTS CoreTools Core GuiTools Gui WidgetsTools Widgets LinguistTools REQUIRED) 17 17 diff --git a/pcsx2/Host/CubebAudioStream.cpp b/pcsx2/Host/CubebAudioStream.cpp 18 - index 4cd9993..604635d 100644 18 + index 4cd9993..74c2f5a 100644 19 19 --- a/pcsx2/Host/CubebAudioStream.cpp 20 20 +++ b/pcsx2/Host/CubebAudioStream.cpp 21 - @@ -288,7 +288,7 @@ std::vector<std::pair<std::string, std::string>> AudioStream::GetCubebDriverName 21 + @@ -288,9 +288,9 @@ std::vector<std::pair<std::string, std::string>> AudioStream::GetCubebDriverName 22 22 std::vector<std::pair<std::string, std::string>> names; 23 23 names.emplace_back(std::string(), TRANSLATE_STR("AudioStream", "Default")); 24 24 25 25 - const char** cubeb_names = cubeb_get_backend_names(); 26 - + const char* const* cubeb_names = cubeb_get_backend_names(); 27 - for (u32 i = 0; cubeb_names[i] != nullptr; i++) 28 - names.emplace_back(cubeb_names[i], cubeb_names[i]); 26 + - for (u32 i = 0; cubeb_names[i] != nullptr; i++) 27 + - names.emplace_back(cubeb_names[i], cubeb_names[i]); 28 + + cubeb_backend_names backends = cubeb_get_backend_names(); 29 + + for (u32 i = 0; i < backends.count; i++) 30 + + names.emplace_back(backends.names[i], backends.names[i]); 29 31 32 + return names; 33 + }