Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

homebrew: the difference between `prefix.install "some_binary"` and `bin.install "some_binary"`

When writing a homebrew recipe,

whats the difference between prefix.install "some_binary" and bin.install "some_binary"

like image 654
american-ninja-warrior Avatar asked Aug 31 '25 01:08

american-ninja-warrior


1 Answers

Read the Formula Cookbook:

prefix  #{HOMEBREW_PREFIX}/Cellar/#{name}/#{version}
        /usr/local/Cellar/foo/0.1

bin     #{prefix}/bin
        /usr/local/Cellar/foo/0.1/bin 

Here, bin is the directory where the actual executables are stored, whereas prefix contains everything related to a given version of the formula.

You don't want to install a binary in the directory pointed at by prefix.

like image 58
slhck Avatar answered Sep 02 '25 16:09

slhck