10 Commits

Author SHA1 Message Date
Jack Nagel
113125d394 Remove Version#to_a alias
Exposing this as "to_a" was a mistake, versions are not arrays and it
causes incorrect behavior when splatted or using Kernel#Array(). Use the
more correct name "tokens" instead.
2013-06-14 18:37:27 -05:00
Samuel John
33cae6ac42 PythonInstalled: Fix libdir for Python 3.x 2013-06-09 20:37:30 +02:00
Samuel John
4412df2c00 Python: Don't print warning about PYTHONPATH
Authors should use `python.standard_caveats` instead.

* Accessor for python.binary
* Made `python.brewed?` more robust if no python found at all
* python.brewed? is more relaxed now and allows older versions
  of the Python formula.
* Only print about wrining sitecustomize.py and distutils.cfg if
verbose and debug.
2013-06-07 17:58:56 +02:00
Samuel John
1c95045033 Hotfix: Revert Python module 2013-06-06 13:18:32 +02:00
Samuel John
4e8aa8637f PythonInstalled: Don't require superenv
* The python do ... end block does no longer
  require 'superenv' but saves and restores
  the ENV by using ENV.to_hash and `ensure`.
  This should resolve some build problems
  with formulae using `env :std`!
* `python_helper` is now in a module `Python`.
* Imporoved some comments in python_dependency.rb
2013-06-06 12:33:28 +02:00
Samuel John
a3a8bee5b9 depends_on :python sets PYTHONPATH internally
This applies only to non-brewed python:
The user will still have to set his PYTHONPATH
in order to import python modules in an
external python interpreter. However, a
warning will be displayed, now.

Further, during the build, the PYTHONPATH
will be set to Homebrew's global site-packages
so that software (like PyQt and others) that
need to `import sipconfig` in python can
find the brewed sip and its python module.
2013-06-05 17:37:32 +02:00
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
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