Python: Add `pythonw` for non-Framework installs

We hardlink pythonw and pythonw2.7 to python and python2.7 respectively.
They may be used by 3rd party tools (like PyQt4) and, for some reason, python's
install script doesn't provide them when doing a non-framework install.

The man page (which comes with Mac OS X) on pythonw reads:

    As of Python 2.5, python and pythonw are interchangeable; both execute
    Python in the context of an application bundle, which means they have access
    to the Graphical User Interface; thus both can, when properly programmed,
    display windows, dialogs, etc.

See also this discussion https://github.com/mxcl/homebrew/issues/6176.

Hardlinks are placed in the same directory in which python and python2.7 reside
in order to be symlinked to /usr/local/bin as part of the installation process.
This also ensures a clean uninstall of the formula.

Closes Homebrew/homebrew#6248.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
master
Alexei Sholik 2011-06-30 02:02:17 +03:00 committed by Charlie Sharpsteen
parent 2de1eda048
commit d02dbcb655
1 changed files with 7 additions and 0 deletions

View File

@ -84,6 +84,13 @@ class Python < Formula
# Symlink the prefix site-packages into the cellar.
ln_s prefix_site_packages, site_packages
# This is a fix for better interoperability with pyqt.
# See Issue #6176.
if not as_framework?
(bin+"pythonw").make_link bin+"python"
(bin+"pythonw2.7").make_link bin+"python2.7"
end
# Tell distutils-based installers where to put scripts
scripts_folder.mkpath
(effective_lib+"python2.7/distutils/distutils.cfg").write <<-EOF.undent