213 Commits

Author SHA1 Message Date
Samuel John
7aa2bcc3d5 Python add -F#{python.framework} for brewed Python
Since Python has been removed from superenv and
added as an explicit `depends_on :python`,
we should add
`-F#{HOMEBREW_PREFIX}/opt/python/Framewoks`
so that build tools that don't use
`python-config --ldflags` (as they should!)
can link against brewed Python.
2013-06-05 14:46:02 +02:00
Samuel John
8781950294 Python: Don't use named tuples to get the version
sys.version_info.major is only possible on 2.7+ or so.
Therefore, we now use [0] instead.
2013-06-04 17:14:15 +02:00
Jack Nagel
ba0ce82b68 Revert "Remove default_formula from MPIDependency."
This reverts commit 9aaa89dbe832387249ab3ea4e22a8018cc9fe30a.
2013-06-03 16:52:52 -05: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
0ff6c992c3 depends_on :python Default to min vers 2.6 not 2.7
To support system python on OS X
2013-06-03 21:18:05 +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
Mike McQuaid
404845eaeb Remove default_formula from MPIDependency.
Closes Homebrew/homebrew#19966.
2013-05-24 11:47:07 +01:00
Jack Nagel
04d0cea01c Directory, not folder 2013-05-23 23:33:36 -05:00
Mike McQuaid
92ccfc548e Allow requirements to specify a default formula.
This allows default resolution of requirements without user intervention.

Closes Homebrew/homebrew#19627.
2013-05-10 13:37:41 +01:00
Jack Nagel
7412a71e9d Fix type error in conflict_requirement
Fixes Homebrew/homebrew#19636.
2013-05-06 17:49:36 -05: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
d13a39d1ac Fix missing require in x11_dependency.rb
Fixes Homebrew/homebrew#18918.
2013-04-02 16:18:56 -05:00
Jack Nagel
b82ae7067d Shrink requirements.rb 2013-04-02 15:33:35 -05:00