HomeBrew

HomeBrew

Developing software on OS X is not always easy. It's not like Linux or FreeBSD where we have package management that allows easy installation and upgrading of software and the libraries that depend on them. In those systems it's a given. It's buit in, it's a part of life we learn and get used to from the beginning.

Not so on OS X. Apple would like control of your entire domain. I can't really blame them. They make life easy, they take care of you, coddle you even. But then you need to install something that is not your usual Apple customer desire. Maybe it's mutt, atomic Parsley, id3lib, the latest version of ruby or python3. Maybe some python library requires cmake.

A few years ago I would have said, "check out MacPorts it'll take care of what you need". But these days there is HomeBrew. HomeBrew is the nicest package manager going for OS X these days. If you want life to be mostly easier than it is, you need HomeBrew. 

Homebrew is one of the most fundamental tools of all. Homebrew installs tools, libraries, software, you name it. It installs everything in it's cellar. So you always know what it has installed and so does HomeBrew. Everything you install has a formula which is written in Ruby. The formula controls how everything is configured and compiled, it knows the dependencies required, Brew knows everything regarding getting that piece of software downloaded, built and installed on your system. Mostly, you probably won't have to mess with the formulas. But if you do it's easy.

Get HomeBrew here.

HomeBrew Commands, it's simple.

The simplist command for Homebrew is this:

brew install xxx

where xxx is the thing you want to install. If you can't guess the name you can try this.

brew search xxx

if that doesn't work you aren't quite out of luck. You can still download something and install it within the brew framework. This lets Brew manage your software. Which is a whole lot easier than trying to remember what version of what you put where.

brew create http://foo.com/bar-1.0.tgz

if you want to know what you have, or what Brew knows ask it to list the cellar.

brew list 

If you do find what you are looking for but want to make sure that what you are installing has the right option, like maybe you want to enaable threads in the ./configure of the build, you can edit the formula and see what's going on. It's just Ruby so it's pretty easy to read and understand.

brew edit xxx

If you want to change it, then change it and save it. The formula goes in your cellar so that will become the way that software is installed bybrew on your system.

If you don't get it right, 

brew uninstall xxx

will take care of things so you can start over.

 

Things aren't always rosy with Brew. But for those times there is the Brew Doctor.  Invoke the good doctor whenever you have troubles. The doc might be helpful. Mostly, if you use brew for most everything, most everything works. Python 3.x has been a bit of a pain but that's another story.

Use Brew. It's easy, it's reversable, it takes care of dependencies and mostly it makes life easier, you don't even have to go find the page to download xxx from.  All you need to know is it's name.

Get HomeBrew here!

Leave a Reply

Your email address will not be published. Required fields are marked *