56

I'm reading this stack overflow answer

Mac user and getting WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.7.3

and I just want to know where they learned about the --with-xml2-config option in

brew install libxml2 --with-xml2-config

so that I can verify I really want to use this option myself and so I can better solve problems with homebrew myself in the future.

How can I see a description of this specific option and, more generally, find out all the available options for a formula when using brew install?

I know brew info FORMULA gets me some stuff like that, but brew info libxml2 only lists the options --universal, --without-python, and --HEAD.

For more info, here is another stack overflow question that is similar to this one but different: How can i get more info about a brew formula before installing?

Community
  • 1
  • 1
David Winiecki
  • 4,093
  • 2
  • 37
  • 39
  • 1
    The obvious answer would be to read the formula itself, they're reasonably readable even without previous exposure to Ruby. For example https://github.com/Homebrew/homebrew/blob/18cd018cc5a2ea8b30f291e34628ffd8ce211f68/Library/Formula/libxml2.rb . –  Jan 05 '14 at 07:15
  • Where in that file are the available options to `brew install FORMULA` listed? ...Oh, I see `option :universal`, `build.universal?`, `build.head?`, and `build.with? 'python'`. Maybe those hint at the available options. So is `--with-xml2-config` not a real option for `brew install libxml2`? – David Winiecki Jan 05 '14 at 16:17
  • Last I checked I don't think I was able to find good documentation for the ruby brew file. That would be a good addition to this page if anyone finds it. – David Winiecki Jan 23 '15 at 18:26

3 Answers3

103

Use options first to check:

brew options libxml2

If this dose not satisfy you, edit the rb file directly, and do whatever you want to:

brew edit libxml2
squid
  • 2,597
  • 1
  • 23
  • 19
  • 5
    It appears all options have been removed from `homebrew-core` : https://github.com/Homebrew/homebrew-core/issues/31510 – tallamjr Mar 06 '19 at 21:12
1

you can often see available options in the .rb brew file. Open with your favorite text editor, they usually live here on MacOS:

/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/

you can apply arguments in the files too, like --enable-foo

these files don't usually contain "descriptions" however

Rowe Morehouse
  • 4,451
  • 3
  • 28
  • 28
-2

brew install ignores any options it does not recognize. --with-xml2-config is not a real option of the libxml2 formula; it just gets ignored.

Peter Eisentraut
  • 35,221
  • 12
  • 85
  • 90