89 lines
2.7 KiB
Ruby
89 lines
2.7 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-7.6.4.tar.gz"
|
|
sha256 "b46c884bc42bd49873806a05325872e4418fc34e97824d4e13d398e86ea474ac"
|
|
license "MIT"
|
|
revision 6
|
|
|
|
livecheck do
|
|
url "https://mapserver.org/download.html"
|
|
regex(/href=.*?mapserver[._-]v?(\d+(?:\.\d+)+)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_monterey: "329b8b0d9171e1ddd78caccfa2181387a4a96fd6fa0d793d8e2df08e4d483e28"
|
|
sha256 cellar: :any, arm64_big_sur: "9e9f70c6e73ebf54c17e724c9258ebfe551154a6d136110db7a84dd8d9179b5d"
|
|
sha256 cellar: :any, monterey: "c54dfcf1ee80c006d2577a62b8d611b5deb1296e76eec74d9267ec26ccd13299"
|
|
sha256 cellar: :any, big_sur: "27208daf7f0f2d4c54a7acb06ac64534a073e7211e687ecc8764042f996cfa65"
|
|
sha256 cellar: :any, catalina: "47697fff3cfd46f892a42ec9ff649a72521aadf6dc8a2519966b5d24f3e19e0a"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "80ad31e2bb0aaf61cb589cfe32b302179a5184aaa699bf51c4816575fff7a524"
|
|
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 "postgresql"
|
|
depends_on "proj"
|
|
depends_on "protobuf-c"
|
|
depends_on "python@3.9"
|
|
|
|
uses_from_macos "curl"
|
|
|
|
on_linux do
|
|
depends_on "gcc"
|
|
end
|
|
|
|
fails_with gcc: "5"
|
|
|
|
def install
|
|
ENV.cxx11
|
|
|
|
args = %W[
|
|
-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=#{Formula["python@3.9"].opt_bin/"python3"}
|
|
-DPHP_EXTENSION_DIR=#{lib}/php/extensions
|
|
-DCMAKE_INSTALL_RPATH=#{rpath}
|
|
]
|
|
|
|
# Install within our sandbox
|
|
inreplace "mapscript/python/CMakeLists.txt" do |s|
|
|
s.gsub! "${PYTHON_LIBRARIES}", "-Wl,-undefined,dynamic_lookup"
|
|
end
|
|
|
|
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
|
|
system "cmake", "--build", "build"
|
|
system "cmake", "--install", "build"
|
|
|
|
cd "build/mapscript/python" do
|
|
system Formula["python@3.9"].opt_bin/"python3", *Language::Python.setup_install_args(prefix)
|
|
end
|
|
end
|
|
|
|
test do
|
|
assert_match version.to_s, shell_output("#{bin}/mapserv -v")
|
|
system Formula["python@3.9"].opt_bin/"python3", "-c", "import mapscript"
|
|
end
|
|
end
|