I'd prefer you inlined the patch (at the end of the formula, after a `__END__` and put here in this line just `DATA`.
And note that you can use `HOMEBREW_PREFIX` in the patch, which will solve the `brew --prefix` issue mentioned by @manphiz .