Commit Graph
42 Commits
Author SHA1 Message Date
Adam Vandenberg 9a813c2b38 Add minimum OS X version requirement
Closes #19998.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-06-16 20:36:50 -07:00
Jack Nagel 70069c5d75 Separate formula conflicts from requirements
Closes #20357.
2013-06-09 13:45:25 -05:00
Samuel John 0b50110107 Python 2.x and 3.x support
New `depends_on :python` Dependency.
New `depends_on :python3` Dependency.

To avoid having multiple formulae with endings -py2 and -py3,
we will handle support for different pythons (2.x vs. 3.x)
in the same formula.
Further brewed vs. external python will be transparently supported.

The formula also gets a new object `python`, which is false if
no Python is available or the user has disabled it. Otherwise
it is defined and provides several support methods:

python.site_packages # the site-packages in the formula's Cellar
python.global_site_packages
python.binary # the full path to the python binary
python.prefix
python.version
python.version.major
python.version.minor
python.xy # => e.g. "python2.7"
python.incdir # includes of python
python.libdir # the python dylib library
python.pkg_config_path # used internally by brew
python.from_osx?
python.framework?
python.universal?
python.pypy?
python.standard_caveats # Text to set PYTHONPATH for python.from_osx?
python.if3then3 # => "" for 2.x and to "3" for 3.x.

Further, to avoid code duplication, `python` takes an optional
block that is run twice if the formula defines depends_on
:python AND :python3.

python do
  system python, 'setup.py', "--prefix=#{prefix}"
end

Read more in the Homebrew wiki.
2013-06-03 17:29:43 +02:00
Jack Nagel e337b12f72 PostgresqlDependency: use canonical name for default formula 2013-06-02 17:14:42 -05:00
Mike McQuaid 2d9329f14e Allow requirements to specify a default formula.
This allows default resolution of requirements without user intervention.

Closes #19627.
2013-05-10 13:37:41 +01:00
Misty De Meo 29e4f5f54e ArchRequirement: takes a single arch
Fixes #19646.
2013-05-06 22:50:01 -05:00
Adam Vandenberg c9cd3008e2 Add :hg build requirement.
Closes #19074.
2013-04-17 10:01:38 -07:00
Jack Nagel 5372719246 Shrink requirements.rb 2013-04-02 15:33:35 -05:00
Jack Nagel 657acb58be Simplify setting this ivar 2013-04-02 15:33:34 -05:00
Jack Nagel adbf1f36a3 Fix chicken scheme imports 2013-04-02 15:33:34 -05:00
Jack Nagel da184c25e9 Move x86_64 Requirement into core
Closes #18886.
2013-04-02 13:17:24 -05:00
Jack Nagel a82080bd2b Use satisfy syntax for CLTDependency 2013-04-02 13:17:23 -05:00
Jack Nagel 17e83c4f24 Fix X11 env setup 2013-04-01 18:50:56 -05:00
Jack Nagel d839567f1f Requirement: env DSL is evaluated in context of self, not ENV
This was meant to support:

  env do |req|
    append_path 'PATH', req.some_method
    ...
  end

i.e., the block was evaluated in the context of ENV. But it turned out
to be not so useful after all, so I'm ripping it out before something
actually depends on it.
2013-04-01 16:17:35 -05:00
Jack Nagel 594590e5ad Fix X11 proxy constant lookup under 1.9+ 2013-02-19 10:15:52 -06:00
Jack Nagel c4db67fc9b Establish a convention for Requirement names
The name attribute of requirements is used when generating options for
the :optional and :recommended dependency tags.

Unless otherwise specified, the name attribute of a Requirement will be
populated by stripping any module prefixes from the beginning and
"Dependency" or "Requirement" from end of the class name and downcasing
the result.

Closes #17759.
2013-02-12 16:26:10 -06:00
Jack Nagel ccbc8a7d4a ConflictRequirement: pass argument to superclass initalizer 2013-02-09 18:33:26 -06:00
Jack Nagel 117470b7c9 LanguageModuleDependency: foward args to superclass initalizer 2013-02-08 00:12:49 -06:00
Jack Nagel f81eb97d96 Ensure :cairo and :pixman resolve to standard formula deps
We do not use X11 to satisfy these deps for consistency reasons,
but we should continue to support the symbols for compatibility.
2013-02-02 00:09:28 -06:00
Jack Nagel 7522e4883b Proper recursive expansion of requirements with filtering
Expand requirements recursively while applying the same optional? and
recommended? filters that dependencies are run through. Options
generated by requirements are now checked against the correct list of
requirements, eliminating the temporary "best guess" logic in the
installer.
2013-01-31 15:40:06 -06:00
Jack Nagel 8df3f14d15 Create proxy classes for "partial" X11 dependencies
When a formula's dependency tree contains more than one X11 dependency,
they are de-duplicated by comparing the min_version attribute. However,
this can result in broken dependency trees if one of the X11Dependency
objects was actually specified as e.g. `:libpng`.

In practice, this only matters when one or more of the dependencies has
additional metadata that makes it distinct from the rest, i.e. an
:optional or :recommended tag.

To combat this, make these special, "partial" X11 dependencies instances
of different classes so that they are not de-duped.

It will still be necessary, at the time when requirements are expanded
by the installer, to de-duplicate any remaining X11 dependencies after
applying the optional/recommended filters in order to avoid duplicated
modifications to the environment (as ENV.x11 is not idempotent).

c.f. #17369.
2013-01-31 15:39:26 -06:00
Jack Nagel 8432089982 LanguageModuleDependency: call super() to generate tags list
Fixes #17379.
2013-01-28 11:23:25 -06:00
Jack Nagel ca134adfbb Allow specifying a name attribute for X11Dependency 2013-01-28 10:35:14 -06:00
Jack Nagel 90e254f8b3 Invoke super() in requirement subclasses 2013-01-27 21:20:09 -06:00
Jack Nagel bf1ce53366 Split dependency classes into separate files 2013-01-26 20:30:05 -06:00
Jack Nagel 97310a0fed Tag Xcode and CLT requirements as build-time
This way they can be skipped when installing bottles.
2013-01-26 12:14:50 -06:00
samueljohn 7bd5acd385 Add "depends_on :clt" 2013-01-26 12:14:50 -06:00
Jack Nagel 21efd0803c Infer path to be added for requirements that search PATH
When a requirement is specified like:

  satisfy { which "foo" }

There is no reason that we should inject all of ENV.userpaths! into the
build environment. Instead, infer the directory to be added to PATH from
the Pathname that is returned.

This is another step towards condensing the "which program" requirements
down into a one-liner DSL element.
2013-01-22 14:59:10 -06:00
Jack Nagel 3ad7174f7d Use new requirement syntax 2013-01-21 17:36:34 -06:00
Jack Nagel 3f1eb3d18a Block-style env DSL examples 2013-01-21 17:24:11 -06:00
Jack Nagel 3270fd2cd9 ENV.with_build_environment 2013-01-21 17:24:10 -06:00
Adam Vandenberg 119ec0090a fix grammar 2013-01-14 15:18:12 -08:00
Xiyue Deng f104952349 Add tex requirement
* Detect `latex' and `bibtex' commands.
* Recommend installing MacTeX when no LaTeX installation is found.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-13 18:25:35 -08:00
Samuel John e13842ac47 Make MPIRequirement satisfied on Xcode-only Macs
Closes #16409.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-01-10 16:02:07 -06:00
Alex Reece 52015c91dc Add support for external ocaml deps via opam
Closes #16280.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-04 21:50:31 -08:00
Jack Nagel bb03a39ad8 Allow requirements to specify env options 2012-12-26 14:37:03 -06:00
Jack Nagel 5639cc7f38 Add a small DSL for setting requirement options 2012-12-26 14:37:02 -06:00
Jack Nagel 84cc549473 Fix typo in postgres requirement 2012-11-08 16:24:52 -06:00
Jack Nagel 781bd000d0 Factor out MySQL and Postgres requirements 2012-11-08 16:01:59 -06:00
Jack Nagel afa5150fab Move conflict message into conflict class 2012-11-06 17:48:34 -06:00
Jack Nagel fb490be58b 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 0bb42201a0 Move requirement subclasses to a separate file
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-25 12:51:36 -05:00