shithub: m8c

Download patch

ref: fa45b7d739925f79a42fa348a158dbc090d28427
parent: d731a8f85ec4ccc5994eff9a13dda0dcb25e8ed5
parent: bd3496f8c413236b5531057978e91981f2040f1e
author: Jonne Kokkonen <jonne.kokkonen@gmail.com>
date: Fri Aug 16 08:59:11 EDT 2024

Merge pull request #161 from Yosam02/main

Fix for #90 and #142 on Apple Silicon Devices

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,6 +45,7 @@
 
     set_target_properties(${APP_NAME} PROPERTIES
             MACOSX_BUNDLE TRUE
+            MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/package/macos/m8c.app/Contents/Info.plist"
             MACOSX_BUNDLE_BUNDLE_NAME "m8c"
             MACOSX_BUNDLE_BUNDLE_VERSION "1"
             MACOSX_BUNDLE_COPYRIGHT "Copyright © 2021 laamaa. All rights reserved."
@@ -55,7 +56,8 @@
     set(APPS "\${CMAKE_INSTALL_PREFIX}/${APP_NAME}.app")
 
     install(CODE "include(BundleUtilities)
-    fixup_bundle(\"${APPS}\" \"\" \"\")")
+    fixup_bundle(\"${APPS}\" \"\" \"\")
+    execute_process(COMMAND codesign --force --deep --sign - \${CMAKE_INSTALL_PREFIX}/${APP_NAME}.app)")
     set(CPACK_GENERATOR "DragNDrop")
     include(CPack)
 endif ()
--- a/README.md
+++ b/README.md
@@ -28,6 +28,8 @@
 
 There are prebuilt binaries available in the [releases section](https://github.com/laamaa/m8c/releases/) for Windows and recent versions of MacOS.
 
+When running the program for the first time on MacOS, it may not open as it is from an Unidentified Developer. You need to open it from the Applications Folder via Control+Click > Open then select Open from the popup menu.
+
 ### Linux
 
 There are packages available for Fedora Linux and NixOS, or you can build the program from source.
@@ -147,6 +149,8 @@
 
 Experimental audio routing support can be enabled by setting the config value `"audio_enabled"` to `"true"`. The audio buffer size can also be tweaked from the config file for possible lower latencies.
 If the right audio device is not picked up by default, you can use a specific audio device by using `"audio_output_device"` config parameter.
+
+On MacOS you need to grant the program permission to access the Microphone for audio routing to work.
 
 ## Config
 
--- /dev/null
+++ b/package/macos/m8c.app/Contents/Info.plist
@@ -1,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+	<key>CFBundleGetInfoString</key>
+	<string>${MACOSX_BUNDLE_INFO_STRING}</string>
+	<key>CFBundleIconFile</key>
+	<string>${MACOSX_BUNDLE_ICON_FILE}</string>
+	<key>CFBundleIdentifier</key>
+	<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleLongVersionString</key>
+	<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
+	<key>CFBundleName</key>
+	<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+	<key>CSResourcesFileMapped</key>
+	<true/>
+	<key>NSHumanReadableCopyright</key>
+	<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+    <key>NSMicrophoneUsageDescription</key>
+	<string>Microphone access is required to enable audio routing.</string>
+</dict>
+</plist>
--