01_install_dependencies.sh 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #!/usr/bin/env bash
  2. ##############################################################################
  3. # FreeBSD dependency management function
  4. ##############################################################################
  5. #
  6. # This script file can be included in build scripts or run directly
  7. #
  8. ##############################################################################
  9. # Halt on errors
  10. set -eE
  11. install_build-deps() {
  12. shift
  13. status "Install OBS build dependencies"
  14. trap "caught_error 'install_build-deps'" ERR
  15. sudo pkg install -U -y $@
  16. }
  17. install_obs-deps() {
  18. shift
  19. status "Install OBS dependencies"
  20. trap "caught_error 'install_obs-deps'" ERR
  21. if [ -z "${DISABLE_PIPEWIRE}" ]; then
  22. sudo pkg install -U -y $@ pipewire
  23. else
  24. sudo pkg install -U -y $@
  25. fi
  26. }
  27. install_qt-deps() {
  28. shift
  29. status "Install Qt dependencies"
  30. trap "caught_error 'install_qt-deps'" ERR
  31. sudo pkg install -U -y $@
  32. }
  33. install_plugin-deps() {
  34. shift
  35. status "Install plugin dependencies"
  36. trap "caught_error 'install_plugin-deps'" ERR
  37. sudo pkg install -U -y $@
  38. }
  39. install_dependencies() {
  40. status "Set up apt"
  41. trap "caught_error 'install_dependencies'" ERR
  42. BUILD_DEPS=(
  43. "build-deps cmake ninja pkgconf curl ccache"
  44. "obs-deps ffmpeg libx264 mbedtls mesa-libs jansson lua52 luajit python37 libX11 xorgproto libxcb \
  45. libXcomposite libXext libXfixes libXinerama libXrandr swig dbus jansson libICE libSM libsysinfo"
  46. "qt-deps qt5-buildtools qt5-qmake qt5-imageformats qt5-core qt5-gui qt5-svg qt5-widgets qt5-xml"
  47. "plugin-deps v4l_compat fdk-aac fontconfig freetype2 speexdsp libudev-devd libv4l vlc audio/jack pulseaudio sndio"
  48. )
  49. for DEPENDENCY in "${BUILD_DEPS[@]}"; do
  50. set -- ${DEPENDENCY}
  51. trap "caught_error ${DEPENDENCY}" ERR
  52. FUNC_NAME="install_${1}"
  53. ${FUNC_NAME} ${@}
  54. done
  55. }
  56. install-dependencies-standalone() {
  57. CHECKOUT_DIR="$(git rev-parse --show-toplevel)"
  58. PRODUCT_NAME="OBS-Studio"
  59. DEPS_BUILD_DIR="${CHECKOUT_DIR}/../obs-build-dependencies"
  60. source "${CHECKOUT_DIR}/CI/include/build_support.sh"
  61. source "${CHECKOUT_DIR}/CI/include/build_support_freebsd.sh"
  62. status "Setup of OBS build dependencies"
  63. install_dependencies
  64. }
  65. print_usage() {
  66. echo -e "Usage: ${0}\n" \
  67. "-h, --help : Print this help\n" \
  68. "-q, --quiet : Suppress most build process output\n" \
  69. "-v, --verbose : Enable more verbose build process output\n"
  70. "--disable-pipewire : Disable building with PipeWire support (default: off)\n"
  71. }
  72. install-dependencies-main() {
  73. if [ -z "${_RUN_OBS_BUILD_SCRIPT}" ]; then
  74. while true; do
  75. case "${1}" in
  76. -h | --help ) print_usage; exit 0 ;;
  77. -q | --quiet ) export QUIET=TRUE; shift ;;
  78. -v | --verbose ) export VERBOSE=TRUE; shift ;;
  79. --disable-pipewire ) DISABLE_PIPEWIRE=TRUE; shift ;;
  80. -- ) shift; break ;;
  81. * ) break ;;
  82. esac
  83. done
  84. install-dependencies-standalone
  85. fi
  86. }
  87. install-dependencies-main $*