Method: Formula.depends_on

Defined in:

.depends_on(dep) ⇒ Object

The dependencies for this formula. Use strings for the names of other formulae. Homebrew provides some :special dependencies for stuff that requires certain extra handling (often changing some ENV vars or deciding if to use the system provided version or not.) <pre># `:build` means this dep is only needed during build. depends_on “cmake” => :build</pre> <pre>depends_on “homebrew/dupes/tcl-tk” => :optional</pre> <pre># `:recommended` dependencies are built by default. # But a `–without-…` option is generated to opt-out. depends_on “readline” => :recommended</pre> <pre># `:optional` dependencies are NOT built by default. # But a `–with-…` options is generated. depends_on “glib” => :optional</pre> <pre># If you need to specify that another formula has to be built with/out # certain options (note, no `–` needed before the option): depends_on “zeromq” => “with-pgm” depends_on “qt” => [“with-qtdbus”, “developer”] # Multiple options.</pre> <pre># Optional and enforce that boost is built with `–with-c++11`. depends_on “boost” => [:optional, “with-c++11”]</pre> <pre># If a dependency is only needed in certain cases: depends_on “sqlite” if MacOS.version == :leopard depends_on :xcode # If the formula really needs full Xcode. depends_on :macos => :lion # Needs at least OS X Lion (10.7). depends_on :arch => :intel # If this formula only builds on Intel architecture. depends_on :arch => :x86_64 # If this formula only builds on Intel x86 64-bit. depends_on :arch => :ppc # Only builds on PowerPC? depends_on :ld64 # Sometimes ld fails on `MacOS.version < :leopard`. Then use this. depends_on :x11 => :optional # X11/XQuartz components. depends_on :osxfuse # Permits the use of the upstream signed binary or our source package. depends_on :tuntap # Does the same thing as above. This is vital for Yosemite and above. <pre># It is possible to only depend on something if # `build.with?` or `build.without? “another_formula”`: depends_on “postgresql” if build.without? “sqlite”

<pre># Python 2.7: depends_on “python”</pre> <pre># Python 2.7 but use system Python where possible depends_on “python” if MacOS.version <= :snow_leopard</pre> <pre># Python 3.x if the `–with-python3` is given to `brew install example` depends_on “python3” => :optional</pre>

# File 'Library/Homebrew/formula.rb', line 2210

def depends_on(dep)
  specs.each { |spec| spec.depends_on(dep) }