homebrew-core/Formula/mapserver.rb

84 lines
2.4 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.3.tar.gz"
sha256 "0e0db478dabddee50498cd89669340f160a0437fed5a9f823022b19e2f150365"
license "MIT"
revision 2
livecheck do
url "https://mapserver.org/download.html"
regex(/href=.*?mapserver[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any, big_sur: "383800e38f0fca0ce658159e828049b3d1cf1aa74abd39b2a40bacaf0e5f3550"
sha256 cellar: :any, catalina: "1078b18f57fccc14a09bdf847738a099eb9fe23b79df904667d3ef4454ea1710"
sha256 cellar: :any, mojave: "0b32e025ea3c5fd55cc6bb7e6fdf91012007d9f5fd7a9866b1ebcb135e94091f"
end
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "swig@3" => :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@7"
depends_on "protobuf-c"
depends_on "python@3.9"
uses_from_macos "curl"
def install
ENV.cxx11
args = std_cmake_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
]
args << "-DPYTHON_EXECUTABLE=#{Formula["python@3.9"].opt_bin/"python3"}"
args << "-DPHP_EXTENSION_DIR=#{lib}/php/extensions"
# Install within our sandbox
inreplace "mapscript/python/CMakeLists.txt" do |s|
s.gsub! "${PYTHON_LIBRARIES}", "-Wl,-undefined,dynamic_lookup"
end
# Using rpath on python module seems to cause problems if you attempt to
# import it with an interpreter it wasn't built against.
# 2): Library not loaded: @rpath/libmapserver.1.dylib
args << "-DCMAKE_SKIP_RPATH=ON"
mkdir "build" do
system "cmake", "..", *args
system "make", "install"
cd "mapscript/python" do
system Formula["python@3.9"].opt_bin/"python3", *Language::Python.setup_install_args(prefix)
end
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