aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authornibbles 2bits2012-04-02 20:24:54 -0700
committerJack Nagel2012-04-11 01:03:22 -0500
commit124cdb6995835678d8f12cdc6e43960fb6cf4c9f (patch)
treefd8b627952949877b6f8c3eab610187f4053d180 /Library/Formula
parent80ad46264ea128098789bcd20b9cb2f52412a9b0 (diff)
downloadhomebrew-124cdb6995835678d8f12cdc6e43960fb6cf4c9f.tar.bz2
mapnik: fix compile error with system Python
Mapnik by default tries to install to the site-packages in /System when brewed against system Python. This causes a build error because that directory is not writeable. Mapnik correctly determines the versioned site-packages name without modification, but for Homebrew it needs the proper prefix. * Add the standard `which_python` function to the formula. * Add a scons argument for `PYTHON_PREFIX` * Add the standard caveat for `PYTHONPATH`. Discussed upstream: https://github.com/mapnik/mapnik/issues/1155 and tested on Lion against the system Python. Fixes #11389 Closes #11407. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/mapnik.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/Library/Formula/mapnik.rb b/Library/Formula/mapnik.rb
index 8625db7cf..1c3ee0c35 100644
--- a/Library/Formula/mapnik.rb
+++ b/Library/Formula/mapnik.rb
@@ -26,9 +26,20 @@ class Mapnik < Formula
"JOBS=#{ENV.make_jobs}",
"PREFIX=#{prefix}",
"ICU_INCLUDES=#{icu.include}",
- "ICU_LIBS=#{icu.lib}"
+ "ICU_LIBS=#{icu.lib}",
+ "PYTHON_PREFIX=#{prefix}" # Install to Homebrew's site-packages
system "python",
"scons/scons.py",
"install"
end
+
+ def caveats; <<-EOS.undent
+ 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