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