I misunderstood the formula syntax. depends_on 'libxml2' => [:optional, 'with-xml2'] will build the libxml2 dependency with the 'with-xml2' flag. What I wanted was to rename the 'with-libxml2' flag on the emacs-mac formula itself to 'with-xml2' (because emacs itself is using 'with-xml2'). Fixed in this commit (also for the 'with-dbus' flag).
Marking `automake` as a build dependency instead of a general dependency. Added `pkg-config` as a build dependency so an install will locate libraries installed via Homebrew. Added libxml2, dbus, gnutls, and imagemagick as optional dependencies to make it easier to get them installed. Signed-off-by: Arne Jørgensen <email@example.com>