From b94135ba4e87f43b185df31d6ca97ef8c963f8b4 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 12 Mar 2024 19:29:10 +0100 Subject: [PATCH] depends: qt: fix macos camera permissions --- contrib/depends/packages/qt.mk | 2 ++ ..._static_qt_darwin_camera_permissions.patch | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 contrib/depends/patches/qt/fix_static_qt_darwin_camera_permissions.patch diff --git a/contrib/depends/packages/qt.mk b/contrib/depends/packages/qt.mk index e911176..a6ec9fa 100644 --- a/contrib/depends/packages/qt.mk +++ b/contrib/depends/packages/qt.mk @@ -21,6 +21,7 @@ $(package)_patches += libxau-fix.patch $(package)_patches += toolchain.cmake $(package)_patches += revert-macOS-Silence-warning-about-supporting-secure.patch $(package)_patches += no-resonance-audio.patch +$(package)_patches += fix_static_qt_darwin_camera_permissions.patch #$(package)_patches += fix-static-fontconfig-static-linking.patch $(package)_qttools_file_name=qttools-$($(package)_suffix) @@ -196,6 +197,7 @@ define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/xcb-util-image-fix.patch && \ patch -p1 -i $($(package)_patch_dir)/libxau-fix.patch && \ patch -p1 -i $($(package)_patch_dir)/revert-macOS-Silence-warning-about-supporting-secure.patch && \ + patch -p1 -i $($(package)_patch_dir)/fix_static_qt_darwin_camera_permissions.patch && \ cd ../qtmultimedia && \ patch -p1 -i $($(package)_patch_dir)/qtmultimedia-fixes.patch && \ patch -p1 -i $($(package)_patch_dir)/v4l2.patch && \ diff --git a/contrib/depends/patches/qt/fix_static_qt_darwin_camera_permissions.patch b/contrib/depends/patches/qt/fix_static_qt_darwin_camera_permissions.patch new file mode 100644 index 0000000..f8b8391 --- /dev/null +++ b/contrib/depends/patches/qt/fix_static_qt_darwin_camera_permissions.patch @@ -0,0 +1,27 @@ +diff --git a/src/corelib/platform/darwin/qdarwinpermissionplugin_camera.mm b/src/corelib/platform/darwin/qdarwinpermissionplugin_camera.mm +index 51c517d6f3..ed3135fba3 100644 +--- a/src/corelib/platform/darwin/qdarwinpermissionplugin_camera.mm ++++ b/src/corelib/platform/darwin/qdarwinpermissionplugin_camera.mm +@@ -7,8 +7,6 @@ + + QT_DEFINE_PERMISSION_STATUS_CONVERTER(AVAuthorizationStatus); + +-#ifndef BUILDING_PERMISSION_REQUEST +- + @implementation QDarwinCameraPermissionHandler + - (Qt::PermissionStatus)checkPermission:(QPermission)permission + { +@@ -25,8 +23,6 @@ QT_DEFINE_PERMISSION_STATUS_CONVERTER(AVAuthorizationStatus); + + #include "moc_qdarwinpermissionplugin_p_p.cpp" + +-#else // Building request +- + @implementation QDarwinCameraPermissionHandler (Request) + - (void)requestPermission:(QPermission)permission withCallback:(PermissionCallback)callback + { +@@ -39,4 +35,3 @@ QT_DEFINE_PERMISSION_STATUS_CONVERTER(AVAuthorizationStatus); + } + @end + +-#endif // BUILDING_PERMISSION_REQUEST