install-dependencies-macos.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/sh
  2. OSTYPE=$(uname)
  3. if [ "${OSTYPE}" != "Darwin" ]; then
  4. echo "[Error] macOS install dependencies script can be run on Darwin-type OS only."
  5. exit 1
  6. fi
  7. HAS_BREW=$(type brew 2>/dev/null)
  8. if [ "${HAS_BREW}" = "" ]; then
  9. echo "[Error] Please install Homebrew (https://www.brew.sh/) to build this plugin on macOS."
  10. exit 1
  11. fi
  12. # OBS Studio deps
  13. echo "=> Updating Homebrew.."
  14. brew update >/dev/null
  15. echo "[=> Checking installed Homebrew formulas.."
  16. BREW_PACKAGES=$(brew list)
  17. BREW_DEPENDENCIES="jack speexdsp ccache swig mbedtls"
  18. for DEPENDENCY in ${BREW_DEPENDENCIES}; do
  19. if echo "${BREW_PACKAGES}" | grep -q "^${DEPENDENCY}\$"; then
  20. echo "=> Upgrading OBS-Studio dependency '${DEPENDENCY}'.."
  21. brew upgrade ${DEPENDENCY} 2>/dev/null
  22. else
  23. echo "=> Installing OBS-Studio dependency '${DEPENDENCY}'.."
  24. brew install ${DEPENDENCY} 2>/dev/null
  25. fi
  26. done
  27. # qtwebsockets deps
  28. echo "=> Installing plugin dependency 'QT 5.10.1'.."
  29. # =!= NOTICE =!=
  30. # When building QT5 from sources on macOS 10.13+, use local qt5 formula:
  31. # brew install ./CI/macos/qt.rb
  32. # Pouring from the bottle is much quicker though, so use bottle for now.
  33. # =!= NOTICE =!=
  34. brew install https://gist.githubusercontent.com/DDRBoxman/b3956fab6073335a4bf151db0dcbd4ad/raw/ed1342a8a86793ea8c10d8b4d712a654da121ace/qt.rb
  35. # Pin this version of QT5 to avoid `brew upgrade`
  36. # upgrading it to incompatible version
  37. brew pin qt
  38. # Fetch and install Packages app
  39. # =!= NOTICE =!=
  40. # Installs a LaunchDaemon under /Library/LaunchDaemons/fr.whitebox.packages.build.dispatcher.plist
  41. # =!= NOTICE =!=
  42. HAS_PACKAGES=$(type packagesbuild 2>/dev/null)
  43. if [ "${HAS_PACKAGES}" = "" ]; then
  44. echo "=> Installing Packaging app (might require password due to 'sudo').."
  45. curl -o './Packages.pkg' --retry-connrefused -s --retry-delay 1 'https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg'
  46. sudo installer -pkg ./Packages.pkg -target /
  47. fi