homebrew-core/Formula/mapserver.rb

81 lines
2.9 KiB
Ruby

class Mapserver < Formula
desc "Publish spatial data and interactive mapping apps to the web"
homepage "https://mapserver.org/"
url "https://download.osgeo.org/mapserver/mapserver-8.0.0.tar.gz"
sha256 "bb7ee625eb6fdce9bd9851f83664442845d70d041e449449e88ac855e97d773c"
license "MIT"
livecheck do
url "https://mapserver.org/download.html"
regex(/href=.*?mapserver[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any, arm64_monterey: "175b599a5ef18c75fabcc96524653e4e92a0cb2fc754c3ad267cd03bdc233450"
sha256 cellar: :any, arm64_big_sur: "0c9366746c6db9a80f5ab05df0550f02cfe684247bd6b677d0e420ff47c0e224"
sha256 cellar: :any, monterey: "8288bb05c59b3eb17e285ac9f3499506e1f1c54ab8c5b0af6518b9175e0899e6"
sha256 cellar: :any, big_sur: "1b0ce61cf6a859d9177ff89393c8c9a4a03a259782ec1933bea52cea1505f859"
sha256 cellar: :any, catalina: "32e38b9e4b9739c9d91dc2f21935e889d7e821959b77854902c79a4984ea43ac"
sha256 cellar: :any_skip_relocation, x86_64_linux: "6d36a6546b3e0cdd5b3c9608d852c4893f553dabba6cba32d36f3532dc52ace3"
end
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "swig" => :build
depends_on "cairo"
depends_on "fcgi"
depends_on "freetype"
depends_on "gd"
depends_on "gdal"
depends_on "geos"
depends_on "giflib"
depends_on "libpng"
depends_on "libpq"
depends_on "proj"
depends_on "protobuf-c"
depends_on "python@3.10"
uses_from_macos "curl"
fails_with gcc: "5"
def python3
"python3.10"
end
def install
# Install within our sandbox
inreplace "mapscript/python/CMakeLists.txt", "${Python_LIBRARIES}", "-Wl,-undefined,dynamic_lookup" if OS.mac?
system "cmake", "-S", ".", "-B", "build", *std_cmake_args,
"-DCMAKE_INSTALL_RPATH=#{rpath}",
"-DWITH_CLIENT_WFS=ON",
"-DWITH_CLIENT_WMS=ON",
"-DWITH_CURL=ON",
"-DWITH_FCGI=ON",
"-DWITH_FRIBIDI=OFF",
"-DWITH_GDAL=ON",
"-DWITH_GEOS=ON",
"-DWITH_HARFBUZZ=OFF",
"-DWITH_KML=ON",
"-DWITH_OGR=ON",
"-DWITH_POSTGIS=ON",
"-DWITH_PYTHON=ON",
"-DWITH_SOS=ON",
"-DWITH_WFS=ON",
"-DPYTHON_EXECUTABLE=#{which(python3)}",
"-DPHP_EXTENSION_DIR=#{lib}/php/extensions"
system "cmake", "--build", "build"
system "cmake", "--install", "build"
cd "build/mapscript/python" do
system python3, *Language::Python.setup_install_args(prefix, python3)
end
end
test do
assert_match version.to_s, shell_output("#{bin}/mapserv -v")
system python3, "-c", "import mapscript"
end
end