I installed ImageMagick via Homebrew.
However, due to a bug I have with my current configuration, I need to adjust the compile flags for the formula and reinstall it.
How can I accomplish this?
I installed ImageMagick via Homebrew.
However, due to a bug I have with my current configuration, I need to adjust the compile flags for the formula and reinstall it.
How can I accomplish this?
$ brew rm imagemagick
$ brew edit imagemagick
This will bring it up in an editor; make sure your $EDITOR
variable is set to your preference (for me: TextMate)
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.
The accepted answer was the first step, but more was needed for my formula edit to work in February 2023.
If you edit formula foo, but your change is ignored by brew reinstall --build-from-source foo
then, add export HOMEBREW_NO_INSTALL_FROM_API=1
to your shell config. It makes Homebrew actually use your revised formula.
Details: Homebrew FAQ: Edit Formula
Also, if you want your revised formula to persist, then run brew pin foo