15. WHY USE HOMEBREW?
• Fink and MacPorts have the wrong philosophy
• Sticks to one standard prefix — /usr/local
16. WHY USE HOMEBREW?
• Fink and MacPorts have the wrong philosophy
• Sticks to one standard prefix — /usr/local
• Doesn’t duplicate what Apple already provides
17. WHY USE HOMEBREW?
• Fink and MacPorts have the wrong philosophy
• Sticks to one standard prefix — /usr/local
• Doesn’t duplicate what Apple already provides
• Making new packages is dead simple
18. WHY USE HOMEBREW?
• Fink and MacPorts have the wrong philosophy
• Sticks to one standard prefix — /usr/local
• Doesn’t duplicate what Apple already provides
• Making new packages is dead simple
• Very active user community
20. WHY NOT?
• Support for multiple versions of the same package is
“okay”, but not great
21. WHY NOT?
• Support for multiple versions of the same package is
“okay”, but not great
• Fink and Macports “work” for now
22. WHY NOT?
• Support for multiple versions of the same package is
“okay”, but not great
• Fink and Macports “work” for now
• Doesn’t duplicate anything Apple already provides
25. GETTING STARTED
# Install Homebrew
$ ruby -e "$(curl http://gist.github.com/raw/323731/install_homebrew.rb)"
# Update formulas
$ brew update
# List all available formulas
$ brew search | less
# ... PROFIT!
26. USING HOMEBREW
$ brew install foo
$ brew uninstall foo
$ brew search [/regex/] [substring]
# Update formulas from git
$ brew update
# Remove old versions of foo
$ brew cleanup foo
$ brew info foo
# Show which installed formulas are outdated
$ brew outdated
# Remove all old versions of all formulas
$ brew prune
27. SOME FORMULAS
ack haproxy nginx
bzr hg redis
git hub rlwrap
cassandra llvm rtorrent
clojure memcached sphinx
coffee-script mysql subversion
ctags mongodb tex-live
go monit tokyo-cabinet
29. METAPHORS
The package /usr/local/Library/
Formula
description Formula/foo.rb
The installation
/usr/local/Cellar/
Keg prefix of a
foo/0.1
formula
The location
Cellar where all kegs are /usr/local/Cellar
installed
31. CODE
require 'formula'
class Sl < Formula
url 'http://ftp.de.debian.org/debian/pool/main/s/sl/
sl_3.03.orig.tar.gz'
version '3.03'
homepage 'http://packages.debian.org/source/oldstable/sl'
md5 'd0d997b964bb3478f7f4968eee13c698'
end
32. CODE
require 'formula'
class Sl < Formula
url 'http://ftp.de.debian.org/debian/pool/main/s/sl/
sl_3.03.orig.tar.gz'
version '3.03'
homepage 'http://packages.debian.org/source/oldstable/sl'
md5 'd0d997b964bb3478f7f4968eee13c698'
def install
system 'make'
bin.install 'sl'
man1.install 'sl.1'
end
end
36. WILL FARRINGTON
Chief Intern of Entirely Superfluous Job Titles
will@railsmachine.com
willfarrington.com
MIKE SKALNIK
Head Intern — Crockpot-Related R&D, Gardening
mike@railsmachine.com
mikeskalnik.com
Editor's Notes
Introduce yourselves!
Here&#x2019;s what we&#x2019;ll be covering today
Package managers on OS X have historically been... pretty awful. Homebrew kicks it up a notch.
The whole package manager is written in Ruby and uses git for the &#x201C;repository&#x201D;
It&#x2019;s insanely popular. Absolutely huge number of people contributing to it, and even more using it and filing bug reports (ie. requests)
Contribution is as simple as forking the repo on github and then making an issue with a link to your commits
All you need to install to get up and running is the OS X toolchain &#x2014; ie. XCode
Package managers on OS X have historically been... pretty awful. Homebrew kicks it up a notch.
The whole package manager is written in Ruby and uses git for the &#x201C;repository&#x201D;
It&#x2019;s insanely popular. Absolutely huge number of people contributing to it, and even more using it and filing bug reports (ie. requests)
Contribution is as simple as forking the repo on github and then making an issue with a link to your commits
All you need to install to get up and running is the OS X toolchain &#x2014; ie. XCode
Package managers on OS X have historically been... pretty awful. Homebrew kicks it up a notch.
The whole package manager is written in Ruby and uses git for the &#x201C;repository&#x201D;
It&#x2019;s insanely popular. Absolutely huge number of people contributing to it, and even more using it and filing bug reports (ie. requests)
Contribution is as simple as forking the repo on github and then making an issue with a link to your commits
All you need to install to get up and running is the OS X toolchain &#x2014; ie. XCode
Package managers on OS X have historically been... pretty awful. Homebrew kicks it up a notch.
The whole package manager is written in Ruby and uses git for the &#x201C;repository&#x201D;
It&#x2019;s insanely popular. Absolutely huge number of people contributing to it, and even more using it and filing bug reports (ie. requests)
Contribution is as simple as forking the repo on github and then making an issue with a link to your commits
All you need to install to get up and running is the OS X toolchain &#x2014; ie. XCode
Package managers on OS X have historically been... pretty awful. Homebrew kicks it up a notch.
The whole package manager is written in Ruby and uses git for the &#x201C;repository&#x201D;
It&#x2019;s insanely popular. Absolutely huge number of people contributing to it, and even more using it and filing bug reports (ie. requests)
Contribution is as simple as forking the repo on github and then making an issue with a link to your commits
All you need to install to get up and running is the OS X toolchain &#x2014; ie. XCode
It&#x2019;s the third most forked repository on github!
It&#x2019;s the third most forked repository on github!
Fink and MacPorts try to shove Linux-style package management into OS X. That&#x2019;s the wrong way to do it. There are plenty of good Linux package managers out there, and yeah, technically they *can* be made to work on OS X, but they&#x2019;ll never really fit in. Homebrew was designed *for* OS X, not around it.
One of homebrew&#x2019;s own philosophies is that the user shouldn&#x2019;t need super-user or sudo access to install packages. Instead, it makes /usr/local accessible to the current user and recommends using it as the homebrew prefix.
No duplication means doesn&#x2019;t replace ruby, perl, php, etc
And as already shown, huge user community
Fink and MacPorts try to shove Linux-style package management into OS X. That&#x2019;s the wrong way to do it. There are plenty of good Linux package managers out there, and yeah, technically they *can* be made to work on OS X, but they&#x2019;ll never really fit in. Homebrew was designed *for* OS X, not around it.
One of homebrew&#x2019;s own philosophies is that the user shouldn&#x2019;t need super-user or sudo access to install packages. Instead, it makes /usr/local accessible to the current user and recommends using it as the homebrew prefix.
No duplication means doesn&#x2019;t replace ruby, perl, php, etc
And as already shown, huge user community
Fink and MacPorts try to shove Linux-style package management into OS X. That&#x2019;s the wrong way to do it. There are plenty of good Linux package managers out there, and yeah, technically they *can* be made to work on OS X, but they&#x2019;ll never really fit in. Homebrew was designed *for* OS X, not around it.
One of homebrew&#x2019;s own philosophies is that the user shouldn&#x2019;t need super-user or sudo access to install packages. Instead, it makes /usr/local accessible to the current user and recommends using it as the homebrew prefix.
No duplication means doesn&#x2019;t replace ruby, perl, php, etc
And as already shown, huge user community
Fink and MacPorts try to shove Linux-style package management into OS X. That&#x2019;s the wrong way to do it. There are plenty of good Linux package managers out there, and yeah, technically they *can* be made to work on OS X, but they&#x2019;ll never really fit in. Homebrew was designed *for* OS X, not around it.
One of homebrew&#x2019;s own philosophies is that the user shouldn&#x2019;t need super-user or sudo access to install packages. Instead, it makes /usr/local accessible to the current user and recommends using it as the homebrew prefix.
No duplication means doesn&#x2019;t replace ruby, perl, php, etc
And as already shown, huge user community
Fink and MacPorts try to shove Linux-style package management into OS X. That&#x2019;s the wrong way to do it. There are plenty of good Linux package managers out there, and yeah, technically they *can* be made to work on OS X, but they&#x2019;ll never really fit in. Homebrew was designed *for* OS X, not around it.
One of homebrew&#x2019;s own philosophies is that the user shouldn&#x2019;t need super-user or sudo access to install packages. Instead, it makes /usr/local accessible to the current user and recommends using it as the homebrew prefix.
No duplication means doesn&#x2019;t replace ruby, perl, php, etc
And as already shown, huge user community
Homebrew can install multiple versions of the same package, but it doesn&#x2019;t all &#x201C;link&#x201D; them into place. Basically homebrew installs each package in its own little prefix in /usr/local, but then symlinks one of them into the &#x201C;standard&#x201D; /usr/local directories, like lib and bin. It&#x2019;s not ideal, but it doesn&#x2019;t prevent you from really using multiple versions of things like libraries.
Change is hard. Getting others to change is really hard.
Don&#x2019;t like the way Apple ships PHP? Out of luck.
Homebrew can install multiple versions of the same package, but it doesn&#x2019;t all &#x201C;link&#x201D; them into place. Basically homebrew installs each package in its own little prefix in /usr/local, but then symlinks one of them into the &#x201C;standard&#x201D; /usr/local directories, like lib and bin. It&#x2019;s not ideal, but it doesn&#x2019;t prevent you from really using multiple versions of things like libraries.
Change is hard. Getting others to change is really hard.
Don&#x2019;t like the way Apple ships PHP? Out of luck.
Homebrew can install multiple versions of the same package, but it doesn&#x2019;t all &#x201C;link&#x201D; them into place. Basically homebrew installs each package in its own little prefix in /usr/local, but then symlinks one of them into the &#x201C;standard&#x201D; /usr/local directories, like lib and bin. It&#x2019;s not ideal, but it doesn&#x2019;t prevent you from really using multiple versions of things like libraries.
Change is hard. Getting others to change is really hard.
Don&#x2019;t like the way Apple ships PHP? Out of luck.
Getting homebrew installed and running is pretty easy.
Using it, is also pretty easy
Finding useful packages, is also really easy.
but above all else, creating your own packages to contribute, is really, really easy
Some terminology we&#x2019;ll use here. Formulas are the ruby file describing the package, and the keg is where a particular version of a formula is installed to, and the Cellar holds all of these kegs.
So let&#x2019;s write a package definition
First thing is to require the formula library
Then, make some method calls to set metadata for the formula
and now tell homebrew how to build and install it
Once you&#x2019;ve got your formula made or updated and you&#x2019;ve pushed to your own remote, just file an issue on the source repo on github with a link to your commits and wait! That&#x2019;s it.
So, any questions?
Here&#x2019;s other places you might want to go for homebrew-related activities