From 6e06ddf7d480c856a27dd2f23efae9f34b538aa3 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 25 Mar 2012 17:27:03 -0500 Subject: qscintilla: use versioned python lib directory Fixes #10366. Signed-off-by: Jack Nagel --- Library/Formula/qscintilla2.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/qscintilla2.rb b/Library/Formula/qscintilla2.rb index 2e8cf059d..6482d2801 100644 --- a/Library/Formula/qscintilla2.rb +++ b/Library/Formula/qscintilla2.rb @@ -9,7 +9,7 @@ class Qscintilla2 < Formula depends_on 'sip' def install - ENV.prepend 'PYTHONPATH', "#{HOMEBREW_PREFIX}/lib/python", ':' + ENV.prepend 'PYTHONPATH', "#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages", ':' cd 'Qt4' do inreplace 'qscintilla.pro' do |s| @@ -27,7 +27,7 @@ class Qscintilla2 < Formula cd 'Python' do system 'python', 'configure.py', "-o", lib, "-n", include, "--apidir=#{prefix}/qsci", - "--destdir=#{lib}/python/PyQt4", + "--destdir=#{lib}/#{which_python}/site-packages/PyQt4", "--sipdir=#{share}/sip" system 'make' system 'make', 'install' @@ -35,9 +35,12 @@ class Qscintilla2 < Formula end def caveats; <<-EOS.undent - This formula includes a Python module that will not be functional until you - amend your PYTHONPATH: - export PYTHONPATH=#{HOMEBREW_PREFIX}/lib/python:$PYTHONPATH + For non-Homebrew Python, you need to amend your PYTHONPATH like so: + export PYTHONPATH=#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages:$PYTHONPATH EOS end + + def which_python + "python" + `python -c 'import sys;print(sys.version[:3])'`.strip + end end -- cgit v1.2.3