From ab68794361b520a41022c14ec93fe44fea04aebe Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Tue, 2 Feb 2021 01:49:16 -0800 Subject: [PATCH] cmake: Fix mac app zip + misc.. Remove keychain unlock for codesigning, that doesn't work anymore, the key has to be in the system keychain. Use `zip -9yr` instead of `zip -9r` to make the .zip file of the .app so that symlinks are preserved, this was creating a corrupted .app. Don't build zip in the mac builder, use the system zip instead. Signed-off-by: Rafael Kitover --- src/wx/CMakeLists.txt | 48 +++++++++++++++++-------------------------- tools/osx/builder | 7 +++---- 2 files changed, 22 insertions(+), 33 deletions(-) diff --git a/src/wx/CMakeLists.txt b/src/wx/CMakeLists.txt index 3ac87d96..48e2fcd3 100644 --- a/src/wx/CMakeLists.txt +++ b/src/wx/CMakeLists.txt @@ -1202,35 +1202,25 @@ if(APPLE AND (UPSTREAM_RELEASE OR ENABLE_ONLINEUPDATES)) endif() endif() - if(DEFINED ENV{LOGIN_KEYCHAIN_PASSWORD}) - add_custom_command( - TARGET visualboyadvance-m - POST_BUILD - COMMAND /bin/sh -c "security unlock-keychain -p \"$$LOGIN_KEYCHAIN_PASSWORD\" ~/Library/Keychains/login.keychain*" - ) + add_custom_command( + TARGET visualboyadvance-m + POST_BUILD + COMMAND codesign --sign "Developer ID Application" --force --deep ./visualboyadvance-m.app + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) - add_custom_command( - TARGET visualboyadvance-m - POST_BUILD - COMMAND codesign --sign "Developer ID Application" --force --deep ./visualboyadvance-m.app - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - ) - - if(EXISTS ${CMAKE_BINARY_DIR}/visualboyadvance-m.app/Contents/Frameworks) - # Sign frameworks individually, like Xcode. - file(GLOB frameworks ${CMAKE_BINARY_DIR}/visualboyadvance-m.app/Contents/Frameworks/*) - foreach(framework ${frameworks}) - message(STATUS "Signing framework: " ${framework}) - add_custom_command( - TARGET visualboyadvance-m - POST_BUILD - COMMAND codesign --sign "Developer ID Application" --force ${framework} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - ) - endforeach() - endif() - else() - message(WARNING "Set the environment variable LOGIN_KEYCHAIN_PASSWORD to your login keychain password to codesign.") + if(EXISTS ${CMAKE_BINARY_DIR}/visualboyadvance-m.app/Contents/Frameworks) + # Sign frameworks individually, like Xcode. + file(GLOB frameworks ${CMAKE_BINARY_DIR}/visualboyadvance-m.app/Contents/Frameworks/*) + foreach(framework ${frameworks}) + message(STATUS "Signing framework: " ${framework}) + add_custom_command( + TARGET visualboyadvance-m + POST_BUILD + COMMAND codesign --sign "Developer ID Application" --force ${framework} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + endforeach() endif() if(UPSTREAM_RELEASE) @@ -1240,7 +1230,7 @@ if(APPLE AND (UPSTREAM_RELEASE OR ENABLE_ONLINEUPDATES)) TARGET visualboyadvance-m POST_BUILD COMMAND ${CMAKE_COMMAND} -E remove ${appzip} - COMMAND ${ZIP_PROGRAM} -9r ${appzip} ./visualboyadvance-m.app + COMMAND ${ZIP_PROGRAM} -9yr ${appzip} ./visualboyadvance-m.app WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) diff --git a/tools/osx/builder b/tools/osx/builder index 07e4f62b..7ff35751 100755 --- a/tools/osx/builder +++ b/tools/osx/builder @@ -65,10 +65,9 @@ fi . "$(dirname "$0")/../builder/core.sh" -table_line_remove DISTS flex -table_line_remove DISTS libsecret -table_line_remove DISTS c2man -table_line_remove DISTS graphviz +for dist in flex libsecret c2man graphviz zip; do + table_line_remove DISTS "$dist" +done # issues with perl modules linked to our libs and brew perl table_line_remove DISTS shared-mime-info