aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorSamuel John2013-01-12 18:41:50 +0100
committerAdam Vandenberg2013-01-12 11:21:34 -0800
commita20fb1b0fdab7d202b0f0e10a06e5391f597bc6a (patch)
tree493a29c4a0c82c38ccf8d77863b844740d58824c /Library/Formula
parent59c35b97a3cc744317daa630e2b65db7bf2c84ac (diff)
downloadhomebrew-a20fb1b0fdab7d202b0f0e10a06e5391f597bc6a.tar.bz2
mapnik: Harden build. New: --with-gdal --with-geos
- Mapnik searches for py2cairo -> added dep if --with-cairo - Explicitly give includes and libs for icu, boost, proj, jpeg, libtif, and cairo - pkg-config is not only used for cairo -> moved it out of the `if build.include? 'with-cairo'` block Closes #17032. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/mapnik.rb51
1 files changed, 39 insertions, 12 deletions
diff --git a/Library/Formula/mapnik.rb b/Library/Formula/mapnik.rb
index ae827b7b3..c1a5353d3 100644
--- a/Library/Formula/mapnik.rb
+++ b/Library/Formula/mapnik.rb
@@ -8,6 +8,8 @@ class Mapnik < Formula
head 'https://github.com/mapnik/mapnik.git'
option 'with-cairo', 'Build with Cairo'
+ option 'with-gdal', 'Build with optional "Geospatial Data Abstraction Library"'
+ option 'with-geos', 'Build with the GEOS (Geometry Engine)'
depends_on :libtool => :build
depends_on :freetype
@@ -17,15 +19,23 @@ class Mapnik < Formula
depends_on 'icu4c'
depends_on 'jpeg'
depends_on 'boost'
+ depends_on 'gdal' if build.include? 'with-gdal'
+ depends_on 'geos' if build.include? 'with-geos'
+ depends_on 'pkg-config' => :build
if build.include? 'with-cairo'
- depends_on 'pkg-config' => :build
depends_on 'cairo' => :optional
+ depends_on 'py2cairo'
depends_on 'cairomm' => :optional
end
def install
- icu = Formula.factory("icu4c")
+ 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.include? '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
@@ -33,16 +43,33 @@ class Mapnik < Formula
jobs = Integer(jobs/2)
end
- system "python",
- "scons/scons.py",
- "configure",
- "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
+ args = [ "scons/scons.py",
+ "configure",
+ "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.include? 'cairo'
+ args << "CAIRO_INCLUDES=#{cairo}/include"
+ args << "CAIRO_LIBS=#{cairo}/lib"
+ end
+ args << "GEOS_CONFIG=#{Formula.factory('geos').opt_prefix}/bin/geos-config" if build.include? 'with-geos'
+ args << "GDAL_CONFIG=#{Formula.factory('gdal').opt_prefix}/bin/gdal-config" if build.include? 'with-gdal'
+
+ system "python", *args
+
system "python",
"scons/scons.py",
"install"