90 lines
3.1 KiB
Ruby
90 lines
3.1 KiB
Ruby
class Mapnik < Formula
|
|
desc "Toolkit for developing mapping applications"
|
|
homepage "http://www.mapnik.org/"
|
|
url "https://github.com/mapnik/mapnik/releases/download/v3.0.20/mapnik-v3.0.20.tar.bz2"
|
|
sha256 "77b9de029d59fbb7eebb7e5884dff03074eb4eeaa238e3f4c8ff5a61e01a9f04"
|
|
head "https://github.com/mapnik/mapnik.git"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "9a95ee0966e36612c9e8deccc37c60d2180ddd4d73bb5dd055f4d81ddfcc6208" => :high_sierra
|
|
sha256 "2af4450b7a0a1c95c08f3c75e3351d1f08ea47beb75074188c57890f5c1c76a4" => :sierra
|
|
sha256 "c3c27ec81f31fdd96e3abdca1d90f5b8cc1d4e6bbbeeb5ee03695ffd466e61a4" => :el_capitan
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "boost"
|
|
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
|
|
|
|
needs :cxx11
|
|
|
|
def install
|
|
ENV.cxx11
|
|
|
|
# Work around "error: no member named 'signbit' in the global namespace"
|
|
# encountered when trying to detect boost regex in configure
|
|
ENV.delete("SDKROOT") if DevelopmentTools.clang_build_version >= 900
|
|
|
|
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\"",
|
|
"CUSTOM_DEFINES=-DU_USING_ICU_NAMESPACE=1", # icu4c 61.1 compatability
|
|
"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
|
|
|
|
test do
|
|
assert_equal prefix.to_s, shell_output("#{bin}/mapnik-config --prefix").chomp
|
|
end
|
|
end
|