Skip to content

Commit

Permalink
Merge pull request #161 from Yosam02/main
Browse files Browse the repository at this point in the history
Fix for #90 and #142 on Apple Silicon Devices
  • Loading branch information
laamaa authored Aug 16, 2024
2 parents d731a8f + bd3496f commit fa45b7d
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ if (APPLE)

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."
Expand All @@ -55,7 +56,8 @@ if (APPLE)
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 ()
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Disclaimer: I'm not a coder and hardly understand C, use at your own risk :)

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.
Expand Down Expand Up @@ -148,6 +150,8 @@ The program uses SDL's game controller system, which should make it work automag
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

Application settings and keyboard/game controller bindings can be configured via `config.ini`.
Expand Down
36 changes: 36 additions & 0 deletions package/macos/m8c.app/Contents/Info.plist
Original file line number Diff line number Diff line change
@@ -0,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>

0 comments on commit fa45b7d

Please sign in to comment.