Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #313637 from wegank/qt6-qtmultimedia-fix-1

qt6.qtmultimedia: fix build on darwin

authored by K900 and committed by GitHub ea2970e9 653df61e

+52
+2
pkgs/development/libraries/qt-6/modules/qtmultimedia.nix
··· 39 39 40 40 patches = [ 41 41 ../patches/fix-qtgui-include-incorrect-case.patch 42 + # Remove new constants since macOS 12+, since we build Qt with the macOS 11 SDK 43 + ../patches/qtmultimedia-darwin-revert-replace-deprecated-constant.patch 42 44 ] ++ lib.optionals stdenv.hostPlatform.isMinGW [ 43 45 ../patches/qtmultimedia-windows-no-uppercase-libs.patch 44 46 ../patches/qtmultimedia-windows-resolve-function-name.patch
+50
pkgs/development/libraries/qt-6/patches/qtmultimedia-darwin-revert-replace-deprecated-constant.patch
··· 1 + diff --git a/src/multimedia/darwin/qdarwinmediadevices.mm b/src/multimedia/darwin/qdarwinmediadevices.mm 2 + index b0a108935..881066928 100644 3 + --- a/src/multimedia/darwin/qdarwinmediadevices.mm 4 + +++ b/src/multimedia/darwin/qdarwinmediadevices.mm 5 + @@ -42,7 +42,7 @@ static AudioDeviceID defaultAudioDevice(QAudioDevice::Mode mode) 6 + const AudioObjectPropertyAddress propertyAddress = { 7 + selector, 8 + kAudioObjectPropertyScopeGlobal, 9 + - kAudioObjectPropertyElementMain, 10 + + kAudioObjectPropertyElementMaster, 11 + }; 12 + 13 + if (auto audioDevice = getAudioObject<AudioDeviceID>(kAudioObjectSystemObject, propertyAddress, 14 + @@ -77,7 +77,7 @@ static QList<QAudioDevice> availableAudioDevices(QAudioDevice::Mode mode) 15 + 16 + const AudioObjectPropertyAddress audioDevicesPropertyAddress = { 17 + kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, 18 + - kAudioObjectPropertyElementMain 19 + + kAudioObjectPropertyElementMaster 20 + }; 21 + 22 + if (auto audioDevices = getAudioData<AudioDeviceID>( 23 + @@ -130,11 +130,11 @@ static OSStatus audioDeviceChangeListener(AudioObjectID id, UInt32, 24 + 25 + static constexpr AudioObjectPropertyAddress listenerAddresses[] = { 26 + { kAudioHardwarePropertyDefaultInputDevice, kAudioObjectPropertyScopeGlobal, 27 + - kAudioObjectPropertyElementMain }, 28 + + kAudioObjectPropertyElementMaster }, 29 + { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, 30 + - kAudioObjectPropertyElementMain }, 31 + + kAudioObjectPropertyElementMaster }, 32 + { kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, 33 + - kAudioObjectPropertyElementMain } 34 + + kAudioObjectPropertyElementMaster } 35 + }; 36 + 37 + static void setAudioListeners(QDarwinMediaDevices &instance) 38 + diff --git a/src/multimedia/darwin/qmacosaudiodatautils_p.h b/src/multimedia/darwin/qmacosaudiodatautils_p.h 39 + index 8cc2f8440..5cd6fced2 100644 40 + --- a/src/multimedia/darwin/qmacosaudiodatautils_p.h 41 + +++ b/src/multimedia/darwin/qmacosaudiodatautils_p.h 42 + @@ -44,7 +44,7 @@ void printUnableToReadWarning(const char *logName, AudioObjectID objectID, const 43 + 44 + inline static AudioObjectPropertyAddress 45 + makePropertyAddress(AudioObjectPropertySelector selector, QAudioDevice::Mode mode, 46 + - AudioObjectPropertyElement element = kAudioObjectPropertyElementMain) 47 + + AudioObjectPropertyElement element = kAudioObjectPropertyElementMaster) 48 + { 49 + return { selector, 50 + mode == QAudioDevice::Input ? kAudioDevicePropertyScopeInput