2010-11-09 22:05:44 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Mapnik < Formula
|
2012-04-09 23:59:49 +00:00
|
|
|
url 'https://github.com/downloads/mapnik/mapnik/mapnik-v2.0.1.tar.bz2'
|
|
|
|
md5 'e3dd09991340e2568b99f46bac34b0a8'
|
2010-11-09 22:05:44 +00:00
|
|
|
homepage 'http://www.mapnik.org/'
|
2011-10-18 20:48:00 +00:00
|
|
|
head 'https://github.com/mapnik/mapnik.git'
|
2010-11-09 22:05:44 +00:00
|
|
|
|
|
|
|
depends_on 'pkg-config' => :build
|
|
|
|
depends_on 'libtiff'
|
|
|
|
depends_on 'jpeg'
|
|
|
|
depends_on 'proj'
|
|
|
|
depends_on 'icu4c'
|
|
|
|
depends_on 'boost'
|
|
|
|
depends_on 'cairomm' => :optional
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV.x11 # for freetype-config
|
|
|
|
|
|
|
|
icu = Formula.factory("icu4c")
|
2011-10-18 20:48:00 +00:00
|
|
|
system "python",
|
|
|
|
"scons/scons.py",
|
|
|
|
"configure",
|
|
|
|
"CC=\"#{ENV.cc}\"",
|
|
|
|
"CXX=\"#{ENV.cxx}\"",
|
|
|
|
"JOBS=#{ENV.make_jobs}",
|
|
|
|
"PREFIX=#{prefix}",
|
|
|
|
"ICU_INCLUDES=#{icu.include}",
|
2012-04-03 03:24:54 +00:00
|
|
|
"ICU_LIBS=#{icu.lib}",
|
|
|
|
"PYTHON_PREFIX=#{prefix}" # Install to Homebrew's site-packages
|
2011-10-18 20:48:00 +00:00
|
|
|
system "python",
|
|
|
|
"scons/scons.py",
|
|
|
|
"install"
|
2010-11-09 22:05:44 +00:00
|
|
|
end
|
2012-04-03 03:24:54 +00:00
|
|
|
|
|
|
|
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
|
2010-11-09 22:05:44 +00:00
|
|
|
end
|