diff --git a/cmake/Installation.cmake b/cmake/Installation.cmake index 24fe0d787..1a52c08bf 100644 --- a/cmake/Installation.cmake +++ b/cmake/Installation.cmake @@ -5,8 +5,6 @@ ################################################################################ if(APPLE) - set(MACOSX_BUNDLE_SHORT_VERSION_STRING 1.4.1) - set(SHORT_VERSION ${MACOSX_BUNDLE_SHORT_VERSION_STRING}) set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/osx/info.plist") @@ -22,8 +20,15 @@ if(APPLE) execute_process(COMMAND ${MACDEPLOYQT_PATH}/macdeployqt ${BUNDLE_PATH} -no-strip) message(STATUS \"Updating library paths\") execute_process(COMMAND ${CMAKE_SOURCE_DIR}/osx/macfixrpath ${BUNDLE_PATH}) + " COMPONENT Runtime + ) + + install(FILES img/icons/qtox.icns DESTINATION ${BUNDLE_PATH}/Contents/Resources/) + install(FILES img/icons/qtox_profile.icns DESTINATION ${BUNDLE_PATH}/Contents/Resources/) + + install(CODE " message(STATUS \"Creating dmg image\") - execute_process(COMMAND hdiutil create -volname ${PROJECT_NAME} -srcfolder ${BUNDLE_PATH} -ov -format UDZO ${PROJECT_NAME}.dmg) + execute_process(COMMAND ${CMAKE_SOURCE_DIR}/osx/createdmg ${CMAKE_SOURCE_DIR} ${BUNDLE_PATH}) " COMPONENT Runtime ) else() diff --git a/osx/DS_Store-DMG b/osx/DS_Store-DMG index 5351701a2..5785953b2 100644 Binary files a/osx/DS_Store-DMG and b/osx/DS_Store-DMG differ diff --git a/osx/createdmg b/osx/createdmg new file mode 100755 index 000000000..6f1829eb1 --- /dev/null +++ b/osx/createdmg @@ -0,0 +1,36 @@ +#!/bin/bash + +QTOX_DIR="$1" + +pushd "$2" &> /dev/null +BUNDLE_PATH="$(pwd)" +popd &>/dev/null + +pushd "$BUNDLE_PATH/../" &> /dev/null +BUILD_DIR="$(pwd)" +popd &>/dev/null + +DMG_DIR="$BUILD_DIR/dmg.tmp" +APP_VER=$(defaults read "$BUNDLE_PATH/Contents/Info.plist" CFBundleVersion) + +if [ ! -d "$BUNDLE_PATH" ]; then + echo "Please pass path to qTox.app as an argument!" + exit 1 +fi + +rm -rf "$DMG_DIR" +rm -f "$BUILD_DIR/qTox.dmg" +mkdir "$DMG_DIR" +cp -r "$BUNDLE_PATH" "$DMG_DIR/" + +pushd "$DMG_DIR" &> /dev/null +ln -s /Applications "./Install to Applications" +mkdir .background +cp -f $QTOX_DIR/osx/background-DMG/qTox-DMG-bak.tiff .background/backgroundImage.tiff +cp -f $QTOX_DIR/osx/DS_Store-DMG ./.DS_Store +cp -f $QTOX_DIR/LICENSE ./LICENSE +cp -f $QTOX_DIR/README.md ./README.md + +popd &>/dev/null + +hdiutil create -volname "qTox $APP_VER" -srcfolder "$DMG_DIR/" -format UDZO "$BUILD_DIR/qTox.dmg" diff --git a/osx/info.plist b/osx/info.plist index 7a9c70820..123c794ce 100644 --- a/osx/info.plist +++ b/osx/info.plist @@ -1,112 +1,113 @@ - - NSPrincipalClass - NSApplication - CFBundleIconFile - qtox.icns - CFBundlePackageType - APPL - CFBundleSignature - toxq - CFBundleExecutable - qtox - CFBundleDisplayName - qTox - CFBundleName - qTox - CFBundleVersion - CFBundleShortVersionString - @SHORT_VERSION@ - CFBundleIdentifier - chat.tox.qtox - CFBundleURLTypes - - - CFBundleURLName - Tox URL - CFBundleTypeRole - Viewer - CFBundleURLSchemes - - tox - - CFBundleURLIconFile - qtox_profile - - - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - tox - - CFBundleTypeName - Tox profile - CFBundleTypeRole - Editor - CFBundleTypeIconFile - qtox_profile - CFBundleTypeMIMETypes - - application/x-tox.profile - - LSHandlerRank - Owner - LSItemContentTypes - - public.tox - - - - UTImportedTypeDeclarations - - - UTTypeConformsTo - - public.data - - UTTypeIdentifier + + CFBundleDisplayName + qTox + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + tox + + CFBundleTypeIconFile + qtox_profile + CFBundleTypeMIMETypes + + application/x-tox.profile + + CFBundleTypeName + Tox profile + CFBundleTypeRole + Editor + LSHandlerRank + Owner + LSItemContentTypes + public.tox - UTTypeTagSpecification - - com.apple.ostype - TOX - public.filename-extension - - tox - - public.mime-type - tox/x-profile - + + + + CFBundleExecutable + qtox + CFBundleIconFile + qtox.icns + CFBundleIdentifier + chat.tox.qtox + CFBundleLocalizations + + en_US + bg_BG + cs + de_DE + el + es_MX + fi_FI + fr_FR + hr_HR + hu_HU + it_IT + lt_LT + nl_NL + nb_NO + pl_PL + pt_BR + ru_RU + sl + sv + tr_TR + uk_UA + zh_CH + + CFBundleName + qTox + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.7.0 + CFBundleSignature + toxq + CFBundleURLTypes + + + CFBundleTypeRole + Viewer + CFBundleURLIconFile + qtox_profile + CFBundleURLName + Tox URL + CFBundleURLSchemes + + tox + + + + CFBundleVersion + 1.7.0 + NSPrincipalClass + NSApplication + UTImportedTypeDeclarations + + + UTTypeConformsTo + + public.data + + UTTypeIdentifier + public.tox + UTTypeTagSpecification + + com.apple.ostype + TOX + public.filename-extension + + tox + + public.mime-type + tox/x-profile - - CFBundleLocalizations - - en_US - bg_BG - cs - de_DE - el - es_MX - fi_FI - fr_FR - hr_HR - hu_HU - it_IT - lt_LT - nl_NL - nb_NO - pl_PL - pt_BR - ru_RU - sl - sv - tr_TR - uk_UA - zh_CH - - + + + diff --git a/osx/qTox-Mac-Deployer-ULTIMATE.sh b/osx/qTox-Mac-Deployer-ULTIMATE.sh index d599b4ab3..5a41cf0ff 100755 --- a/osx/qTox-Mac-Deployer-ULTIMATE.sh +++ b/osx/qTox-Mac-Deployer-ULTIMATE.sh @@ -40,8 +40,6 @@ QT_DIR="/usr/local/Cellar/qt5" # Folder name of QT install QT_VER=($(ls ${QT_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1p;$p')) QT_DIR_VER="${QT_DIR}/${QT_VER[1]}" -MACDEPLOYQT="${QT_DIR_VER}/bin/macdeployqt" # Don't change - TOXCORE_DIR="${MAIN_DIR}/toxcore" # Change to Git location LIB_INSTALL_PREFIX="${QTOX_DIR}/libs" @@ -52,7 +50,6 @@ LIB_INSTALL_PREFIX="${QTOX_DIR}/libs" BUILD_DIR="${MAIN_DIR}/qTox-Mac_Build${SUBGIT}" DEPLOY_DIR="${MAIN_DIR}/qTox-Mac_Deployed${SUBGIT}" - # helper function to "pretty-print" fcho() { local msg="$1"; shift @@ -114,7 +111,7 @@ install() { if [[ $TRAVIS != true ]] then sleep 3 - brew install git wget libtool autoconf automake + brew install git wget libtool autoconf automake pkgconfig fi brew install check libvpx opus libsodium @@ -243,10 +240,8 @@ deploy() { exit 0 fi mkdir $DEPLOY_DIR + make install cp -r $BUILD_DIR/qTox.app $DEPLOY_DIR/qTox.app - cd $DEPLOY_DIR - fcho "Now working in ${PWD}" - $MACDEPLOYQT qTox.app } bootstrap() { @@ -265,14 +260,7 @@ bootstrap() { dmgmake() { fcho "------------------------------" fcho "Starting DMG creation" - cd $DEPLOY_DIR - ln -s /Applications "./Install to Applications" - cp -r -f $QTOX_DIR/osx/background-DMG ./.background - cp -f $QTOX_DIR/osx/DS_Store-DMG ./.DS_Store - cp -f $QTOX_DIR/LICENSE ./LICENSE - cp -f $QTOX_DIR/README.md ./README.md - cd $QTOX_DIR - hdiutil create -volname qTox${SUBGIT} -srcfolder $DEPLOY_DIR -format UDZO qTox${SUBGIT}.dmg + cp $BUILD_DIR/qTox.dmg $QTOX_DIR/ } helpme() { diff --git a/osx/update-plist-version.sh b/osx/update-plist-version.sh index e7f5d0d98..b031bf2c5 100755 --- a/osx/update-plist-version.sh +++ b/osx/update-plist-version.sh @@ -35,17 +35,11 @@ set -eu -o pipefail # uses `get_version()` source "../tools/lib/git.source" - # append version to .plist file(s) after the right line -append_version() { - local after_line=' CFBundleVersion' - local append=" $(get_version)<\/string>" - - for plist in *.plist - do - git checkout "$plist" - sed -i"" -e "/$after_line/a\\ -$append" "$plist" - done +update_version() { + ver=$(get_version) + defaults write "$(pwd)/info.plist" CFBundleVersion $ver + defaults write "$(pwd)/info.plist" CFBundleShortVersionString $ver + plutil -convert xml1 info.plist } -append_version +update_version