如何修改家酿配方?

我通过 自酿的安装了 图像魔术

但是,由于当前配置中的一个 bug,我需要调整公式的编译标志并重新安装它。

我该怎么做呢?

49589 次浏览

Remove the existing version.

$ brew rm imagemagick

Edit the formula.

$ brew edit imagemagick

This will bring it up in an editor; make sure your $EDITOR variable is set to your preference (for me: TextMate)

Change it, save it, try re-installing it.

Because most installs use pouring/bottles to install a precompiled binary, you will likely see no change unless you "build from source":

$ brew reinstall --build-from-source [...]

You can use --formula /path/to/imagemagick.rb as an additional argument to the above command to ensure brew is installing the formula that was edited.

If you're comfortable with git, you may also want to make a branch first, and do your edits in a branch to guard against data loss.