From d366b28923ed31aafe914a3f27873b2b7605e903 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 7 Sep 2009 01:06:08 +0100 Subject: Dependency resolution Specify dependencies in your formula's deps function. You can return an Array, String or Hash, eg: def deps { :optional => 'libogg', :required => %w[flac sdl], :recommended => 'cmake' } end Note currently the Hash is flattened and qualifications are ignored. If you only return an Array or String, the qualification is assumed to be :required. Other packaging systems have problems when it comes to packages requiring a specific version of a package, or some patches that may not work well with other software. With Homebrew we have some options: 1. If the formula is vanilla but an older version we can cherry-pick the old version and install it in the Cellar in parallel, but just not symlink it into /usr/local while forcing the formula that depends on it to link to that one and not any other versions of it. 2. If the dependency requires patches then we shouldn't install this for use by any other tools, (I guess this needs to be decided on a per-situation basis). It can be installed into the parent formula's prefix, and not symlinked into /usr/local. In this case the dependency's Formula derivation should be saved in the parent formula's file (check git or flac for an example of this). Both the above can be done currently with hacks, so I'll flesh out a proper way sometime this week. --- Library/Formula/mysql.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Library/Formula/mysql.rb') diff --git a/Library/Formula/mysql.rb b/Library/Formula/mysql.rb index 662d8320d..5cfb8be41 100644 --- a/Library/Formula/mysql.rb +++ b/Library/Formula/mysql.rb @@ -6,8 +6,7 @@ class Mysql :optional depends_on 'far' => :recommended depends_on Sew.new end Sew would be a formula you have defined in this Formula file. This is useful, eg. see Python's formula. Formula specified in this fashion cannot be linked into the HOMEBREW_PREFIX, they are considered private libraries. This allows you to create custom installations that are very specific to your formula. More features to come, like specifying versions --- Library/Formula/mysql.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Library/Formula/mysql.rb') diff --git a/Library/Formula/mysql.rb b/Library/Formula/mysql.rb index 5cfb8be41..76fd2a7c4 100644 --- a/Library/Formula/mysql.rb +++ b/Library/Formula/mysql.rb @@ -5,9 +5,7 @@ class Mysql