pgadmin4/pkg/mac/build.sh

75 lines
2.0 KiB
Bash
Raw Normal View History

2016-06-02 07:56:56 -05:00
#!/bin/bash
# Build script to create Mac App Bundle and DMG for pgAdmin4 runtime
# Exit when any command fails
set -e -E
2016-06-02 07:56:56 -05:00
# Debugging shizz
trap 'ERRCODE=$? && if [ ${ERRCODE} -ne 0 ]; then echo "The command \"${BASH_COMMAND}\" failed in \"${FUNCNAME}\" with exit code ${ERRCODE}."; fi' EXIT
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
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
echo
echo "******************************************************************"
echo "* pkg/mac/codesign.conf not found. NOT signing the binaries."
echo "******************************************************************"
echo
2022-08-10 04:22:06 -05:00
export CODESIGN=0
sleep 2
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
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
sleep 2
else
2022-08-10 08:55:49 -05:00
# shellcheck disable=SC1091
source "${SCRIPT_DIR}/notarization.conf"
fi
2022-08-10 08:55:49 -05:00
if [ "${PGADMIN_POSTGRES_DIR}" == "" ]; 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
2022-08-10 08:55:49 -05:00
if [ "${PGADMIN_PYTHON_VERSION}" == "" ]; then
echo "PGADMIN_PYTHON_VERSION not set. Setting it to the default: 3.11.2"
export PGADMIN_PYTHON_VERSION=3.11.2
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"
_setup_env
2016-06-02 07:56:56 -05:00
_cleanup
_build_runtime
_create_python_env
_build_docs
2016-06-02 07:56:56 -05:00
_complete_bundle
_generate_sbom
_codesign_binaries
_codesign_bundle
2016-06-02 07:56:56 -05:00
_create_dmg
_codesign_dmg
_notarize_pkg