install-dependencies-osx.sh 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. hr() {
  2. echo "───────────────────────────────────────────────────"
  3. echo $1
  4. echo "───────────────────────────────────────────────────"
  5. }
  6. # Exit if something fails
  7. set -e
  8. # Echo all commands before executing
  9. set -v
  10. if [[ $TRAVIS ]]; then
  11. git fetch --unshallow
  12. fi
  13. git fetch origin --tags
  14. # Leave obs-studio folder
  15. cd ../
  16. # Install Packages app so we can build a package later
  17. # http://s.sudre.free.fr/Software/Packages/about.html
  18. hr "Downloading Packages app"
  19. wget --quiet --retry-connrefused --waitretry=1 https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg
  20. sudo installer -pkg ./Packages.pkg -target /
  21. brew update
  22. #Base OBS Deps and ccache
  23. for DEPENDENCY in jack speexdsp ccache mbedtls freetype fdk-aac cmocka; do
  24. if [ ! -d "$(brew --cellar)/${DEPENDENCY}" ]; then
  25. brew install $DEPENDENCY
  26. else
  27. brew upgrade $DEPENDENCY
  28. fi
  29. done
  30. brew install https://gist.githubusercontent.com/DDRBoxman/9c7a2b08933166f4b61ed9a44b242609/raw/ef4de6c587c6bd7f50210eccd5bd51ff08e6de13/qt.rb
  31. if [ -d "$(brew --cellar)/swig" ]; then
  32. brew unlink swig
  33. fi
  34. brew install https://gist.githubusercontent.com/DDRBoxman/4cada55c51803a2f963fa40ce55c9d3e/raw/572c67e908bfbc1bcb8c476ea77ea3935133f5b5/swig.rb
  35. pip install dmgbuild
  36. export PATH=/usr/local/opt/ccache/libexec:$PATH
  37. ccache -s || echo "CCache is not available."
  38. # Fetch and untar prebuilt OBS deps that are compatible with older versions of OSX
  39. hr "Downloading OBS deps"
  40. wget --quiet --retry-connrefused --waitretry=1 https://github.com/obsproject/obs-deps/releases/download/2020-04-24/osx-deps-2020-04-24.tar.gz
  41. tar -xf ./osx-deps-2020-04-24.tar.gz -C /tmp
  42. # Fetch vlc codebase
  43. hr "Downloading VLC repo"
  44. wget --quiet --retry-connrefused --waitretry=1 https://downloads.videolan.org/vlc/3.0.8/vlc-3.0.8.tar.xz
  45. tar -xf vlc-3.0.8.tar.xz
  46. # Get sparkle
  47. hr "Downloading Sparkle framework"
  48. wget --quiet --retry-connrefused --waitretry=1 -O sparkle.tar.bz2 https://github.com/sparkle-project/Sparkle/releases/download/1.23.0/Sparkle-1.23.0.tar.bz2
  49. mkdir ./sparkle
  50. tar -xf ./sparkle.tar.bz2 -C ./sparkle
  51. sudo cp -R ./sparkle/Sparkle.framework /Library/Frameworks/Sparkle.framework
  52. # CEF Stuff
  53. hr "Downloading CEF"
  54. wget --quiet --retry-connrefused --waitretry=1 https://obs-nightly.s3-us-west-2.amazonaws.com/cef_binary_${CEF_BUILD_VERSION}_macosx64.tar.bz2
  55. tar -xf ./cef_binary_${CEF_BUILD_VERSION}_macosx64.tar.bz2
  56. cd ./cef_binary_${CEF_BUILD_VERSION}_macosx64
  57. # remove a broken test
  58. sed -i '.orig' '/add_subdirectory(tests\/ceftests)/d' ./CMakeLists.txt
  59. # target 10.11
  60. sed -i '.orig' s/\"10.9\"/\"10.11\"/ ./cmake/cef_variables.cmake
  61. mkdir build
  62. cd ./build
  63. cmake -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++" -DCMAKE_EXE_LINKER_FLAGS="-std=c++11 -stdlib=libc++" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 ..
  64. make -j4
  65. mkdir libcef_dll
  66. cd ../../