Had to deal with this recently, Homebrew on macOS though. Meson build failed. Had to manually install Mako with pip, which also installed MarkupSafe. Then bitched that Homebrew (or Linuxbrew) will break in the future for some reason. So next time I build X, I can look forward to that. :/