Homebrew for MacPorts users
I don’t like Homebrew. It has some cons which are really annoying. Let’s try to avoid them:
Homebrew isn’t fully isolated
MacPorts installs everything into /opt/local. Wanna quit? Remove installed ports, rm -rf /opt/local, clear PATH, you’re done. Homebrew instead is powered by symlinks which is really bad idea. Wanna quit? Hope your /usr/local/… will be consistent after that.
How to avoid:
Install Homebrew into /opt/brew:
sudo mkdir /opt/brew
sudo chown $USER:staff /opt/brew
cd /opt/brew
git clone git@github.com:Homebrew/homebrew.git .
Modify your ~/.profile or ~/.bashrc or whatever you use for environment configuration:
export PATH=/opt/brew/bin:$PATH
export MANPATH=/opt/brew/share/man:$MANPATH
Now it’s isolated, but we have another issue:
Compilers don’t use Homebrew libraries by default
So this requires to specify LDFLAGS and CPPFLAGS when you’re trying to build something like ruby gems with native extensions.
How to avoid:
Modify your ~/.profile or ~/.bashrc or whatever you use for environment configuration:
export LDFLAGS="-L/opt/brew/lib"
export CPPFLAGS="-I/opt/brew/include"
Now compilers automagically use Homebrew libs. Yay!
You can’t start/stop/restart services with Homebrew
OOB you’re able to do this by loading/unloading launchd plists and it’s just stupid. But actually you can. Just run this command:
brew tap homebrew/services
And now you can do this:
brew services list/start/stop/restart/cleanup
You can’t install old versions of software
Imagine you need an old version of gcc to compile some old stuff. Actually you can:
brew tap homebrew/versions
Now you have some additional formulas like gcc49 or ruby18. Complete list is here: https://github.com/Homebrew/homebrew-versions
That’s it. Now it’s not so frustrating.