Hacker News new | past | comments | ask | show | jobs | submit login
Homebrew — MacPorts driving you to drink? Try Homebrew (mxcl.github.com)
82 points by twampss on Mar 13, 2010 | hide | past | web | favorite | 62 comments



Two other ideas worth considering:

GNU stow (http://www.gnu.org/software/stow/)

Rudix (http://rudix.org/)

Completely opposite approaches, but they're both worth looking at - especially if you find MacPorts or Fink too much. (Stow takes an approach similar to Homebrew's use of 'cellar' + individual subdirectories for packages; Rudix provides precompiled binaries.) Rudix in particular is perfect if you just want one or two *nix items quick on a Mac.


I currently use MacPorts... just wondering why I should switch?


FWIW, I was an early Homebrew user and even contributed a few recipes, but I moved back to MacPorts because (and no offense to mxcl, but it's kind of unavoidable) the author seems to do things with little understanding of the underlying system or justification.

Taking ownership of /user/local is completely utterly pointless and just plain bad advice. Copy-and-pasting optimization code from the Gentoo wiki is pointless. Binaries and libs are stripped without must justification, which will (did for me anyway) cause problems when compoing against the libs (eg, easy_install-ing anything against homebrew libs caused problems for me).

There has also been a lot of FUD spread about at the expense of MacPorts which I think is just low class. The anti-Macports complaints basically amount to "I don't understand this, so I'm going to say it's bad".

That said, it's written in ruby, uses github and the homepage is well done, so it will probably be wildly popular.


I've had MacPorts completely explode in my face several times when installing a seemingly innocuous package - some shared library gets replaced due to a requirement, and suddenly every utility I've installed doesn't work. Eventually I got to a point where I only used MacPorts to install ImageMagick and compiled everything else by hand; so far homebrew has felt like a more disciplined version of "compile it yourself".

I can't say I've had any problems with compiling Ruby gems against homebrew besides some settings that needed to be overridden in the MySQL gem, so that hasn't been a problem for me.

I kind of have mixed feelings about the ownership. So far I've been running it in /usr/local owned by my user and haven't had any problems, but I can see the security argument for not doing it. It doesn't feel any different then compiling your own binaries and leaving them in your home directory, something I've had to do on several hosts I've had in the past. (Also: Snow Leopard doesn't install anything to /usr/local by default, so if you're starting from scratch there's nothing to take ownership of...)

Overall, I've rather liked it so far. We'll see if I regret it...


Thank you, the "a more disciplined version of "compile it yourself" line exactly sums up my feelings.

If I really wanted a fleshed out, mature package management system, honestly - I'd install Ubuntu or Fedora.


/usr/local makes it far easier to install stuff like Gems with C extensions. It is a standard path checked by the C build system (eg. gcc).

There no good reason I have yet heard why using /usr/local is bad advise. I assume that since you provided no rationale for your statement you are in fact unaware of one.

But anyway having said this it is merely a recommendation — do whatever you want. The installation guide goes to great lengths to tell you that you should do whatever you want.

Back when I initially made Homebrew I was interested in the greatest goal of maximum awesome O99 CFLAG awesomeness. Now I'm only interested in reliable compiles and the default CFLAGS are pretty sensible. At the time I wouldn't have recommended the project to anyone particularly, but it got popular anyway.

But anyway, I never copy and pasted without reading a bunch first. I spent several days researching the stuff, the Gentoo wiki was a good source.

There is no anti MacPorts stuff in any of the docs anymore. I was never anti MacPorts at all, if anyone will believe me. I just found it to be not a great tool for developers. Homebrew is a grass roots project, at the time it seemed harmless fun to poke fun at the competition. As the project became more popular I took it all out. Now there is just a small gibe that I couldn't resist because it's too good a bit of wit.

Finally, no offence? May I suggest next time you say such a thing you don't immediately accuse the person to whom you mean no offence of being both ignorant and arrogant.

PS with offence, you're an ignorant twat, and probably ugly too.


Just a side note but /usr does not actually stand for /user (although I often pronounce it that way when speaking). It's actually an initialism standing for UNIX System Resources.


You sure that isn't just a backronym? It seems highly unlikely given its peers (/etc, /lib, /bin, none of which are acronyms) and given the system it lives in, which I don't think used the word "resources" anywhere else.

When I google I mainly find drive-by assertions that it means "UNIX System Resources" (and sometimes "User Specific Resources"). The closest I can find to something real is:

http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/usr.html


http://en.citizendium.org/wiki/Unix_directory_structure

/usr -- originally the directory holding user home directories, its use has changed, and it now holds executables, libraries, and shared resources that are not system critical: X11, KDE, PERL, etc. (The name "Unix System Resources" is a post hoc backronym.)


Funny, I don't think I've ever written it that way before (/user/local), though I do say it that way. At the time of that writing I was highly caffeinated, which might have something to do with it.


I have everything installed in ~/Homebrew and have had no problems.

I really wanted to keep liking Macports, but I got sick of having to install a new perl just to install git, among many examples. The kicker for me was installing pandoc; Macports wanted to download and compile a new GHC, refusing to recognize the one on my system. I let it run for 3 hours and finally killed the install and looked for a better way to do things.


Perl and GHC are the two packages I've had the most problems with as well. Some other languages seem to have a foo_select package which will allow you to switch the primary version, but 'perl5' seems fixed at 5.8.something, which is pretty horrible.

There's a ticket with a lot of activity at http://trac.macports.org/ticket/16830 but afaik there's still no easy way to stop it trying to rip out your new perl 5.10 without manually fixing deps everywhere.

GHC I just installed from a binary package :-)


I think your understanding of your system is flawed. Taking ownership of /usr/local is a suggestion it isn't a requirement.

It seems the anti-homebrew complaints basically amount to "I don't understand this, so I'm going to say it's bad".

The biggest reason I've seen to get rid of Macports in favor of Homebrew is software versions, Homebrew is constantly up to date and I can upgrade software with ease. Not so with Macports.


As a previous MacPorts user, I love homebrew. I keep macports around, because it has tons of ports that homebrew doesn't, but I dread using them because it is so much slower than homebrew. OS X ships with a lot of libs, and XCode installs even more. With macports, it redownloads and recompiles ALL of them, but with Homebrew it uses what you have. Also, the formulas are updated more often than macports, which I guess could be a good or bad thing.


I haven't switched to Homebrew but the advantage is that MacPorts creates its own universe of libraries, whereas Homebrew uses what Mac OS X already comes with. This makes installs a lot faster.


MacPorts creates it's own universe because that's the only reliable way to do it. What will Homebrew do when Python gets updated by Apple, or when you want 2.6.10 and Apple only has 2.6.4? With Macports the situation is easily dealt with, with Homebrew it's not.


Homebrew targets specific versions of OS X (currently 10.5/10.6).

Within a released version of OS X, they don't tend to break backwards compatibility.


"brew install python" works (and I've used it). In fact, I have a small pile of additional recipes locally for just doing custom, well-controlled compiles of Python.


And yet the recommended solution for upgrading MacPorts with an OS X upgrade? Uninstall and reinstall all ports. What's the point of it creating its own universe if it needs to destroy it anyways?


If it worked for you: then you shouldn't.

I had nothing but grief from trying to to get a basic (but up to date) LAMP running on any of several OS X (10.5 - 10.6). Life is too short.


I gave up MacPorts after several install failures, notably gtk after about a 1 hour compile, and switched to development in an Ubuntu VM. Have not had a problem since.


gtk failure is a problem with Snow Leopard, there's no stable gtk version that iscompatible with SL.


I had build errors with 10.5.


I can't recommend homebrew enough - I've been burned by macports and fink in the past, and so I had reverted to the time tested "just compile stuff by hand". Homebrew strikes a good balance between the raw, do it yourself approach and something as big and intermingled as macports.


For years, I have "compiled stuff by hand" of OS X - not a bad approach, but it takes time. If I was just a software developer I would probably run OS X most of the time because I would have my tools built and installed once and no repeat time wasting work. For me, I also write on tech a lot, and sometimes I get some consulting work fitting people's projects to technology stacks. As a result, I have the perfect excuse to try just about everything and installing "everything" is simpler on Linux.

If Homebrew develops into a great system in the future, I might boot less to Ubuntu.


What problems did you have with MacPorts?


Frequently, when actually needing to compile other things (outside of macports), Macports would be pulled in "magically" and cause issues (such as gettext and Python-core). Frequent issues debugging strange issues when trying to port install things, etc.

Homebrew does just enough to work, and get the job done and attempts to "fit in" with the OS I already have, versus making it's own sandbox off to the side.


The problem with accidentally pulling in libraries seems unavoidable with Homebrew since it uses /usr/local. Is the lack of sandboxing what you think makes it better? This seems like exactly what you should be looking for.

While I agree that it would be nice to have seamless integration with the OS, having a completely separate installation helps with things like OS upgrades or when you need to use a different version of a library that is installed by the OS. Does Homebrew do anything to handle that kind of problem?


It can use /usr/local - and you can set it up so that /usr/local comes before the rest of your system as you need to. Yes, an entirely self-contained sandbox avoids this, but most of the time, I don't want that.

Like I said in a previous comment, most of the time I'd find myself compiling things by hand into /usr/local anyway.

Please! Use the system's provided libraries. If I need something newer, I'll brew install it myself. For me homebrew strikes a good balance between "compile it myself, damn it" and Macports/Fink. The formula are easy to hack and update (it's simple), and for the most part it just gets ourt of your way.


You don't have to use /usr/local/


What problems did you have with fink?


this is #1 what drives me nuts about macports:

    $ port deps clojure-contrib
    Full Name: clojure-contrib @1.1.0
    Build Dependencies:   clojure
    Fetch Dependencies:   git-core
    $ port deps git-core
    Full Name: git-core @1.7.0.2+doc
    Runtime Dependencies: rsync, perl5, p5-error
    Library Dependencies: curl, zlib, openssl, expat, libiconv
with no possibility of skipping dependencies


Why don't you just edit the port to add a variant that lets you opt-out of those dependencies?

Poor package management isn't the fault of MacPorts; a Homebrew port could be just as poorly designed.

The "variants" infrastructure of MacPorts is one of my favorite parts of MacPorts, it definitely makes it easier to manage interdependencies IMHO.


Truth. Anyone capable of maintaining a homebrew setup has Sufficient skills to spend five minutes scanning the macports guide and tweaking the port files. OTOH, building clojure is te leas of the parents problems; he is in for anworld of painful surprise when he sees how screwed up packaging is. Have a clojure app? Include your own copy of clojure and clojure-contrib. Have a clojure editing mode? Do the same. Have a blog entry that mentions clojure? I think you need to download and squirrel away the jar files in those cases as well...

I ended up creating my own branch of the port tree for clojure bits just because of all the patching needed to avoid this "let me grab a copy of clojure for you" behavior.


Indeed. After looking at various package/dep schemes for clojure, I just gave up and created my own application and library templates and copy files around - at least the jar files are small enough that it doesn't really matter.


The title here and the quote at the bottom of the page say that it's better than MacPorts but there doesn't seem to be any comparison between them other than that. The only thing I've seen people use to say that it's better is that it's written in Ruby, but that doesn't seem like a big deal. Is there a comparison of the two somewhere? It seems like the problem people have with MacPorts is that it's been around longer so there have been more chances for things to go wrong.


I hated having to download 800mb of dependencies to install something simple. I already have Perl or lib(whatever); I don't need you to download it and install it.

I get the reliability argument (i.e., the only way to guarantee stuff builds right is to manage it yourself), but that's a problem with any platform where you might compile things alongside the package manager. So, let me manage that. I don't need a package manager to argue with me about what I want installed.


In addition to this argument, I think comparing them is almost like comparing apples and oranges. They both have their place on your system, but Macports is like a "lower gear" than Homebrew, and it takes a ton of time to do anything with it.


There's been lots of in-depth discussion about the pros and cons of MacPorts or Homebrew on HN already:

http://news.ycombinator.com/item?id=871341


And a more recent one (a lot of which ends up focused on /usr/local and sudo): http://news.ycombinator.com/item?id=1095793


I dream of the day when someone properly ports Portage (from Gentoo, the "emerge" thing) to Mac OS X.

I use MacPorts, and I've used a bunch of various package management systems, and portage is the only one that lets me maintain servers for > 5 years without reinstalling the whole thing, just upgrading the packages.


Sure, just use Gentoo Prefix. http://www.gentoo.org/proj/en/gentoo-alt/prefix/


So...Homebrew is MacPorts with simplified Portfiles and a smaller dependency graph?


<spelling-nazi> s/compliments/complements/ </spelling-nazi>

The former changes the meaning of the sentence completely.

But otherwise looks great. I would give anything to completely ditch macports.


Here's why I don't like MacPort. If I compile a much needed new library by hand, installing a program that depends on it shouldn't cause MacPort to download and recompile EVERYTHING by itself again instead of using what's already there in Apple or compiled. And why does MacPort have 20 times more dependencies than the same program in Fink? And since it's MACPort and there are only so many types of Macs, why aren't programs in binaries yet?


A better way to use all those unix tools is to just run Ubuntu in a VM and develop there, or just replace MacOS with Ubuntu entirely.


Vagrant makes this a lot easier.

http://vagrantup.com/


I now use Vagrant for App Engine and it's a breeze to set up. Since the working directory is mounted by the vm textmate works as always. I only have to ssh into the virtual machine to run some python scripts since locally there are some dependencies issues.


Did ubuntu suddenly get TextMate support? Also, have they fixed the poor graphics acceleration issues? Didn't think so, go away troll.


That's cool if you're happy with OS X. It's just that I know many OS X devs who use ubuntu in a VM. I'm personally happy with a full install of Ubuntu and Emacs instead of textmate while others prefer OS X + textmate or emacs or vim or what have you, to each his/her own. I was just stating an alternative, I didn't know that was trolling.


In a MacOS X package management thread, your solution is "install ubuntu", and you didn't know that was trolling?

I'm very suspicious of your story.


I hear you: TextMate is a great editor, especially when you want to browse through a lot of code. That said, "e" on Windows is fairly TextMate compatible (at least it runs the TextMate plugins). For Ubuntu, GEdit and Emacs are very good. Emacs with Speedbar lets you whip through lots of code quickly. GEdit also provides good plugins and multiple directory code browsing.

All that said, I still boot OS X for specific apps (TexShop, OmniGraffle mostly). Anyway, it is a free world, and certainly OS X is a great choice for development.


I just installed homebrew a few weeks ago. Consider me a fan. It's extremely straight-forward, and has almost everything I'm looking for. It's easy to update, and easy to remove packages.

I might never boot back into Ubuntu.


What I'd like to try sometime is NIX ( http://nixos.org/nix/ ). Getting it to work well on OSX would be the trick.

Edit: They say it should run on Mac OS X.


Think of it as a framework to build things yourself. It's not strictly a replacement for MacPorts.


Installing wget took about 20 seconds... brilliant.


Ah, but you appreciate wget much more, if you wait through the amount of time it takes MacPorts to provide it ;-)


Website need formula -> formulae for pluralization.


How about formulæ? :-)


I stopped using formulae as the plural as I felt like a twit.


Has anyone here tried pkgsrc on OS X?


Yep. It's not bad. I cloned the [experimental git repository](http://ftp.netbsd.org/pub/NetBSD/misc/repositories/git/pkgsr...) to `/usr/pkgsrc` and was able to install most packages I tried. They seem to lag behind current versions quite a bit and some pieces of software I rely on for work weren't packaged (redis, mongo, etc.).

I used it for a few months but eventually switched over to homebrew because it's a nice simple system and packages most of the stuff I need.

You have to run a case-insensitive filesystem with pkgsrc (I was anyway) and, like macports, it does not use system libraries so pretty much everything needs to be rebuilt under `/usr/pkg`.

It was worth experimenting with. I might check back on it when I get my new MBP. They have [a lot of packages](http://pkgsrc.se/).




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: