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 <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2021-02-02 01:49:16 -08:00
parent eaf4785915
commit ab68794361
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
2 changed files with 22 additions and 33 deletions

View File

@ -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}
)

View File

@ -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