Files
tigerbrew/Library/Formula/mapnik.rb
T
Samuel John 0b50110107 Python 2.x and 3.x support
New `depends_on :python` Dependency.
New `depends_on :python3` Dependency.

To avoid having multiple formulae with endings -py2 and -py3,
we will handle support for different pythons (2.x vs. 3.x)
in the same formula.
Further brewed vs. external python will be transparently supported.

The formula also gets a new object `python`, which is false if
no Python is available or the user has disabled it. Otherwise
it is defined and provides several support methods:

python.site_packages # the site-packages in the formula's Cellar
python.global_site_packages
python.binary # the full path to the python binary
python.prefix
python.version
python.version.major
python.version.minor
python.xy # => e.g. "python2.7"
python.incdir # includes of python
python.libdir # the python dylib library
python.pkg_config_path # used internally by brew
python.from_osx?
python.framework?
python.universal?
python.pypy?
python.standard_caveats # Text to set PYTHONPATH for python.from_osx?
python.if3then3 # => "" for 2.x and to "3" for 3.x.

Further, to avoid code duplication, `python` takes an optional
block that is run twice if the formula defines depends_on
:python AND :python3.

python do
  system python, 'setup.py', "--prefix=#{prefix}"
end

Read more in the Homebrew wiki.
2013-06-03 17:29:43 +02:00

110 lines
3.3 KiB
Ruby

require 'formula'
class Mapnik < Formula
homepage 'http://www.mapnik.org/'
url 'https://github.com/downloads/mapnik/mapnik/mapnik-v2.1.0.tar.bz2'
sha1 'b1c6a138e65a5e20f0f312a559e2ae7185adf5b6'
# batch for building against boost >1.52
# can be removed at Mapnik >= 2.1.1
# https://github.com/mapnik/mapnik/issues/1716
def patches
DATA
end
head 'https://github.com/mapnik/mapnik.git'
depends_on 'pkg-config' => :build
depends_on :python
depends_on :libtool
depends_on :freetype
depends_on :libpng
depends_on 'libtiff'
depends_on 'proj'
depends_on 'icu4c'
depends_on 'jpeg'
depends_on 'boost'
depends_on 'gdal' => :optional
depends_on 'postgresql' => :optional
depends_on 'geos' => :optional
depends_on 'cairo' => :optional
if build.with? 'cairo'
depends_on 'py2cairo'
depends_on 'cairomm'
end
def install
icu = Formula.factory("icu4c").opt_prefix
boost = Formula.factory('boost').opt_prefix
proj = Formula.factory('proj').opt_prefix
jpeg = Formula.factory('jpeg').opt_prefix
libtiff = Formula.factory('libtiff').opt_prefix
cairo = Formula.factory('cairo').opt_prefix if build.with? 'cairo'
# mapnik compiles can take ~1.5 GB per job for some .cpp files
# so lets be cautious by limiting to CPUS/2
jobs = ENV.make_jobs.to_i
jobs /= 2 if jobs > 2
args = [ "CC=\"#{ENV.cc}\"",
"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",
"TIFF_INCLUDES=#{libtiff}/include",
"TIFF_LIBS=#{libtiff}/lib",
"BOOST_INCLUDES=#{boost}/include",
"BOOST_LIBS=#{boost}/lib",
"PROJ_INCLUDES=#{proj}/include",
"PROJ_LIBS=#{proj}/lib" ]
if build.with? 'cairo'
args << "CAIRO=True" # cairo paths will come from pkg-config
else
args << "CAIRO=False"
end
args << "GEOS_CONFIG=#{Formula.factory('geos').opt_prefix}/bin/geos-config" if build.with? 'geos'
args << "GDAL_CONFIG=#{Formula.factory('gdal').opt_prefix}/bin/gdal-config" if build.with? 'gdal'
args << "PG_CONFIG=#{Formula.factory('postgresql').opt_prefix}/bin/pg_config" if build.with? 'postgresql'
python do
system python, "scons/scons.py", "configure", *args
system python, "scons/scons.py", "install"
end
end
def caveats
python.standard_caveats if python
end
end
__END__
diff --git a/src/json/feature_collection_parser.cpp b/src/json/feature_collection_parser.cpp
index 3faeda7..51ad824 100644
--- a/src/json/feature_collection_parser.cpp
+++ b/src/json/feature_collection_parser.cpp
@@ -20,12 +20,17 @@
*
*****************************************************************************/
+// TODO https://github.com/mapnik/mapnik/issues/1658
+#include <boost/version.hpp>
+#if BOOST_VERSION >= 105200
+#define BOOST_SPIRIT_USE_PHOENIX_V3
+#endif
+
// mapnik
#include <mapnik/json/feature_collection_parser.hpp>
#include <mapnik/json/feature_collection_grammar.hpp>
// boost
-#include <boost/version.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/support_multi_pass.hpp>