From d02dbcb65577a39b92afabaae11dc21a66abaad2 Mon Sep 17 00:00:00 2001 From: Alexei Sholik Date: Thu, 30 Jun 2011 02:02:17 +0300 Subject: [PATCH] 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 --- Formula/python.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Formula/python.rb b/Formula/python.rb index 2adb808efab..b6df52a39fb 100644 --- a/Formula/python.rb +++ b/Formula/python.rb @@ -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