106 lines
3.6 KiB
Ruby
106 lines
3.6 KiB
Ruby
class Mapnik < Formula
|
|
desc "Toolkit for developing mapping applications"
|
|
homepage "https://mapnik.org/"
|
|
license "LGPL-2.1-or-later"
|
|
revision 14
|
|
head "https://github.com/mapnik/mapnik.git", branch: "master"
|
|
|
|
stable do
|
|
url "https://github.com/mapnik/mapnik/releases/download/v3.1.0/mapnik-v3.1.0.tar.bz2"
|
|
sha256 "43d76182d2a975212b4ad11524c74e577576c11039fdab5286b828397d8e6261"
|
|
|
|
# Allow Makefile to use PYTHON set in the environment. Remove in the next release.
|
|
patch do
|
|
url "https://github.com/mapnik/mapnik/commit/a53c90172c664d29cd877302de9790a6ee9b5330.patch?full_index=1"
|
|
sha256 "9e0e06fd64d16b9fbe59d72402e805c94335397385ab57c49a6b468b9cc5a39c"
|
|
end
|
|
end
|
|
|
|
livecheck do
|
|
url :stable
|
|
strategy :github_latest
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_ventura: "68355025b86d76329b51e1dd87884b80f77e7312a78843cac3e470b5483a64a6"
|
|
sha256 cellar: :any, arm64_monterey: "3f3301e67e53bab4b9d2009a3a88a817cd65c12344c7f3107c4b3b7b19a87922"
|
|
sha256 cellar: :any, arm64_big_sur: "096c04a8ffed91b414fa0fe8b032e6ec4dee4f2c97ba2e10e0528fb5ccb2d203"
|
|
sha256 cellar: :any, monterey: "d287416d72cb6c8fd7804c9f036365cf95c30bdadd1edd084b69752a495344e8"
|
|
sha256 cellar: :any, big_sur: "4425ba437fe79dc15a11e9fff5f0d4f0064ae6dc9339cbc8fefbdf16db24ba1b"
|
|
sha256 cellar: :any, catalina: "45a0236d1958ee2bd3b70108e50b30e47db194cfd02aa4e7323c0e7d0c70e971"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "30eeaa43fc6aa85315c09b254cc707e0f0bced3329af3039f61c68e82b51e900"
|
|
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-turbo"
|
|
depends_on "libpng"
|
|
depends_on "libpq"
|
|
depends_on "libtiff"
|
|
depends_on "proj"
|
|
depends_on "webp"
|
|
|
|
def install
|
|
ENV.cxx11
|
|
ENV["PYTHON"] = "python3.9"
|
|
|
|
# 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-turbo"].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["libpq"].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
|
|
]
|
|
|
|
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
|