diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 7735e437..b4608e2e 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -58,6 +58,11 @@ jobs: codesign -s "Developer ID Application: Dimitris Panokostas (5GQP72592A)" -f -o runtime,hard $file fi done + for file in build/Amiberry.app/Contents/Resources/plugins/*.dylib; do + if [ -f "$file" ]; then + codesign -s "Developer ID Application: Dimitris Panokostas (5GQP72592A)" -f -o runtime,hard $file + fi + done - name: Codesign the app run: | @@ -140,6 +145,11 @@ jobs: codesign -s "Developer ID Application: Dimitris Panokostas (5GQP72592A)" -f -o runtime,hard $file fi done + for file in build/Amiberry.app/Contents/Resources/plugins/*.dylib; do + if [ -f "$file" ]; then + codesign -s "Developer ID Application: Dimitris Panokostas (5GQP72592A)" -f -o runtime,hard $file + fi + done - name: Codesign the app run: | diff --git a/cmake/macos/CMakeLists.txt b/cmake/macos/CMakeLists.txt index 1de6697f..98313585 100644 --- a/cmake/macos/CMakeLists.txt +++ b/cmake/macos/CMakeLists.txt @@ -21,11 +21,11 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $ - $/../Frameworks/$) + $/../Resources/plugins/$) add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $ - $/../Frameworks/$) + $/../Resources/plugins/$) # Gather all dependencies with dylibbundler add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD @@ -33,9 +33,9 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD if (NOT "${CMAKE_GENERATOR}" MATCHES "Xcode") install(FILES $ - DESTINATION $/../Frameworks/) + DESTINATION $/../Resources/plugins/) install(FILES $ - DESTINATION $/../Frameworks/) + DESTINATION $/../Resources/plugins/) # This one contains the gamecontrollersdb.txt file install(DIRECTORY ${CMAKE_SOURCE_DIR}/controllers diff --git a/src/osdep/amiberry.cpp b/src/osdep/amiberry.cpp index f70ad211..ac9f76ce 100644 --- a/src/osdep/amiberry.cpp +++ b/src/osdep/amiberry.cpp @@ -4006,7 +4006,17 @@ void create_missing_amiberry_folders() if (!my_existsdir(config_path.c_str())) my_mkdir(config_path.c_str()); if (!my_existsdir(plugins_dir.c_str())) - my_mkdir(plugins_dir.c_str()); + { + my_mkdir(plugins_dir.c_str()); +#ifdef __MACH__ + const std::string bundled_plugins_path = app_directory + "/Resources/plugins/"; + if (my_existsdir(bundled_plugins_path.c_str())) + { + const std::string command = "cp -r " + bundled_plugins_path + "* " + plugins_dir; + system(command.c_str()); + } +#endif + } if (!my_existsdir(controllers_path.c_str())) { my_mkdir(controllers_path.c_str());