The script(s) in this repository are used to deploy and package BesLyric-for-X on macOS.
macOS 10.14 and 10.15
These tools are required to complete the work:
- Bash 3
- macdeployqt (from Qt)
If you want to create a fancy DMG with create-dmg, ImageMagick is also required since the background image will be generated on the fly:
- create-dmg
- ImageMagick 7
$ git clone https://github.com/BesLyric-for-X/BesLyric-for-X_macOS_deploy-package.git
macdeployqt
cannot handle 3rd party libraries correctly, so there is some additional work needs to be done by our scripts.
MACDEPLOYQT_PATH='path/to/macdeployqt' \
APP_FILE_PATH='path/to/app_bundle.app' \
bash macdeployqt_enhanced.sh
Create a normal DMG:
APP_FILE_PATH='path/to/app_bundle.app' \
OUTPUT_DMG_PATH='path/to/generated.dmg' \
bash package_hdiutil.sh
Or, a fancy one:
IMAGEMAGICK_PATH='path/to/magick' \
CREATE_DMG_PATH='path/to/create-dmg' \
APP_FILE_PATH='path/to/app_bundle.app' \
ICON_FILE_PATH='path/to/icon.icns' \
OUTPUT_DMG_PATH='path/to/generated.dmg' \
bash package_cdmg.sh
Source: Writing Safe Shell Scripts
set -e # Checking tons of $? is painful
set -o pipefail # Error will not disappear in the pipeline
set -u # Detect unbound variables
Removed.
Source: macos - Bash script absolute path with OS X - Stack Overflow § comment64141768_3572030
script_dir_path="$( cd "$( dirname "$0" )"; pwd -P )"
Source: hdiutil Man Page - macOS - SS64.com
hdiutil create \
... \
-format UDZO \
-imagekey zlib-level=9
Projects: