Homebrew recompile from edited source code

牧云@^-^@ 提交于 2019-12-10 08:48:23

问题


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?


回答1:


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



回答2:


Another approach is to add a patch to the homebrew formula (you can edit the formula using brew edit <formula-name>): https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md#patches



来源:https://stackoverflow.com/questions/31511553/homebrew-recompile-from-edited-source-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!