87 lines
2.8 KiB
Ruby
87 lines
2.8 KiB
Ruby
class Mapnik < Formula
|
|
desc "Toolkit for developing mapping applications"
|
|
homepage "http://www.mapnik.org/"
|
|
head "https://github.com/mapnik/mapnik.git"
|
|
url "https://s3.amazonaws.com/mapnik/dist/v3.0.0/mapnik-v3.0.0.tar.bz2"
|
|
sha256 "c88b1ce48899ffe0d75f9e753dcd427e2b6fd3186b40e04508608b2151c0e7b0"
|
|
|
|
bottle do
|
|
cellar :any
|
|
revision 2
|
|
sha256 "601f75cbb775c748c1a7bef73420235a8a61b60e69ce5b735b7c181c07c739df" => :yosemite
|
|
sha256 "80fdbd2e582886285112aeb921e681d6899b9b9c3b4ad26c778a1e71d495da09" => :mavericks
|
|
sha256 "896ea2edf99d28fd903a4ae32221bf354f940ae397606c2853656e5185fb366a" => :mountain_lion
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "freetype"
|
|
depends_on "harfbuzz"
|
|
depends_on "libpng"
|
|
depends_on "libtiff"
|
|
depends_on "proj"
|
|
depends_on "icu4c"
|
|
depends_on "jpeg"
|
|
depends_on "webp"
|
|
depends_on "gdal" => :optional
|
|
depends_on "postgresql" => :optional
|
|
depends_on "cairo" => :optional
|
|
|
|
if MacOS.version < :mavericks
|
|
depends_on "boost" => "c++11"
|
|
else
|
|
depends_on "boost"
|
|
end
|
|
|
|
needs :cxx11
|
|
|
|
def install
|
|
ENV.cxx11
|
|
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
|
|
harfbuzz = Formula["harfbuzz"].opt_prefix
|
|
webp = Formula["webp"].opt_prefix
|
|
|
|
args = ["CC=\"#{ENV.cc}\"",
|
|
"CXX=\"#{ENV.cxx}\"",
|
|
"PREFIX=#{prefix}",
|
|
"CUSTOM_CXXFLAGS=\"-DBOOST_EXCEPTION_DISABLE\"",
|
|
"ICU_INCLUDES=#{icu}/include",
|
|
"ICU_LIBS=#{icu}/lib",
|
|
"JPEG_INCLUDES=#{jpeg}/include",
|
|
"JPEG_LIBS=#{jpeg}/lib",
|
|
"PNG_INCLUDES=#{libpng}/include",
|
|
"PNG_LIBS=#{libpng}/lib",
|
|
"HB_INCLUDES=#{harfbuzz}/include",
|
|
"HB_LIBS=#{harfbuzz}/lib",
|
|
"WEBP_INCLUDES=#{webp}/include",
|
|
"WEBP_LIBS=#{webp}/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",
|
|
"FREETYPE_CONFIG=#{freetype}/bin/freetype-config",
|
|
"NIK2IMG=False",
|
|
"CPP_TESTS=False", # too long to compile to be worth it
|
|
"INPUT_PLUGINS=all"
|
|
]
|
|
|
|
if build.with? "cairo"
|
|
args << "CAIRO=True" # cairo paths will come from pkg-config
|
|
else
|
|
args << "CAIRO=False"
|
|
end
|
|
args << "GDAL_CONFIG=#{Formula["gdal"].opt_bin}/gdal-config" if build.with? "gdal"
|
|
args << "PG_CONFIG=#{Formula["postgresql"].opt_bin}/pg_config" if build.with? "postgresql"
|
|
|
|
system "./configure", *args
|
|
system "make"
|
|
system "make", "install"
|
|
end
|
|
end
|