01_install_dependencies.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. ##############################################################################
  3. # macOS dependency management function
  4. ##############################################################################
  5. #
  6. # This script file can be included in build scripts for macOS or run directly.
  7. #
  8. ##############################################################################
  9. # Halt on errors
  10. set -eE
  11. install_dependencies() {
  12. status "Install Homebrew dependencies"
  13. trap "caught_error 'install_dependencies'" ERR
  14. install_homebrew_deps
  15. }
  16. install-dependencies-standalone() {
  17. CHECKOUT_DIR="$(/usr/bin/git rev-parse --show-toplevel)"
  18. PRODUCT_NAME="OBS-Studio"
  19. DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
  20. source "${CHECKOUT_DIR}/CI/include/build_support.sh"
  21. source "${CHECKOUT_DIR}/CI/include/build_support_macos.sh"
  22. status "Setup of OBS build dependencies"
  23. check_macos_version
  24. check_archs
  25. install_dependencies
  26. }
  27. print_usage() {
  28. echo -e "Usage: ${0}\n" \
  29. "-h, --help : Print this help\n" \
  30. "-q, --quiet : Suppress most build process output\n" \
  31. "-v, --verbose : Enable more verbose build process output\n" \
  32. "-a, --architecture : Specify build architecture (default: x86_64, alternative: arm64)\n"
  33. }
  34. install-dependencies-main() {
  35. if [ -z "${_RUN_OBS_BUILD_SCRIPT}" ]; then
  36. while true; do
  37. case "${1}" in
  38. -h | --help ) print_usage; exit 0 ;;
  39. -q | --quiet ) export QUIET=TRUE; shift ;;
  40. -v | --verbose ) export VERBOSE=TRUE; shift ;;
  41. -a | --architecture ) ARCH="${2}"; shift 2 ;;
  42. -- ) shift; break ;;
  43. * ) break ;;
  44. esac
  45. done
  46. install-dependencies-standalone
  47. fi
  48. }
  49. install-dependencies-main $*