2010-11-09 22:05:44 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Mapnik < Formula
|
|
|
|
homepage 'http://www.mapnik.org/'
|
2013-06-04 02:45:48 +00:00
|
|
|
url 'http://mapnik.s3.amazonaws.com/dist/v2.2.0/mapnik-v2.2.0.tar.bz2'
|
|
|
|
sha1 'e493ad87ca83471374a3b080f760df4b25f7060d'
|
2013-03-10 19:32:57 +00:00
|
|
|
|
2013-11-17 23:35:49 +00:00
|
|
|
# can be removed at Mapnik > 2.2.0
|
|
|
|
# https://github.com/mapnik/mapnik/issues/1973
|
|
|
|
def patches
|
|
|
|
DATA
|
|
|
|
end
|
2011-10-18 20:48:00 +00:00
|
|
|
head 'https://github.com/mapnik/mapnik.git'
|
2010-11-09 22:05:44 +00:00
|
|
|
|
2013-02-02 22:19:09 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2013-11-05 17:39:18 +00:00
|
|
|
depends_on 'freetype'
|
|
|
|
depends_on 'libpng'
|
2010-11-09 22:05:44 +00:00
|
|
|
depends_on 'libtiff'
|
|
|
|
depends_on 'proj'
|
|
|
|
depends_on 'icu4c'
|
2012-09-02 08:06:09 +00:00
|
|
|
depends_on 'jpeg'
|
2010-11-09 22:05:44 +00:00
|
|
|
depends_on 'boost'
|
2013-02-02 22:19:09 +00:00
|
|
|
depends_on 'gdal' => :optional
|
2013-05-22 23:25:50 +00:00
|
|
|
depends_on 'postgresql' => :optional
|
2013-02-02 22:19:09 +00:00
|
|
|
depends_on 'cairo' => :optional
|
2012-09-02 08:06:09 +00:00
|
|
|
|
2013-06-04 02:45:48 +00:00
|
|
|
depends_on 'py2cairo' if build.with? 'cairo'
|
2010-11-09 22:05:44 +00:00
|
|
|
|
|
|
|
def install
|
2014-02-27 03:58:29 +00:00
|
|
|
icu = Formula["icu4c"].opt_prefix
|
|
|
|
boost = Formula["boost"].opt_prefix
|
|
|
|
proj = Formula["proj"].opt_prefix
|
|
|
|
jpeg = Formula["jpeg"].opt_prefix
|
|
|
|
libpng = Formula["libpng"].opt_prefix
|
|
|
|
libtiff = Formula["libtiff"].opt_prefix
|
|
|
|
freetype = Formula["freetype"].opt_prefix
|
2013-02-02 22:19:09 +00:00
|
|
|
|
2012-04-10 18:04:32 +00:00
|
|
|
# mapnik compiles can take ~1.5 GB per job for some .cpp files
|
|
|
|
# so lets be cautious by limiting to CPUS/2
|
2013-02-02 22:19:09 +00:00
|
|
|
jobs = ENV.make_jobs.to_i
|
|
|
|
jobs /= 2 if jobs > 2
|
2012-04-10 18:04:32 +00:00
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
args = [ "CC=\"#{ENV.cc}\"",
|
2013-01-12 17:41:50 +00:00
|
|
|
"CXX=\"#{ENV.cxx}\"",
|
|
|
|
"JOBS=#{jobs}",
|
|
|
|
"PREFIX=#{prefix}",
|
|
|
|
"ICU_INCLUDES=#{icu}/include",
|
|
|
|
"ICU_LIBS=#{icu}/lib",
|
|
|
|
"PYTHON_PREFIX=#{prefix}", # Install to Homebrew's site-packages
|
|
|
|
"JPEG_INCLUDES=#{jpeg}/include",
|
|
|
|
"JPEG_LIBS=#{jpeg}/lib",
|
2013-11-05 17:39:18 +00:00
|
|
|
"PNG_INCLUDES=#{libpng}/include",
|
|
|
|
"PNG_LIBS=#{libpng}/lib",
|
2013-01-12 17:41:50 +00:00
|
|
|
"TIFF_INCLUDES=#{libtiff}/include",
|
|
|
|
"TIFF_LIBS=#{libtiff}/lib",
|
|
|
|
"BOOST_INCLUDES=#{boost}/include",
|
|
|
|
"BOOST_LIBS=#{boost}/lib",
|
|
|
|
"PROJ_INCLUDES=#{proj}/include",
|
2013-11-05 17:39:18 +00:00
|
|
|
"PROJ_LIBS=#{proj}/lib",
|
2013-12-02 23:28:18 +00:00
|
|
|
"FREETYPE_CONFIG=#{freetype}/bin/freetype-config"
|
2013-11-05 17:39:18 +00:00
|
|
|
]
|
2013-01-12 17:41:50 +00:00
|
|
|
|
2013-02-02 22:19:09 +00:00
|
|
|
if build.with? 'cairo'
|
2013-03-13 19:05:53 +00:00
|
|
|
args << "CAIRO=True" # cairo paths will come from pkg-config
|
|
|
|
else
|
|
|
|
args << "CAIRO=False"
|
2013-01-12 17:41:50 +00:00
|
|
|
end
|
2014-02-27 03:58:29 +00:00
|
|
|
args << "GDAL_CONFIG=#{Formula["gdal"].opt_prefix}/bin/gdal-config" if build.with? 'gdal'
|
|
|
|
args << "PG_CONFIG=#{Formula["postgresql"].opt_prefix}/bin/pg_config" if build.with? 'postgresql'
|
2013-01-12 17:41:50 +00:00
|
|
|
|
2014-01-04 13:10:39 +00:00
|
|
|
system "python", "scons/scons.py", "configure", *args
|
|
|
|
system "python", "scons/scons.py", "install"
|
2012-04-03 03:24:54 +00:00
|
|
|
end
|
2010-11-09 22:05:44 +00:00
|
|
|
end
|
2013-11-17 23:35:49 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/bindings/python/mapnik_text_placement.cpp b/bindings/python/mapnik_text_placement.cpp
|
|
|
|
index 0520132..4897c28 100644
|
|
|
|
--- a/bindings/python/mapnik_text_placement.cpp
|
|
|
|
+++ b/bindings/python/mapnik_text_placement.cpp
|
|
|
|
@@ -194,7 +194,11 @@ struct ListNodeWrap: formatting::list_node, wrapper<formatting::list_node>
|
|
|
|
ListNodeWrap(object l) : formatting::list_node(), wrapper<formatting::list_node>()
|
|
|
|
{
|
|
|
|
stl_input_iterator<formatting::node_ptr> begin(l), end;
|
|
|
|
- children_.insert(children_.end(), begin, end);
|
|
|
|
+ while (begin != end)
|
|
|
|
+ {
|
|
|
|
+ children_.push_back(*begin);
|
|
|
|
+ ++begin;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
/* TODO: Add constructor taking variable number of arguments.
|