homebrew-core/Formula/mapserver.rb

80 lines
2.3 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.1.tar.gz"
sha256 "2d250874d55bee44e0dbbb3a38e612f8572730705edada00c6ab8b2c9e890581"
revision 2
bottle do
cellar :any
sha256 "0163f58a94ee7bfd1ed488cd4f17400776ee3ea81dc70464ba06e38ea5323bb4" => :big_sur
sha256 "cec1b9cc79516438b6d3059d6683532a0496b61f9d5ddc5e01c2303dc9bf63bd" => :catalina
sha256 "fc60de6d05e4f08f7b1aa12b573227e7c9d24bae4c0b289b0d0ac5f3485b51bd" => :mojave
sha256 "cc1407aabd178afcb49fcc6becf08d69554c6109b48efa3e653af5457cff8760" => :high_sierra
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"
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