mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(build): correct macOS deployment
This commit is contained in:
parent
5c5dce4d33
commit
8912e9e016
|
@ -5,8 +5,6 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
if(APPLE)
|
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
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/osx/info.plist")
|
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)
|
execute_process(COMMAND ${MACDEPLOYQT_PATH}/macdeployqt ${BUNDLE_PATH} -no-strip)
|
||||||
message(STATUS \"Updating library paths\")
|
message(STATUS \"Updating library paths\")
|
||||||
execute_process(COMMAND ${CMAKE_SOURCE_DIR}/osx/macfixrpath ${BUNDLE_PATH})
|
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\")
|
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
|
" COMPONENT Runtime
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
|
|
BIN
osx/DS_Store-DMG
BIN
osx/DS_Store-DMG
Binary file not shown.
36
osx/createdmg
Executable file
36
osx/createdmg
Executable file
|
@ -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"
|
213
osx/info.plist
213
osx/info.plist
|
@ -1,112 +1,113 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSPrincipalClass</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>NSApplication</string>
|
<string>qTox</string>
|
||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleDocumentTypes</key>
|
||||||
<string>qtox.icns</string>
|
<array>
|
||||||
<key>CFBundlePackageType</key>
|
<dict>
|
||||||
<string>APPL</string>
|
<key>CFBundleTypeExtensions</key>
|
||||||
<key>CFBundleSignature</key>
|
<array>
|
||||||
<string>toxq</string>
|
<string>tox</string>
|
||||||
<key>CFBundleExecutable</key>
|
</array>
|
||||||
<string>qtox</string>
|
<key>CFBundleTypeIconFile</key>
|
||||||
<key>CFBundleDisplayName</key>
|
<string>qtox_profile</string>
|
||||||
<string>qTox</string>
|
<key>CFBundleTypeMIMETypes</key>
|
||||||
<key>CFBundleName</key>
|
<array>
|
||||||
<string>qTox</string>
|
<string>application/x-tox.profile</string>
|
||||||
<key>CFBundleVersion</key>
|
</array>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleTypeName</key>
|
||||||
<string>@SHORT_VERSION@</string>
|
<string>Tox profile</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleTypeRole</key>
|
||||||
<string>chat.tox.qtox</string>
|
<string>Editor</string>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>LSHandlerRank</key>
|
||||||
<array>
|
<string>Owner</string>
|
||||||
<dict>
|
<key>LSItemContentTypes</key>
|
||||||
<key>CFBundleURLName</key>
|
<array>
|
||||||
<string>Tox URL</string>
|
|
||||||
<key>CFBundleTypeRole</key>
|
|
||||||
<string>Viewer</string>
|
|
||||||
<key>CFBundleURLSchemes</key>
|
|
||||||
<array>
|
|
||||||
<string>tox</string>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleURLIconFile</key>
|
|
||||||
<string>qtox_profile</string>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleDocumentTypes</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleTypeExtensions</key>
|
|
||||||
<array>
|
|
||||||
<string>tox</string>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleTypeName</key>
|
|
||||||
<string>Tox profile</string>
|
|
||||||
<key>CFBundleTypeRole</key>
|
|
||||||
<string>Editor</string>
|
|
||||||
<key>CFBundleTypeIconFile</key>
|
|
||||||
<string>qtox_profile</string>
|
|
||||||
<key>CFBundleTypeMIMETypes</key>
|
|
||||||
<array>
|
|
||||||
<string>application/x-tox.profile</string>
|
|
||||||
</array>
|
|
||||||
<key>LSHandlerRank</key>
|
|
||||||
<string>Owner</string>
|
|
||||||
<key>LSItemContentTypes</key>
|
|
||||||
<array>
|
|
||||||
<string>public.tox</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>UTImportedTypeDeclarations</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>UTTypeConformsTo</key>
|
|
||||||
<array>
|
|
||||||
<string>public.data</string>
|
|
||||||
</array>
|
|
||||||
<key>UTTypeIdentifier</key>
|
|
||||||
<string>public.tox</string>
|
<string>public.tox</string>
|
||||||
<key>UTTypeTagSpecification</key>
|
</array>
|
||||||
<dict>
|
</dict>
|
||||||
<key>com.apple.ostype</key>
|
</array>
|
||||||
<string>TOX</string>
|
<key>CFBundleExecutable</key>
|
||||||
<key>public.filename-extension</key>
|
<string>qtox</string>
|
||||||
<array>
|
<key>CFBundleIconFile</key>
|
||||||
<string>tox</string>
|
<string>qtox.icns</string>
|
||||||
</array>
|
<key>CFBundleIdentifier</key>
|
||||||
<key>public.mime-type</key>
|
<string>chat.tox.qtox</string>
|
||||||
<string>tox/x-profile</string>
|
<key>CFBundleLocalizations</key>
|
||||||
</dict>
|
<array>
|
||||||
|
<string>en_US</string>
|
||||||
|
<string>bg_BG</string>
|
||||||
|
<string>cs</string>
|
||||||
|
<string>de_DE</string>
|
||||||
|
<string>el</string>
|
||||||
|
<string>es_MX</string>
|
||||||
|
<string>fi_FI</string>
|
||||||
|
<string>fr_FR</string>
|
||||||
|
<string>hr_HR</string>
|
||||||
|
<string>hu_HU</string>
|
||||||
|
<string>it_IT</string>
|
||||||
|
<string>lt_LT</string>
|
||||||
|
<string>nl_NL</string>
|
||||||
|
<string>nb_NO</string>
|
||||||
|
<string>pl_PL</string>
|
||||||
|
<string>pt_BR</string>
|
||||||
|
<string>ru_RU</string>
|
||||||
|
<string>sl</string>
|
||||||
|
<string>sv</string>
|
||||||
|
<string>tr_TR</string>
|
||||||
|
<string>uk_UA</string>
|
||||||
|
<string>zh_CH</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>qTox</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.7.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>toxq</string>
|
||||||
|
<key>CFBundleURLTypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
<key>CFBundleURLIconFile</key>
|
||||||
|
<string>qtox_profile</string>
|
||||||
|
<key>CFBundleURLName</key>
|
||||||
|
<string>Tox URL</string>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>tox</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1.7.0</string>
|
||||||
|
<key>NSPrincipalClass</key>
|
||||||
|
<string>NSApplication</string>
|
||||||
|
<key>UTImportedTypeDeclarations</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>UTTypeConformsTo</key>
|
||||||
|
<array>
|
||||||
|
<string>public.data</string>
|
||||||
|
</array>
|
||||||
|
<key>UTTypeIdentifier</key>
|
||||||
|
<string>public.tox</string>
|
||||||
|
<key>UTTypeTagSpecification</key>
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.ostype</key>
|
||||||
|
<string>TOX</string>
|
||||||
|
<key>public.filename-extension</key>
|
||||||
|
<array>
|
||||||
|
<string>tox</string>
|
||||||
|
</array>
|
||||||
|
<key>public.mime-type</key>
|
||||||
|
<string>tox/x-profile</string>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</dict>
|
||||||
<key>CFBundleLocalizations</key>
|
</array>
|
||||||
<array>
|
</dict>
|
||||||
<string>en_US</string>
|
|
||||||
<string>bg_BG</string>
|
|
||||||
<string>cs</string>
|
|
||||||
<string>de_DE</string>
|
|
||||||
<string>el</string>
|
|
||||||
<string>es_MX</string>
|
|
||||||
<string>fi_FI</string>
|
|
||||||
<string>fr_FR</string>
|
|
||||||
<string>hr_HR</string>
|
|
||||||
<string>hu_HU</string>
|
|
||||||
<string>it_IT</string>
|
|
||||||
<string>lt_LT</string>
|
|
||||||
<string>nl_NL</string>
|
|
||||||
<string>nb_NO</string>
|
|
||||||
<string>pl_PL</string>
|
|
||||||
<string>pt_BR</string>
|
|
||||||
<string>ru_RU</string>
|
|
||||||
<string>sl</string>
|
|
||||||
<string>sv</string>
|
|
||||||
<string>tr_TR</string>
|
|
||||||
<string>uk_UA</string>
|
|
||||||
<string>zh_CH</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
@ -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_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]}"
|
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
|
TOXCORE_DIR="${MAIN_DIR}/toxcore" # Change to Git location
|
||||||
|
|
||||||
LIB_INSTALL_PREFIX="${QTOX_DIR}/libs"
|
LIB_INSTALL_PREFIX="${QTOX_DIR}/libs"
|
||||||
|
@ -52,7 +50,6 @@ LIB_INSTALL_PREFIX="${QTOX_DIR}/libs"
|
||||||
BUILD_DIR="${MAIN_DIR}/qTox-Mac_Build${SUBGIT}"
|
BUILD_DIR="${MAIN_DIR}/qTox-Mac_Build${SUBGIT}"
|
||||||
DEPLOY_DIR="${MAIN_DIR}/qTox-Mac_Deployed${SUBGIT}"
|
DEPLOY_DIR="${MAIN_DIR}/qTox-Mac_Deployed${SUBGIT}"
|
||||||
|
|
||||||
|
|
||||||
# helper function to "pretty-print"
|
# helper function to "pretty-print"
|
||||||
fcho() {
|
fcho() {
|
||||||
local msg="$1"; shift
|
local msg="$1"; shift
|
||||||
|
@ -114,7 +111,7 @@ install() {
|
||||||
if [[ $TRAVIS != true ]]
|
if [[ $TRAVIS != true ]]
|
||||||
then
|
then
|
||||||
sleep 3
|
sleep 3
|
||||||
brew install git wget libtool autoconf automake
|
brew install git wget libtool autoconf automake pkgconfig
|
||||||
fi
|
fi
|
||||||
brew install check libvpx opus libsodium
|
brew install check libvpx opus libsodium
|
||||||
|
|
||||||
|
@ -243,10 +240,8 @@ deploy() {
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
mkdir $DEPLOY_DIR
|
mkdir $DEPLOY_DIR
|
||||||
|
make install
|
||||||
cp -r $BUILD_DIR/qTox.app $DEPLOY_DIR/qTox.app
|
cp -r $BUILD_DIR/qTox.app $DEPLOY_DIR/qTox.app
|
||||||
cd $DEPLOY_DIR
|
|
||||||
fcho "Now working in ${PWD}"
|
|
||||||
$MACDEPLOYQT qTox.app
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bootstrap() {
|
bootstrap() {
|
||||||
|
@ -265,14 +260,7 @@ bootstrap() {
|
||||||
dmgmake() {
|
dmgmake() {
|
||||||
fcho "------------------------------"
|
fcho "------------------------------"
|
||||||
fcho "Starting DMG creation"
|
fcho "Starting DMG creation"
|
||||||
cd $DEPLOY_DIR
|
cp $BUILD_DIR/qTox.dmg $QTOX_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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
helpme() {
|
helpme() {
|
||||||
|
|
|
@ -35,17 +35,11 @@ set -eu -o pipefail
|
||||||
# uses `get_version()`
|
# uses `get_version()`
|
||||||
source "../tools/lib/git.source"
|
source "../tools/lib/git.source"
|
||||||
|
|
||||||
|
|
||||||
# append version to .plist file(s) after the right line
|
# append version to .plist file(s) after the right line
|
||||||
append_version() {
|
update_version() {
|
||||||
local after_line=' <key>CFBundleVersion'
|
ver=$(get_version)
|
||||||
local append=" <string>$(get_version)<\/string>"
|
defaults write "$(pwd)/info.plist" CFBundleVersion $ver
|
||||||
|
defaults write "$(pwd)/info.plist" CFBundleShortVersionString $ver
|
||||||
for plist in *.plist
|
plutil -convert xml1 info.plist
|
||||||
do
|
|
||||||
git checkout "$plist"
|
|
||||||
sed -i"" -e "/$after_line/a\\
|
|
||||||
$append" "$plist"
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
append_version
|
update_version
|
||||||
|
|
Loading…
Reference in New Issue
Block a user