Homebrew without Xcode

Xcode 4 is not small. In my case it took about 10GB of free space. I know its not a lot, especially these days when standard notebooks have hard drives with capacity about 0.5TB. But I have small SSD and 10GB is quite a lot for me. And best of all I don’t use Xcode. But I’m using homebrew for unix tools installation and it relies on GCC and other libraries (which are part of Xcode). Fortunately there is a way how to get these libraries without Xcode. So let’s get rid of it.

First of all uninstall whole Xcode using sudo /Developer/Library/uninstall-devtools –mode=all and restart your mac. As you can see, GCC is gone

vhyza@vhyza:~$ gcc
bash: gcc: command not found

Now go to osx-gcc-installer download page, select your OS X version (Snow Leopard or Lion) and install downloaded *.pkg. As you can see, GCC is back.

vhyza@vhyza:~$ gcc
i686-apple-darwin11-llvm-gcc-4.2: no input files

Now you can install unix tools using homebrew without Xcode (if you don’t have homebrew follow installation instructions).

After that I tried to upgrade GIT. Homebrew was compaining Xcode is not installed but everything else seems ok.

vhyza@vhyza:~$ brew install git
Warning: Xcode is not installed! Builds may fail!
==> Downloading http://kernel.org/pub/software/scm/git/git-1.7.6.tar.bz2
File already downloaded in /Users/vhyza/Library/Caches/Homebrew
==> make prefix=/usr/local/Cellar/git/1.7.6 install
==> Downloading http://kernel.org/pub/software/scm/git/git-manpages-1.7.6.tar.bz2
######################################################################## 100.0%
==> Downloading http://kernel.org/pub/software/scm/git/git-htmldocs-1.7.6.tar.bz2
######################################################################## 100.0%
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

Emacs support has been installed to:
  /usr/local/Cellar/git/1.7.6/share/doc/git-core/contrib/emacs

The rest of the "contrib" has been installed to:
  /usr/local/Cellar/git/1.7.6/share/contrib
==> Summary
/usr/local/Cellar/git/1.7.6: 1071 files, 19M, built in 54 seconds
vhyza@vhyza:~$ git --version
git version 1.7.6

That’s all (in case of some failure you can always install Xcode back).

OS X

« Standalone Passenger on OS X Lion MacBook Pro and insert key »

Comments