85 Commits

Author SHA1 Message Date
Jack Nagel
9c8a73cf41 Allow requirements to specify env options 2012-12-26 14:37:03 -06:00
Jack Nagel
f8d253950f Add a small DSL for setting requirement options 2012-12-26 14:37:02 -06:00
Jack Nagel
1c56cda4f1 Factor out MySQL and Postgres requirements 2012-11-08 16:01:59 -06:00
Jack Nagel
d1f754c02e Allow requirements to record tags
To allow

  depends_on :x11 => :optional

and friends to work as expected, make requirements record any tags and
add special handling to the X11Dependency to record both a minimum
version and additional tags.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-25 14:28:53 -05:00
Jack Nagel
a1af5a6cc3 Move requirement subclasses to a separate file
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-25 12:51:36 -05:00
Misty De Meo
bbfb6400c7 Manage Requirements using ComparableSet
ComparableSet only allows a single object of a given class,
choosing the object with the greatest value. This was mainly created
for Requirements, so that, e.g., two X11Dependencies of differing
strictness don't both end up in the same requirement set.

Fixes Homebrew/homebrew#15240.
2012-10-15 09:46:29 -05:00
samueljohn
33b2a29e14 Replace mentions of easy_install by pip
Use this chance to correct minor typos.

Closes Homebrew/homebrew#15242.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-10-02 08:29:21 -07:00
Charlie Sharpsteen
5229bbf304 Clarify that brew does not provide XQuartz
Reword the `X11Dependency` error message so that it is clear that an installer
must be downloaded.

Ref Homebrew/homebrew#14851.
2012-09-10 21:49:08 -07:00
Charlie Sharpsteen
e873411694 XCodeDependency: Clarify that Xcode.app is needed
Clarify the error message arising from XCodeDependency so that users know
XCode.app is needed and that just installing the CLT does not count as
"installing XCode".
2012-08-24 19:38:03 -07:00
Mike McQuaid
1f8af42fee Don't use XQuartz for e.g. :libpng on 10.8.
XQuartz isn't added to the default library paths so if something is
linked against a Homebrew libpng then it doesn't work against the
XQuartz libpng. The CLT provides X11 on Lion so don't request users
install XQuartz if it isn't needed on Mountain Lion.

Fixes Homebrew/homebrew#14325.
2012-08-22 13:34:26 -07:00
Jack Nagel
166a9ba0ed Deprecate MacOS.version? style methods
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:25:59 -05:00
Adam Vandenberg
4a948c4132 Add special :xcode dependency
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-17 15:35:54 -05:00
Jack Nagel
c38bc4fd67 Recursively expand requirements in FormulaInstaller
Currently FormulaInstaller "forgets" about the requirements of
dependencies, as dependencies are recursively expanded by the first
FormulaInstaller instance, and then ignored by subsequent instances to
prevent duplicate installation attempts. These requirements then have
their messages displayed, but the fatal check is skipped and thus no
exception is raised.

Now that we have Formula#recursive_requirements, we can mirror what we
are doing with dependencies and recursively expand requirements up
front.

While at it, fix a bug in determining Requirement equality that resulted
in unique requirements being eliminated from a formula's set of
recursive requirements.

Fixes Homebrew/homebrew#12290.
Fixes Homebrew/homebrew#14084.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-14 23:26:50 -05:00
Jack Nagel
c9f824b54a Make Set available globally
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-12 00:58:31 -05:00
Adam Vandenberg
928734c0bd Document dependencies.rb 2012-08-09 20:32:57 -07:00
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