Instead of just installing a pre-patched gcc formula, copy the local formula from Homebrew and apply a patch to it, before then installing it. This should be a lot more future-proof.