prepare_build_macos_rc 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 update the Xcode version when Xcode_11.3.app is not available.
  7. # If xcode is not available, it will probably encounter the failure for
  8. # "autom4te: need GNU m4 1.4 or later: /usr/bin/m4"
  9. # go/kokoro/userdocs/macos/selecting_xcode.md for more information.
  10. export DEVELOPER_DIR=/Applications/Xcode_11.3.app/Contents/Developer
  11. ##
  12. # Select C/C++ compilers
  13. export CC=gcc
  14. export CXX=g++
  15. ##
  16. # Install Brew and core softwares
  17. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  18. source $HOME/.rvm/scripts/rvm
  19. brew uninstall node icu4c cmake wget
  20. brew prune
  21. brew install gflags gpg gpg2 node openssl pcre ruby cmake wget
  22. sudo chown -R $(whoami) /usr/local
  23. brew postinstall node
  24. ##
  25. # Install Tox
  26. sudo pip install tox==2.4.1
  27. ##
  28. # Install RVM
  29. gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
  30. command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
  31. curl -sSL https://get.rvm.io | bash -s stable --ruby