Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Homebrew recompile from edited source code

Is there a way to to recompile from an edited source code via homebrew?

I did a change on the source user.hpp of Boost which I now want to recompile Boost with. I tried --build-from-source and --enable-bar but neither works, saying that it is already installed. The only way I can recompile is by reinstall but that simply overwrites the source code I changed.

Any idea?

like image 534
Yasin Avatar asked Jul 20 '15 08:07

Yasin


1 Answers

First option Download the archive, edit the files, and zip the archive as homebrew does (same name and format).

If you kept the original folder structure created by Homebrew, you can put the modified archive in ~/Library/Caches/Homebrew and then try brew install -f. (the -f is maybe not strictly necessary but it may be need for the SHA-1 mismatch.)

More info on this blog.

Second option

Pulled out from the Homebrew wiki, install the package without homebrew and then link it with brew.

./configure --prefix=/usr/local/Cellar/foo/1.2 && make && make install && brew link foo
like image 87
Kirell Avatar answered Oct 01 '22 20:10

Kirell