mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-21 04:37:09 +08:00
61 lines
1.9 KiB
Bash
Executable File
61 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
##############################################################################
|
|
# macOS dependency management function
|
|
##############################################################################
|
|
#
|
|
# This script file can be included in build scripts for macOS or run directly.
|
|
#
|
|
##############################################################################
|
|
|
|
# Halt on errors
|
|
set -eE
|
|
|
|
install_dependencies() {
|
|
status "Install Homebrew dependencies"
|
|
trap "caught_error 'install_dependencies'" ERR
|
|
|
|
install_homebrew_deps
|
|
|
|
}
|
|
|
|
install-dependencies-standalone() {
|
|
CHECKOUT_DIR="$(/usr/bin/git rev-parse --show-toplevel)"
|
|
PRODUCT_NAME="OBS-Studio"
|
|
DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
|
|
source "${CHECKOUT_DIR}/CI/include/build_support.sh"
|
|
source "${CHECKOUT_DIR}/CI/include/build_support_macos.sh"
|
|
|
|
status "Setup of OBS build dependencies"
|
|
check_macos_version
|
|
check_archs
|
|
install_dependencies
|
|
}
|
|
|
|
print_usage() {
|
|
echo -e "Usage: ${0}\n" \
|
|
"-h, --help : Print this help\n" \
|
|
"-q, --quiet : Suppress most build process output\n" \
|
|
"-v, --verbose : Enable more verbose build process output\n" \
|
|
"-a, --architecture : Specify build architecture (default: x86_64, alternative: arm64)\n"
|
|
}
|
|
|
|
install-dependencies-main() {
|
|
if [ -z "${_RUN_OBS_BUILD_SCRIPT}" ]; then
|
|
while true; do
|
|
case "${1}" in
|
|
-h | --help ) print_usage; exit 0 ;;
|
|
-q | --quiet ) export QUIET=TRUE; shift ;;
|
|
-v | --verbose ) export VERBOSE=TRUE; shift ;;
|
|
-a | --architecture ) ARCH="${2}"; shift 2 ;;
|
|
-- ) shift; break ;;
|
|
* ) break ;;
|
|
esac
|
|
done
|
|
|
|
install-dependencies-standalone
|
|
fi
|
|
}
|
|
|
|
install-dependencies-main $*
|