def main()

in scripts/gha/install_prereqs_desktop.py [0:0]


def main():
  # Install protobuf on linux/mac if its not installed already
  if not utils.is_command_installed('protoc'):
    if utils.is_linux_os():
        # sudo apt install protobuf-compiler
        utils.run_command(['apt', 'install', '-y','protobuf-compiler'], as_root=True)
    elif utils.is_mac_os():
        # brew install protobuf
        utils.run_command(['brew', 'install', 'protobuf'])
    
  # Install go on linux/mac if its not installed already
  if not utils.is_command_installed('go'):
    if utils.is_linux_os():
        # sudo apt install -y golang
        utils.run_command(['apt', 'install', '-y','golang'], as_root=True)
    elif utils.is_mac_os():
        # brew install protobuf
        utils.run_command(['brew', 'install', 'go'])

  # Install openssl on linux/mac if its not installed already
  if not utils.is_command_installed('go'):
    if utils.is_linux_os():
        # sudo apt install -y openssl
        utils.run_command(['apt', 'install', '-y','openssl'], as_root=True)
    elif utils.is_mac_os():
        # brew install protobuf
        utils.run_command(['brew', 'install', 'openssl'])

  # Install ccache on linux/mac if its not installed already
  if not utils.is_command_installed('ccache'):
    if utils.is_linux_os():
        # sudo apt install ccache
        utils.run_command(['apt', 'install', '-y', 'ccache'], as_root=True)
    elif utils.is_mac_os():
        # brew install ccache
        utils.run_command(['brew', 'install', 'ccache'])
  
  # Install clang-format on linux/mac if its not installed already
  if not utils.is_command_installed('clang-format'):
    if utils.is_linux_os():
        # sudo apt install clang-format
        utils.run_command(['apt', 'install', '-y','clang-format'], as_root=True)
    elif utils.is_mac_os():
        # brew install protobuf
        utils.run_command(['brew', 'install', 'clang-format'])

  # Install required python dependencies. 
  # On Catalina, python2 in installed as default python.
  # Example command:
  # python3 -m pip install -r external/pip_requirements.txt --user
  utils.run_command( 
     ['python3' if utils.is_command_installed('python3') else 'python', '-m', 
          'pip', 'install', '-r', 'external/pip_requirements.txt', '--user'] )