From 0cc4d530dc4725a9f3bcd51565bc06118598bfa3 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Wed, 14 Sep 2016 18:12:47 +0100 Subject: [PATCH] Formula-Cookbook: document :run --- share/doc/homebrew/Formula-Cookbook.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/share/doc/homebrew/Formula-Cookbook.md b/share/doc/homebrew/Formula-Cookbook.md index ea5c3c221a..828ea82752 100644 --- a/share/doc/homebrew/Formula-Cookbook.md +++ b/share/doc/homebrew/Formula-Cookbook.md @@ -121,10 +121,11 @@ Homebrew maintains a special [tap that provides other useful system duplicates]( ```ruby class Foo < Formula + depends_on "pkg-config" => :run depends_on "jpeg" - depends_on "gtk+" => :optional - depends_on "readline" => :recommended depends_on "boost" => "with-icu" + depends_on "readline" => :recommended + depends_on "gtk+" => :optional depends_on :x11 => :optional end ``` @@ -135,12 +136,16 @@ A Symbol (e.g. `:x11`) specifies a [`Requirement`](http://www.rubydoc.info/githu A Hash (e.g. `=>`) specifies a formula dependency with some additional information. Given a single string key, the value can take several forms: -* a Symbol (currently one of `:build`, `:optional`, `:recommended`). +* a Symbol (currently one of `:build`, `:optional`, `:run` or `:recommended`). - `:build` means that dependency is a build-time only dependency so it can be skipped when installing from a bottle or when listing missing dependencies using `brew missing`. - `:optional` generates an implicit `with-foo` option for the formula. This means that, given `depends_on "foo" => :optional`, the user must pass `--with-foo` in order to use the dependency. + - `:run` can mean the dependency is only required at run, or it can be used + to declare build dependencies such as `pkg-config` are needed during + runtime as well, which will silence the audit warning. `:run` currently + implies `:build` as well. - `:recommended` generates an implicit `without-foo` option, meaning that the dependency is enabled by default and the user must pass `--without-foo` to disable this dependency. The default