2016-06-02 07:56:56 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Build script to create Mac App Bundle and DMG for pgAdmin4 runtime
|
|
|
|
|
2020-05-18 04:22:59 -05:00
|
|
|
# Exit when any command fails
|
|
|
|
set -e -E
|
2016-06-02 07:56:56 -05:00
|
|
|
|
2020-05-18 04:22:59 -05:00
|
|
|
# Debugging shizz
|
2021-05-04 08:12:13 -05:00
|
|
|
trap 'ERRCODE=$? && if [ ${ERRCODE} -ne 0 ]; then echo "The command \"${BASH_COMMAND}\" failed in \"${FUNCNAME}\" with exit code ${ERRCODE}."; fi' EXIT
|
2020-05-18 04:22:59 -05:00
|
|
|
|
|
|
|
SCRIPT_DIR=$(cd `dirname $0` && pwd)
|
|
|
|
SOURCE_DIR=$(realpath ${SCRIPT_DIR}/../..)
|
|
|
|
BUILD_ROOT=$(realpath ${SCRIPT_DIR}/../..)/mac-build
|
2021-01-29 02:08:27 -06:00
|
|
|
TEMP_DIR=$(realpath ${SCRIPT_DIR}/../..)/mac-temp
|
2020-05-18 04:22:59 -05:00
|
|
|
DIST_ROOT=$(realpath ${SCRIPT_DIR}/../..)/dist
|
|
|
|
|
|
|
|
CODESIGN=1
|
|
|
|
if [ ! -f ${SCRIPT_DIR}/codesign.conf ]; then
|
|
|
|
echo
|
|
|
|
echo "******************************************************************"
|
2021-01-29 02:08:27 -06:00
|
|
|
echo "* pkg/mac/codesign.conf not found. NOT signing the binaries."
|
2020-05-18 04:22:59 -05:00
|
|
|
echo "******************************************************************"
|
|
|
|
echo
|
|
|
|
CODESIGN=0
|
2021-02-02 05:20:18 -06:00
|
|
|
sleep 2
|
2020-05-18 04:22:59 -05:00
|
|
|
else
|
|
|
|
source ${SCRIPT_DIR}/codesign.conf
|
2016-06-02 07:56:56 -05:00
|
|
|
fi
|
|
|
|
|
2021-02-02 05:20:18 -06:00
|
|
|
NOTARIZE=1
|
|
|
|
if [ ! -f ${SCRIPT_DIR}/notarization.conf ]; then
|
|
|
|
echo
|
|
|
|
echo "******************************************************************"
|
|
|
|
echo "* pkg/mac/notarization.conf not found. NOT notarizing the package."
|
|
|
|
echo "******************************************************************"
|
|
|
|
echo
|
|
|
|
NOTARIZE=0
|
|
|
|
sleep 2
|
|
|
|
else
|
|
|
|
source ${SCRIPT_DIR}/notarization.conf
|
|
|
|
fi
|
|
|
|
|
2020-05-18 04:22:59 -05:00
|
|
|
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
|
2016-06-02 07:56:56 -05:00
|
|
|
fi
|
|
|
|
|
2021-01-29 02:08:27 -06:00
|
|
|
if [ "x${PGADMIN_PYTHON_VERSION}" == "x" ]; then
|
2022-02-02 04:59:39 -06:00
|
|
|
echo "PGADMIN_PYTHON_VERSION not set. Setting it to the default: 3.9.9"
|
|
|
|
export PGADMIN_PYTHON_VERSION=3.9.9
|
2021-01-29 02:08:27 -06:00
|
|
|
fi
|
|
|
|
|
2020-05-18 04:22:59 -05:00
|
|
|
source ${SCRIPT_DIR}/build-functions.sh
|
2016-10-04 06:50:16 -05:00
|
|
|
|
2020-05-18 04:22:59 -05:00
|
|
|
_setup_env
|
2016-06-02 07:56:56 -05:00
|
|
|
_cleanup
|
2020-05-18 04:22:59 -05:00
|
|
|
_build_runtime
|
2021-01-29 02:08:27 -06:00
|
|
|
_create_python_env
|
2020-05-18 04:22:59 -05:00
|
|
|
_build_docs
|
2016-06-02 07:56:56 -05:00
|
|
|
_complete_bundle
|
2020-01-03 03:56:45 -06:00
|
|
|
_codesign_binaries
|
2016-10-04 06:50:16 -05:00
|
|
|
_codesign_bundle
|
2016-06-02 07:56:56 -05:00
|
|
|
_create_dmg
|
2017-02-26 03:06:17 -06:00
|
|
|
_codesign_dmg
|
2021-09-01 05:06:37 -05:00
|
|
|
_notarize_pkg
|