Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modifying the source code of a home brew package

Tags:

I installed a package with homebrew (qt). I'd like to modify the source code and rebuild the package. I can't seem to find the source code, though. brew --cache returns a directory that doesn't exist, and the code for qt isn't in /usr/local/Cellar. Am I missing something? Does homebrew remove the source code after the application is built?

like image 289
marketer Avatar asked Jan 26 '11 01:01

marketer


People also ask

Does Homebrew build from source?

Homebrew's pre-built binary packages (known as bottles) of many formulae can only be used if you install in the default installation prefix, otherwise they have to be built from source. Building from source takes a long time, is prone to failure, and is not supported.

Where does brew install formulas?

Packages are installed according to their formulae, which live in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula . Check out a simple one, e.g. brew edit etl (or etl ) or a more advanced one, e.g. brew edit git (or git ).

How do I edit a Brewfile?

If you want to edit Brewfile directly, you can use brew file edit to open and edit Brewfile. A default editor is Vim. $EDITOR variable is used as editor if it is set.


1 Answers

Homebrew only keeps binaries. If your Homebrew cache directory (which is normally at /Library/Caches/Homebrew, but can be found using brew --cache, as you noted) has been moved or deleted, then you'll have to get the source code again. You can grab just the source code with brew fetch qt.

like image 193
mipadi Avatar answered Sep 20 '22 13:09

mipadi