Files
IronFox/scripts/build.sh
celenity 5742e99d38 WIP: 152.0
(Also includes some clean-up and tweaks/refinements to the build system)

Signed-off-by: celenity <celenity@celenity.dev>
2026-06-16 04:24:09 +00:00

65 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
# Set-up our environment
if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then
bash -x $(dirname $0)/env.sh
fi
source $(dirname $0)/env.sh
# Include utilities
source "${IRONFOX_UTILS}"
# Set-up target parameters
if [[ -z "${1+x}" ]]; then
echo_red_text "Usage: $0 arm|arm64|x86_64|bundle" >&1
exit 1
fi
readonly target=$(echo "${1}" | "${IRONFOX_AWK}" '{print tolower($0)}')
if [[ -z "${2+x}" ]]; then
readonly project='all'
else
readonly project=$(echo "${2}" | "${IRONFOX_AWK}" '{print tolower($0)}')
fi
# Build IronFox
readonly IRONFOX_FROM_BUILD=1
export IRONFOX_FROM_BUILD
if [[ "${IRONFOX_LOG_BUILD}" == 1 ]]; then
readonly BUILD_LOG_FILE="${IRONFOX_LOG_DIR}/build-${target}.log"
# If the log file already exists, remove it
if [[ -f "${BUILD_LOG_FILE}" ]]; then
rm "${BUILD_LOG_FILE}"
fi
# Ensure our log directory exists
mkdir -vp "${IRONFOX_LOG_DIR}"
bash -x "${IRONFOX_SCRIPTS}/build-if.sh" "${target}" "${project}" > >(tee -a "${BUILD_LOG_FILE}") 2>&1
else
bash -x "${IRONFOX_SCRIPTS}/build-if.sh" "${target}" "${project}"
fi
# Sign IronFox
if [[ "${IRONFOX_SIGN}" == 1 ]] && [[ "${project}" != 'geckoview' ]]; then
if [[ "${IRONFOX_LOG_SIGN}" == 1 ]]; then
readonly SIGN_LOG_FILE="${IRONFOX_LOG_DIR}/sign.log"
# If the log file already exists, remove it
if [[ -f "${SIGN_LOG_FILE}" ]]; then
rm "${SIGN_LOG_FILE}"
fi
# Ensure our log directory exists
mkdir -vp "${IRONFOX_LOG_DIR}"
bash "${IRONFOX_SCRIPTS}/sign.sh" "${target}" > >(tee -a "${SIGN_LOG_FILE}") 2>&1
else
bash "${IRONFOX_SCRIPTS}/sign.sh" "${target}"
fi
fi