Linking a package built from source to Homebrew

I was missing a depedency that I was able to build from source.
Now that I have built from source I want to tell Homebrew that I have this package.

Is this the command I need to run?


Install into Homebrew without formulae

./configure --prefix=/usr/local/Cellar/foo/1.2 && make && make install && brew link foo

Specifically I was missing nghttp2 which I built from source because it was a dependency for php@72

Any help appreciated.

The only way to make homebrew interact with software reliably is to make it a formula.