From 4b0d49b61a49ebe616340ba25c07783be9ce29de Mon Sep 17 00:00:00 2001 From: John Maguire Date: Mon, 9 Dec 2013 17:27:55 +0100 Subject: [PATCH] Add stricter Apple code signing. --- src/CMakeLists.txt | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4032da42f..3a6b5f34d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1355,6 +1355,21 @@ if (APPLE) install(DIRECTORY "${GROWL}/Versions/Current/Resources" DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Frameworks/Growl.framework") + install(FILES "${QT_QTCORE_LIBRARY}/Contents/Info.plist" + DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Frameworks/QtCore.framework/Contents") + install(FILES "${QT_QTGUI_LIBRARY}/Contents/Info.plist" + DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Frameworks/QtGui.framework/Contents") + install(FILES "${QT_QTNETWORK_LIBRARY}/Contents/Info.plist" + DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Frameworks/QtNetwork.framework/Contents") + install(FILES "${QT_QTOPENGL_LIBRARY}/Contents/Info.plist" + DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Frameworks/QtOpenGL.framework/Contents") + install(FILES "${QT_QTSQL_LIBRARY}/Contents/Info.plist" + DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Frameworks/QtSql.framework/Contents") + install(FILES "${QT_QTSVG_LIBRARY}/Contents/Info.plist" + DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Frameworks/QtSvg.framework/Contents") + install(FILES "${QT_QTXML_LIBRARY}/Contents/Info.plist" + DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Frameworks/QtXml.framework/Contents") + if (HAVE_BREAKPAD) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/google-breakpad/client/mac/build/Release/Breakpad.framework @@ -1385,11 +1400,35 @@ if (APPLE) DEPENDS ${PROJECT_BINARY_DIR}/clementine.breakpad) if (APPLE_DEVELOPER_ID) + add_custom_target( + sign_libraries + COMMAND + codesign -f --preserve-metadata=identifier,entitlements,resource-rules,requirements -s ${APPLE_DEVELOPER_ID} ${PROJECT_BINARY_DIR}/clementine.app/Contents/Frameworks/*.dylib + DEPENDS clementine) + + add_custom_target( + sign_frameworks + COMMAND + codesign -f --preserve-metadata=identifier,entitlements,resource-rules,requirements -s ${APPLE_DEVELOPER_ID} ${PROJECT_BINARY_DIR}/clementine.app/Contents/Frameworks/*.framework + DEPENDS clementine) + + add_custom_target( + sign_plugins + COMMAND + codesign -f --preserve-metadata=identifier,entitlements,resource-rules,requirements -s ${APPLE_DEVELOPER_ID} ${PROJECT_BINARY_DIR}/clementine.app/Contents/PlugIns/{accessible,codecs,gstreamer,iconengines,imageformats,gio-modules}/* + DEPENDS clementine) + + add_custom_target( + sign_helpers + COMMAND + codesign -f --preserve-metadata=identifier,entitlements,resource-rules,requirements -s ${APPLE_DEVELOPER_ID} ${PROJECT_BINARY_DIR}/clementine.app/Contents/PlugIns/{clementine-spotifyblob,clementine-tagreader,gst-plugin-scanner} + DEPENDS clementine) + add_custom_target( sign COMMAND - codesign -s ${APPLE_DEVELOPER_ID} -fv ${PROJECT_BINARY_DIR}/clementine.app - DEPENDS clementine + codesign --preserve-metadata=identifier,entitlements,resource-rules,requirements -s ${APPLE_DEVELOPER_ID} -fv ${PROJECT_BINARY_DIR}/clementine.app + DEPENDS sign_libraries sign_frameworks sign_plugins sign_helpers VERBATIM ) endif()