Norbert Hartl

mostly brackets and pipes

Simple Patches in Homebrew

I just learned how to apply a simple patch to piece of software that is being build by homebrew. I write it down not to forget. A simple patch is easily applicapable in brew. You just need to do the following: Open a terminal and typebrew edit myformulaAn editor opens containing the text of the package myformula Add a method “patches” like this def patches DATA endIn the patches method you can do all kind of things with the source. The method is called automatically by homebrew. If this is a simple patch and we want to included right in the formula the DATA will do the trick.

Add an end label to the formula as the last line of the forumla__END__This indicated the end of the formula

Paste your patch after the __END__ label

Installing the software by doing

brew install myformulait 

should patch the source before building it

Comments