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
|
|
|
|
2022-08-10 10:18:19 -05:00
|
|
|
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
|
2022-08-10 08:55:49 -05:00
|
|
|
export SCRIPT_DIR
|
|
|
|
SOURCE_DIR=$(realpath "${SCRIPT_DIR}"/../..)
|
|
|
|
export SOURCE_DIR
|
|
|
|
BUILD_ROOT=$(realpath "${SCRIPT_DIR}"/../..)/mac-build
|
|
|
|
export BUILD_ROOT
|
|
|
|
TEMP_DIR=$(realpath "${SCRIPT_DIR}"/../..)/mac-temp
|
|
|
|
export TEMP_DIR
|
|
|
|
DIST_ROOT=$(realpath "${SCRIPT_DIR}"/../..)/dist
|
|
|
|
export DIST_ROOT
|
2020-05-18 04:22:59 -05:00
|
|
|
|
2022-08-10 04:22:06 -05:00
|
|
|
export CODESIGN=1
|
2022-08-10 08:55:49 -05:00
|
|
|
if [ ! -f "${SCRIPT_DIR}/codesign.conf" ]; then
|
2020-05-18 04:22:59 -05:00
|
|
|
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
|
2022-08-10 04:22:06 -05:00
|
|
|
export CODESIGN=0
|
2021-02-02 05:20:18 -06:00
|
|
|
sleep 2
|
2020-05-18 04:22:59 -05:00
|
|
|
else
|
2022-08-10 08:55:49 -05:00
|
|
|
# shellcheck disable=SC1091
|
|
|
|
source "${SCRIPT_DIR}/codesign.conf"
|
2016-06-02 07:56:56 -05:00
|
|
|
fi
|
|
|
|
|
2022-08-10 04:22:06 -05:00
|
|
|
export NOTARIZE=1
|
2022-08-10 08:55:49 -05:00
|
|
|
if [ ! -f "${SCRIPT_DIR}/notarization.conf" ]; then
|
2021-02-02 05:20:18 -06:00
|
|
|
echo
|
|
|
|
echo "******************************************************************"
|
|
|
|
echo "* pkg/mac/notarization.conf not found. NOT notarizing the package."
|
|
|
|
echo "******************************************************************"
|
|
|
|
echo
|
2022-08-10 04:22:06 -05:00
|
|
|
export NOTARIZE=0
|
2021-02-02 05:20:18 -06:00
|
|
|
sleep 2
|
|
|
|
else
|
2022-08-10 08:55:49 -05:00
|
|
|
# shellcheck disable=SC1091
|
|
|
|
source "${SCRIPT_DIR}/notarization.conf"
|
2021-02-02 05:20:18 -06:00
|
|
|
fi
|
|
|
|
|
2022-08-10 08:55:49 -05:00
|
|
|
if [ "${PGADMIN_POSTGRES_DIR}" == "" ]; then
|
2020-05-18 04:22:59 -05:00
|
|
|
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
|
|
|
|
|
2022-08-10 08:55:49 -05:00
|
|
|
if [ "${PGADMIN_PYTHON_VERSION}" == "" ]; then
|
2023-04-13 05:21:49 -05:00
|
|
|
echo "PGADMIN_PYTHON_VERSION not set. Setting it to the default: 3.11.2"
|
|
|
|
export PGADMIN_PYTHON_VERSION=3.11.2
|
2021-01-29 02:08:27 -06:00
|
|
|
fi
|
|
|
|
|
2022-08-10 10:18:19 -05:00
|
|
|
# shellcheck disable=SC1091
|
2022-08-10 08:55:49 -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
|
2023-08-03 05:38:59 -05:00
|
|
|
_generate_sbom
|
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
|