XCode
It is no longer necessary to download the full Xcode IDE from the Mac App Store. You can save youreself some disk space and just run the command below to only install Xcode Command Line tools.
XCode Command line
is bare minimum software required for using Homebrew or MacPorts.
Installation
$ xcode-select --install
Verification
$ xcode-select -p
Should output /Applications/Xcode.app/Contents/Developer