Install an older version poppler and its cairo-specific headers needed by pdfparser.
brew tap rossumai/formulas
brew install poppler@21.07.0
brew link poppler@21.07.0
Create a new formula in Formula/
directory.
Test installation by:
brew install ./Formula/foo.rb