aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorJack Nagel2013-02-02 16:19:09 -0600
committerJack Nagel2013-02-02 16:20:45 -0600
commited95d413c98d7e0e4d188991309a047f93d0be9c (patch)
treea1899c866428e4104d08b16c1fd098cde68987c2 /Library/Formula
parentd6ac079f97d0f3c727635a6b64d46ef450fedfe1 (diff)
downloadhomebrew-ed95d413c98d7e0e4d188991309a047f93d0be9c.tar.bz2
mapnik: use optional deps
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/mapnik.rb31
1 files changed, 13 insertions, 18 deletions
diff --git a/Library/Formula/mapnik.rb b/Library/Formula/mapnik.rb
index e43ca9267..99e492196 100644
--- a/Library/Formula/mapnik.rb
+++ b/Library/Formula/mapnik.rb
@@ -7,10 +7,7 @@ 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 'pkg-config' => :build
depends_on :libtool
depends_on :freetype
depends_on :libpng
@@ -19,14 +16,13 @@ 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
+ depends_on 'gdal' => :optional
+ depends_on 'geos' => :optional
+ depends_on 'cairo' => :optional
- if build.include? 'with-cairo'
- depends_on 'cairo' => :optional
+ if build.with? 'cairo'
depends_on 'py2cairo'
- depends_on 'cairomm' => :optional
+ depends_on 'cairomm'
end
def install
@@ -35,13 +31,12 @@ class Mapnik < Formula
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'
+ 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
- if jobs > 2
- jobs = Integer(jobs/2)
- end
+ jobs = ENV.make_jobs.to_i
+ jobs /= 2 if jobs > 2
args = [ "scons/scons.py",
"configure",
@@ -61,12 +56,12 @@ class Mapnik < Formula
"PROJ_INCLUDES=#{proj}/include",
"PROJ_LIBS=#{proj}/lib" ]
- if build.include? 'cairo'
+ if build.with? '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'
+ 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'
system "python", *args