6 Commits

Author SHA1 Message Date
Mike McQuaid
a42ac924dd language_module_dependency: don't use build_env.
This is so a e.g. brewed Python's modules can be found by superenv.

References Homebrew/homebrew#26229.
Closes Homebrew/homebrew#26197.
2014-01-30 09:51:42 +01:00
Jack Nagel
92ac63fd94 LanguageModuleDependency: remove code that only worked by accident
The array elements here are individual arguments to exec, not a string
to pass to the shell; this only appeared to work. In reality, `opam
list` accepts "|" as valid argument, and the command works fine without
grepping the output.
2014-01-11 19:37:19 -06:00
Samuel John
ceb01c3124 Fix (Python) language dependency test
System python (for 2.x) does not provide `python2` binary.
So use `python` again.

For Python 3.x we still use `python3`.
2013-06-03 22:12:30 +02:00
Samuel John
c524895666 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
b322020338 Reduce allocations in dependency construction
By always passing around a single, unnested array rather than splatting
and then defensively flattening and compacting things, we can avoid
allocating a bunch of unnecessary arrays. This gives a performance boost
of roughly 4% when enumerating 2500 formulae, and has the side effect of
cleaning up the dependency API.
2013-05-06 16:08:50 -05:00
Jack Nagel
b82ae7067d Shrink requirements.rb 2013-04-02 15:33:35 -05:00