This patch makes a small modification to Homebrew allowing you to "spoof" or override its perceived macOS version. Often compiled bottles will work fine on older unsupported macOS verisons and using a bottle means you don't have to compile a formula from scratch or download and compile its build-only dependencies.
Of course you shouldn't do this unless you're very familiar Homebrew internals and understand the limitations. Things make break in a very confusing way. Most users should just keep macOS up to date, but for those that can't this patch may be helpful.
To use, first download and install the patch:
$ cd "$(brew --repo)"
$ wget "https://gist.githubusercontent.com/varenc/47c4b22e2b8c5afabce556645a90801d/raw/homebrew_override_version.patch" --output-document=/tmp/homebrew_override_version.patch
$ git apply /tmp/homebrew_override_version.patch
$ git diff  # running this just shows you that the patch you expect has been applied.  Revert with `git checkout .` if not.You can now override brew's percieved version by setting the env HOMEBREW_MACOS_VERSION_OVERRIDE.  For example, on macOS Mojave you can pretend to be on Catalina like this:
$ HOMEBREW_MACOS_VERSION_OVERRIDE="10.15.7" brew install -dv fzfThis will "trick" brew into installing the Catalina compiled binary for fzf. Homebrew by default would have forced a Mojave user to install and compile go, and then use that to compile fzf. But in this case, the latest fzf Catalina binary works fine on Mojave. (of course this may break in the future)
Thank you for this line of code!
Do you know how to overcome
curl: (60) SSL certificate problem: certificate has expiredI have Mojave and I'm trying to spoof something 11+