diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c9bec7d80777cbfe20603429b32fd5478991a8e..489d9bd54e371a542add33157cd8e384024a652b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,10 @@ cmake_minimum_required(VERSION 3.11) -project(jami-qt) +if (APPLE) + project(Jami) +else() + project(jami-qt) +endif() if(MSVC) cmake_minimum_required(VERSION 3.15) @@ -389,6 +393,9 @@ else() find_library(ringclient ringclient ${LRCLIBDIR} NO_DEFAULT_PATH) 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() # Qt find package @@ -607,6 +614,7 @@ elseif (NOT APPLE) add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) else() + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/resources/images/jami.icns) target_link_libraries(${PROJECT_NAME} PRIVATE ${QML_LIBS} ${LRC_LIB_NAME} @@ -634,9 +642,25 @@ else() install(DIRECTORY "${CMAKE_BINARY_DIR}/share/libringclient/translations/" DESTINATION ${CMAKE_INSTALL_PREFIX}/share/libringclient/translations) 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() - qt_import_qml_plugins(${PROJECT_NAME}) qt_finalize_executable(${PROJECT_NAME}) diff --git a/cmake/macos_qt_deploy.cmake b/cmake/macos_qt_deploy.cmake new file mode 100644 index 0000000000000000000000000000000000000000..5af95104075a54a29b29ac93e3319b7b5c61bb85 --- /dev/null +++ b/cmake/macos_qt_deploy.cmake @@ -0,0 +1,5 @@ + + message("Qt deploying in dir " ${QML_SRC_DIR}) + execute_process(COMMAND "${MAC_DEPLOY_QT_PATH}/macdeployqt" + ${EXE_NAME} + -qmldir=${QML_SRC_DIR}) diff --git a/resources/Info.plist b/resources/Info.plist new file mode 100644 index 0000000000000000000000000000000000000000..9ae6f7a74edef92d16c198cbc4c74a36baddcbd1 --- /dev/null +++ b/resources/Info.plist @@ -0,0 +1,40 @@ +<?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> diff --git a/resources/entitlements/Jami.entitlements b/resources/entitlements/Jami.entitlements new file mode 100644 index 0000000000000000000000000000000000000000..725c1ee5f55b97ead546c348e16b28a34a1d864e --- /dev/null +++ b/resources/entitlements/Jami.entitlements @@ -0,0 +1,14 @@ +<?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> diff --git a/resources/images/jami.icns b/resources/images/jami.icns new file mode 100644 index 0000000000000000000000000000000000000000..8e06b71450457676b3a1175022d1fa41fabe0a0a Binary files /dev/null and b/resources/images/jami.icns differ diff --git a/scripts/generateDMG.json b/scripts/generateDMG.json new file mode 100644 index 0000000000000000000000000000000000000000..f7d4ac6e8ab0790333dab5d79e1f4a8d3ed4189d --- /dev/null +++ b/scripts/generateDMG.json @@ -0,0 +1,10 @@ +{ + "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} + } +} diff --git a/scripts/notarize.sh b/scripts/notarize.sh new file mode 100755 index 0000000000000000000000000000000000000000..0fa3fb661fdaa2dfc5f4ffec77a1d7cd3925afe1 --- /dev/null +++ b/scripts/notarize.sh @@ -0,0 +1,35 @@ +#!/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