Reformat Mac deployment script to remove tabs

This commit is contained in:
Daniel Masato 2020-04-23 20:27:33 +01:00
parent 2e2155f492
commit a3271af34b

View file

@ -9,56 +9,56 @@ build_path="${root_path}/build"
deploy_path="${root_path}/deploy" deploy_path="${root_path}/deploy"
cleanup() cleanup()
{ {
# Clean up previous deployments # Clean up previous deployments
rm -rf "${build_path}" rm -rf "${build_path}"
rm -rf "${deploy_path}" rm -rf "${deploy_path}"
mkdir -p "${build_path}" mkdir -p "${build_path}"
mkdir -p "${deploy_path}" mkdir -p "${deploy_path}"
} }
build_app() build_app()
{ {
# Build Jamulus # Build Jamulus
qmake "${project_path}" -o "${build_path}/Makefile" "CONFIG+=release" ${@:2} qmake "${project_path}" -o "${build_path}/Makefile" "CONFIG+=release" ${@:2}
local target_name="$(cat "${build_path}/Makefile" | sed -nE 's/^QMAKE_TARGET *= *(.*)$/\1/p')" local target_name="$(cat "${build_path}/Makefile" | sed -nE 's/^QMAKE_TARGET *= *(.*)$/\1/p')"
local job_count="$(sysctl -n hw.ncpu)" local job_count="$(sysctl -n hw.ncpu)"
make -f "${build_path}/Makefile" -C "${build_path}" -j "${job_count}" make -f "${build_path}/Makefile" -C "${build_path}" -j "${job_count}"
# Add Qt deployment dependencies # Add Qt deployment dependencies
macdeployqt "${build_path}/${target_name}.app" -verbose=2 -always-overwrite macdeployqt "${build_path}/${target_name}.app" -verbose=2 -always-overwrite
mv "${build_path}/${target_name}.app" "${deploy_path}" mv "${build_path}/${target_name}.app" "${deploy_path}"
# Cleanup # Cleanup
make -f "${build_path}/Makefile" -C "${build_path}" distclean make -f "${build_path}/Makefile" -C "${build_path}" distclean
# Return app name for installer image # Return app name for installer image
eval "$1=${target_name}" eval "$1=${target_name}"
} }
build_installer_image() build_installer_image()
{ {
# Install dmgbuild (for the current user), this is required to build the installer image # Install dmgbuild (for the current user), this is required to build the installer image
python -m ensurepip --user --default-pip python -m ensurepip --user --default-pip
python -m pip install --user dmgbuild python -m pip install --user dmgbuild
local dmgbuild_bin="$(python -c 'import site; print(site.USER_BASE)')/bin/dmgbuild" local dmgbuild_bin="$(python -c 'import site; print(site.USER_BASE)')/bin/dmgbuild"
# Get Jamulus version # Get Jamulus version
local app_version="$(cat "${project_path}" | sed -nE 's/^VERSION *= *(.*)$/\1/p')" local app_version="$(cat "${project_path}" | sed -nE 's/^VERSION *= *(.*)$/\1/p')"
# Build installer image # Build installer image
"${dmgbuild_bin}" -s "${macdeploy_path}/deployment_settings.py" -D background="${resources_path}/installerbackground.png" \ "${dmgbuild_bin}" -s "${macdeploy_path}/deployment_settings.py" -D background="${resources_path}/installerbackground.png" \
-D app_path="${deploy_path}/$1.app" -D server_path="${deploy_path}/$2.app" \ -D app_path="${deploy_path}/$1.app" -D server_path="${deploy_path}/$2.app" \
-D license="${root_path}/COPYING" "$1 Installer" "${deploy_path}/$1-${app_version}-installer-mac.dmg" -D license="${root_path}/COPYING" "$1 Installer" "${deploy_path}/$1-${app_version}-installer-mac.dmg"
} }
# Check that we are running from the correct location # Check that we are running from the correct location
if [ ! -f "${project_path}" ]; if [ ! -f "${project_path}" ];
then then
echo Please run this script from the Qt project directory where "$(basename ${project_path})" is located. echo Please run this script from the Qt project directory where "$(basename ${project_path})" is located.
echo Usage: mac/$(basename $0) echo Usage: mac/$(basename $0)