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?
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.
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 ).
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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With