prepare_build_macos_rc 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. #
  3. # This script sets up a Kokoro MacOS worker for running Protobuf tests
  4. ##
  5. # Select Xcode version
  6. # Remember to udpate the Xcode version when xcode_9.4.1 is not available.
  7. # If xcode is not available, it will probaly encounter the failure for
  8. # "autom4te: need GNU m4 1.4 or later: /usr/bin/m4""
  9. export DEVELOPER_DIR=/Applications/Xcode_9.4.1.app/Contents/Developer
  10. ##
  11. # Select C/C++ compilers
  12. export CC=gcc
  13. export CXX=g++
  14. ##
  15. # Install Brew and core softwares
  16. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  17. source $HOME/.rvm/scripts/rvm
  18. brew uninstall node icu4c cmake
  19. brew prune
  20. brew install gflags gpg gpg2 node openssl pcre ruby cmake
  21. sudo chown -R $(whoami) /usr/local
  22. brew postinstall node
  23. ##
  24. # Install Tox
  25. sudo pip install tox==2.4.1
  26. ##
  27. # Install RVM
  28. gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
  29. command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
  30. curl -sSL https://get.rvm.io | bash -s stable --ruby