#!/bin/bash # Build script to create Mac App Bundle and DMG for pgAdmin4 runtime # Exit when any command fails set -e -E # Debugging shizz trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG trap 'if [ $? -ne 0 ]; then echo "\"${last_command}\" command filed with exit code $?."; fi' EXIT SCRIPT_DIR=$(cd `dirname $0` && pwd) SOURCE_DIR=$(realpath ${SCRIPT_DIR}/../..) BUILD_ROOT=$(realpath ${SCRIPT_DIR}/../..)/mac-build TEMP_DIR=$(realpath ${SCRIPT_DIR}/../..)/mac-temp DIST_ROOT=$(realpath ${SCRIPT_DIR}/../..)/dist CODESIGN=1 if [ ! -f ${SCRIPT_DIR}/codesign.conf ]; then echo echo "******************************************************************" echo "* pkg/mac/codesign.conf not found. NOT signing the binaries." echo "******************************************************************" echo CODESIGN=0 sleep 5 else source ${SCRIPT_DIR}/codesign.conf fi if [ "x${PGADMIN_POSTGRES_DIR}" == "x" ]; then echo "PGADMIN_POSTGRES_DIR not set. Setting it to the default: /usr/local/pgsql" export PGADMIN_POSTGRES_DIR=/usr/local/pgsql fi if [ "x${PGADMIN_PYTHON_VERSION}" == "x" ]; then echo "PGADMIN_PYTHON_VERSION not set. Setting it to the default: 3.9.0" export PGADMIN_PYTHON_VERSION=3.9.0 fi source ${SCRIPT_DIR}/build-functions.sh _setup_env _cleanup _build_runtime _create_python_env _build_docs _complete_bundle _codesign_binaries _codesign_bundle _create_dmg _codesign_dmg