Skip to content
Snippets Groups Projects
Commit 4bce873f authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

build: generate .app bundle

- prepare app for distribution
- add notarization

Change-Id: I105e084292423fdd8c6b2d56f5e62a081defde99
parent be9dd0d0
No related branches found
No related tags found
No related merge requests found
cmake_minimum_required(VERSION 3.11) cmake_minimum_required(VERSION 3.11)
project(jami-qt) if (APPLE)
project(Jami)
else()
project(jami-qt)
endif()
if(MSVC) if(MSVC)
cmake_minimum_required(VERSION 3.15) cmake_minimum_required(VERSION 3.15)
...@@ -389,6 +393,9 @@ else() ...@@ -389,6 +393,9 @@ else()
find_library(ringclient ringclient ${LRCLIBDIR} NO_DEFAULT_PATH) find_library(ringclient ringclient ${LRCLIBDIR} NO_DEFAULT_PATH)
find_library(SYSTEM_CONFIGURATUION SystemConfiguration) find_library(SYSTEM_CONFIGURATUION SystemConfiguration)
SET(myApp_ICON ${CMAKE_CURRENT_SOURCE_DIR}/resources/images/jami.icns)
SET_SOURCE_FILES_PROPERTIES(${myApp_ICON} PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)
endif() endif()
# Qt find package # Qt find package
...@@ -607,6 +614,7 @@ elseif (NOT APPLE) ...@@ -607,6 +614,7 @@ elseif (NOT APPLE)
add_custom_target(uninstall add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
else() else()
target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/resources/images/jami.icns)
target_link_libraries(${PROJECT_NAME} PRIVATE target_link_libraries(${PROJECT_NAME} PRIVATE
${QML_LIBS} ${QML_LIBS}
${LRC_LIB_NAME} ${LRC_LIB_NAME}
...@@ -634,9 +642,25 @@ else() ...@@ -634,9 +642,25 @@ else()
install(DIRECTORY "${CMAKE_BINARY_DIR}/share/libringclient/translations/" install(DIRECTORY "${CMAKE_BINARY_DIR}/share/libringclient/translations/"
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/libringclient/translations) DESTINATION ${CMAKE_INSTALL_PREFIX}/share/libringclient/translations)
endif() endif()
set_target_properties(${PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/resources/Info.plist"
MACOSX_BUNDLE_EXECUTABLE_NAME "${PROJ_NAME}"
MACOSX_BUNDLE_ICON_FILE "jami.icns"
MACOSX_BUNDLE_GUI_IDENTIFIER "${BUNDLE_ID}"
MACOSX_BUNDLE_BUNDLE_NAME "${PROJ_NAME}"
MACOSX_BUNDLE_SHORT_VERSION_STRING "${JAMI_VERSION}"
MACOSX_BUNDLE_BUNDLE_VERSION "${JAMI_BUILD}"
MACOSX_BUNDLE_COPYRIGHT "${PROJ_COPYRIGHT}"
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/resources/entitlements/Jami.entitlements"
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME TRUE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -DQML_SRC_DIR=${SRC_DIR}
-DMAC_DEPLOY_QT_PATH=${CMAKE_PREFIX_PATH}/bin
-DEXE_NAME="${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app"
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos_qt_deploy.cmake)
endif() endif()
qt_import_qml_plugins(${PROJECT_NAME}) qt_import_qml_plugins(${PROJECT_NAME})
qt_finalize_executable(${PROJECT_NAME}) qt_finalize_executable(${PROJECT_NAME})
......
message("Qt deploying in dir " ${QML_SRC_DIR})
execute_process(COMMAND "${MAC_DEPLOY_QT_PATH}/macdeployqt"
${EXE_NAME}
-qmldir=${QML_SRC_DIR})
<?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>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</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>LSMinimumSystemVersion</key>
<string>10.13</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSApplicationCategoryType</key>
<string>public.app-category.social-networking</string>
<key>LSRequiresCarbon</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
<key>NSCameraUsageDescription</key>
<string>Jami requires to access your camera to make calls and record video</string>
<key>NSMicrophoneUsageDescription</key>
<string>Jami requires to access your microphone to make calls and record audio</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Jami requires to access your photo library to show image on profile and send via chat</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.device.microphone</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
</dict>
</plist>
File added
{
"title": "Jami",
"contents": [
{ "x": 100, "y": 120, "type": "file", "path": "../build-local/Jami.app"},
{ "x": 500, "y": 120, "type": "link", "path": "/Applications" }
],
"window": {
"size" : {"width" : 600, "height" : 300}
}
}
#!/bin/bash
echo ""
cd build-local
/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/Frameworks/AppStoreService.framework/Versions/A/Support/altool --notarize-app -t osx -f Jami.app.zip --primary-bundle-id ${BUNDLE_ID} -u ${APPLE_ACCOUNT} -p ${APPLE_PASSWORD} --output-format xml -itc_provider ${TEAM_ID} > UploadInfo.plist
REQUESTID=$(xmllint --xpath "/plist/dict[key='notarization-upload']/dict/key[.='RequestUUID']/following-sibling::string[1]/node()" UploadInfo.plist)
echo "file uploaded for notarization"
echo ${REQUESTID}
sleep 60
x=1
while [ $x -le 15 ];
do
/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/Frameworks/AppStoreService.framework/Versions/A/Support/altool --notarization-info ${REQUESTID} -u ${APPLE_ACCOUNT} -p ${APPLE_PASSWORD} --output-format xml > RequestedInfo.plist
ANSWER=$(xmllint --xpath "/plist/dict[key='notarization-info']/dict/key[.='Status']/following-sibling::string[1]/node()" RequestedInfo.plist)
if [ "$ANSWER" == "in progress" ];
then
echo "notarization in progress"
sleep 60
x=$(( $x + 1 ))
elif [ "$ANSWER" == "success" ]
then
echo "notarization success"
break
else
echo "notarization failed"
break
exit 1
fi
done
ANSWER=$(xmllint --xpath "/plist/dict[key='notarization-info']/dict/key[.='Status']/following-sibling::string[1]/node()" RequestedInfo.plist)
if [ "$ANSWER" != "success" ];
then
echo "notarization failed"
exit 1
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment