Is there another way this could be applied? The config.h.in can't be patched, I take it?

At a minimum I'd like it as a subformula; the current method requires an internet connection when the formula is installed, since that download can't be cached.