use homebrew installer when started with sudo, closes #1654