The current version of UseHomebrew defaults to /opt/homebrew/Cellar and prioritizes it over anything currently existing in PATH. This has two issues:
- On x86_64 installations of Homebrew (including when emulating on ARM), the path is /usr/local/Cellar
- When building in a `nix develop` environment, the homebrew versions take priority, complicating testing
This addresses this issue by using the output of `brew --prefix`, doing nothing if brew is not in `PATH`.
Additionally, CMakeLists.txt was updated such that if YOSYS_ENABLE_HOMEBREW is defined as OFF, using Homebrew is skipped entirely.
Homebrew doesn't provide a merged (FHS) prefix and tools installed from
it cannot be expected to appear on PATH. Furthermore, XCode provides
some tools and headers (Flex, Bison) which must not be used if
a Homebrew alternative is installed.