99 lines
3.3 KiB
Ruby
99 lines
3.3 KiB
Ruby
class Mapnik < Formula
|
|
desc "Toolkit for developing mapping applications"
|
|
homepage "https://mapnik.org/"
|
|
url "https://github.com/mapnik/mapnik/releases/download/v3.1.0/mapnik-v3.1.0.tar.bz2"
|
|
sha256 "43d76182d2a975212b4ad11524c74e577576c11039fdab5286b828397d8e6261"
|
|
license "LGPL-2.1-or-later"
|
|
revision 10
|
|
head "https://github.com/mapnik/mapnik.git", branch: "master"
|
|
|
|
livecheck do
|
|
url :stable
|
|
strategy :github_latest
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_monterey: "36fb7b653dc307abd2a2e651fce70a9cd26d654d5c5246e8897b9223af233ff5"
|
|
sha256 cellar: :any, arm64_big_sur: "ce98179cc220bcb4ebd21e75070a51f51827a6cf57d1f3c9c352ab5e25c5142e"
|
|
sha256 cellar: :any, monterey: "f396081ed525d2bdcdceca8ee2e97cd77147d38d2242f893140597e901e9f5ef"
|
|
sha256 cellar: :any, big_sur: "28df77440d6afdd58b92bdb0724cc384154b43108ef2f403636693d989646736"
|
|
sha256 cellar: :any, catalina: "3d6f7c0a733ae01a27bd7cdbaa000d677f1eba5d7ce94227a56eee8426065dbd"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "16b058888065c463e0a724b65fe2eb0f0d4746c86b6955bdfa145fe961913861"
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "python@3.9" => :build
|
|
depends_on "boost"
|
|
depends_on "cairo"
|
|
depends_on "freetype"
|
|
depends_on "gdal"
|
|
depends_on "harfbuzz"
|
|
depends_on "icu4c"
|
|
depends_on "jpeg"
|
|
depends_on "libpng"
|
|
depends_on "libtiff"
|
|
depends_on "postgresql"
|
|
depends_on "proj"
|
|
depends_on "webp"
|
|
|
|
def install
|
|
ENV.cxx11
|
|
|
|
ENV["PYTHON"] = Formula["python@3.9"].opt_bin/"python3"
|
|
|
|
# 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
|
|
|
|
boost = Formula["boost"].opt_prefix
|
|
freetype = Formula["freetype"].opt_prefix
|
|
harfbuzz = Formula["harfbuzz"].opt_prefix
|
|
icu = Formula["icu4c"].opt_prefix
|
|
jpeg = Formula["jpeg"].opt_prefix
|
|
libpng = Formula["libpng"].opt_prefix
|
|
libtiff = Formula["libtiff"].opt_prefix
|
|
proj = Formula["proj"].opt_prefix
|
|
webp = Formula["webp"].opt_prefix
|
|
|
|
args = %W[
|
|
CC=#{ENV.cc}
|
|
CXX=#{ENV.cxx}
|
|
PREFIX=#{prefix}
|
|
BOOST_INCLUDES=#{boost}/include
|
|
BOOST_LIBS=#{boost}/lib
|
|
CAIRO=True
|
|
CPP_TESTS=False
|
|
FREETYPE_CONFIG=#{freetype}/bin/freetype-config
|
|
GDAL_CONFIG=#{Formula["gdal"].opt_bin}/gdal-config
|
|
HB_INCLUDES=#{harfbuzz}/include
|
|
HB_LIBS=#{harfbuzz}/lib
|
|
ICU_INCLUDES=#{icu}/include
|
|
ICU_LIBS=#{icu}/lib
|
|
INPUT_PLUGINS=all
|
|
JPEG_INCLUDES=#{jpeg}/include
|
|
JPEG_LIBS=#{jpeg}/lib
|
|
NIK2IMG=False
|
|
PG_CONFIG=#{Formula["postgresql"].opt_bin}/pg_config
|
|
PNG_INCLUDES=#{libpng}/include
|
|
PNG_LIBS=#{libpng}/lib
|
|
PROJ_INCLUDES=#{proj}/include
|
|
PROJ_LIBS=#{proj}/lib
|
|
TIFF_INCLUDES=#{libtiff}/include
|
|
TIFF_LIBS=#{libtiff}/lib
|
|
WEBP_INCLUDES=#{webp}/include
|
|
WEBP_LIBS=#{webp}/lib
|
|
]
|
|
|
|
inreplace "Makefile", "PYTHON = python", "PYTHON = python3"
|
|
|
|
system "./configure", *args
|
|
system "make"
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
output = shell_output("#{bin}/mapnik-config --prefix").chomp
|
|
assert_equal prefix.to_s, output
|
|
end
|
|
end
|