70 Commits

Author SHA1 Message Date
Mike McQuaid
0df4c6a703 Add modular x11 dependencies.
Fixes Homebrew/homebrew#13638.
2012-08-08 18:19:21 +01:00
Adam Vandenberg
8c8701f268 Allow multiple unsatisfied fatal requirements
Closes Homebrew/homebrew#13335.
2012-08-07 10:49:45 -07:00
Jack Nagel
148617bc11 Move X11 machinery into MacOS::XQuartz namespace
In order to better support Xcode-only systems, where X11 libs and
executables live under /usr/X11 but headers live in the SDK, move the
x11_* helper methods into a new module.

This allows us to keep some of the CLT/Xcode-only and Apple X11/XQuartz
logic hidden from outside code, like ENV.x11.

Since Apple's X11 is actually XQuartz, name the module "MacOS::XQuartz".
2012-08-01 00:31:38 -05:00
Misty De Meo
0c237a8679 Add conflicts_with DSL method
conflicts_with is a thin wrapper around Requirement which simplifies
marking conflicts between formulae.

Closes Homebrew/homebrew#13687.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-07-30 13:47:12 -03:00
Charlie Sharpsteen
0d3578b28d dependencies.rb: Add MPI compiler Requirement
All versions of OS X prior to Lion shipped with some version of Open-MPI, but
without working compiler wrappers for Fortran. Homebrew currently has two
formulae that can supply this software: open-mpi and mpich2.

This commit adds a `MPIDependency` Requirement that can be passed one of four
values when constructed:

    :cc, :cxx, :f90, :f77

This will ensure the `mpi<value>` compiler is available and working. For
example, if `depends_on MPIDependency.new(:cc, :f90)` is used, the Requirement
will search for working `mpicc` and `mpif90` wrappers.

If the required wrappers cannot be found, an error message will be displayed
that prompts the user to install one of the Homebrew formulae that provides
MPI.

For each language passed to a MPIDependency Requirement, environment variables
be will set that point to the compilers.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2012-07-28 09:12:44 -07:00
Jack Nagel
96ee0e90cc Deduplicate requirements
Because of some quirks in how formulae are loaded, DSL methods invoked
in the class definition are called multiple times. This results in, for
example, duplicate dependencies and requirements.

Code that iterates over requirements and takes some action for each can
thus repeat things that shouldn't be repeated, like appending to
environment variables.

Make DependencyCollector's external_deps a Set, and define eql? and hash
on Requirement to prevent these duplicates.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-27 02:50:29 -05:00
Jack Nagel
5a62582b39 Requirement: add modify_build_environment method
Rather than doing type introspection in build.rb, just define a method
to perform the necessary environment setup for Requirements.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-27 02:42:22 -05:00
Jack Nagel
4eeb0e6441 Use new Xcode module
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-25 12:04:41 -05:00
Adam Vandenberg
9cb4c626ae Add :bsdmake dependency 2012-07-10 09:53:03 -07:00
Adam Vandenberg
0cd87229b3 All symbols for autotools dependencies
The symbol versions of :autoconf, :automake and :libtool only activate
for OS X / Xcode combinations that do not provide autotools.
2012-07-10 08:55:17 -07:00
Adam Vandenberg
e9dc02dbb6 Refactor dependencies in preparation for autotools symbol support 2012-07-10 08:54:55 -07:00
Camillo Lugaresi
4488c3546d Better error message for unknown dep symbol 2012-07-01 12:19:37 -05:00
Camillo Lugaresi
4c10eaf332 Add depends_on :libpng as an alias to :x11
Some formulae ask for the x11 environment with ENV.libpng; mirror this
in the new dependency form.
2012-07-01 12:17:49 -05:00
Camillo Lugaresi
1847595168 Simplify DependencyCollector#add 2012-07-01 12:15:09 -05:00
Camillo Lugaresi
243b14a090 depends_on :x11 syntax support 2012-07-01 12:14:06 -05:00
Mike McQuaid
995186a72c Fix Ruby warnings.
Fixes Homebrew/homebrew#11966.
2012-05-01 20:45:17 +08:00
Jack Nagel
15d7e89f0e Implement <=> for Dependency
Fixes Homebrew/homebrew#11587.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-11 18:24:24 -05:00
Adam Vandenberg
6eced20b35 Fix Dependency equality 2012-03-20 22:31:14 -07:00
Adam Vandenberg
07736cb8fa Allow a different package and import name for language deps.
Some times the module to import is different than the module to install
when dealing with external dependencies. This change allows an optional
import name to be specififed when it is different from the module name.

Closes Homebrew/homebrew#11078.
2012-03-20 19:43:41 -07:00
Adam Vandenberg
fee00469f6 New external dependency implementation. 2012-03-10 09:24:07 -08:00