install-build-obs-macos.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. OSTYPE=$(uname)
  3. if [ "${OSTYPE}" != "Darwin" ]; then
  4. echo "[Error] macOS obs-studio build script can be run on Darwin-type OS only."
  5. exit 1
  6. fi
  7. HAS_CMAKE=$(type cmake 2>/dev/null)
  8. HAS_GIT=$(type git 2>/dev/null)
  9. if [ "${HAS_CMAKE}" = "" ]; then
  10. echo "[Error] CMake not installed - please run 'install-dependencies-macos.sh' first."
  11. exit 1
  12. fi
  13. if [ "${HAS_GIT}" = "" ]; then
  14. echo "[Error] Git not installed - please install Xcode developer tools or via Homebrew."
  15. exit 1
  16. fi
  17. echo "=> Downloading and unpacking OBS dependencies"
  18. wget --quiet --retry-connrefused --waitretry=1 https://obs-nightly.s3.amazonaws.com/osx-deps-2018-08-09.tar.gz
  19. tar -xf ./osx-deps-2018-08-09.tar.gz -C /tmp
  20. # Build obs-studio
  21. cd ..
  22. echo "=> Cloning obs-studio from GitHub.."
  23. git clone https://github.com/obsproject/obs-studio
  24. cd obs-studio
  25. OBSLatestTag=$(git describe --tags --abbrev=0)
  26. git checkout $OBSLatestTag
  27. mkdir build && cd build
  28. echo "=> Building obs-studio.."
  29. cmake .. \
  30. -DBUILD_CAPTIONS=true \
  31. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 \
  32. -DDISABLE_PLUGINS=true \
  33. -DENABLE_SCRIPTING=0 \
  34. -DDepsPath=/tmp/obsdeps \
  35. -DCMAKE_PREFIX_PATH=/usr/local/opt/qt/lib/cmake \
  36. && make -j4