/
mapserver.rb
81 lines (71 loc) 路 2.98 KB
/
mapserver.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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.1.tar.gz"
sha256 "79d23595ef95d61d3d728ae5e60850a3dbfbf58a46953b4fdc8e6e0ffe5748ba"
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_ventura: "bd6e36e5dd27044bb6bb76fa10b44bd43e43f48193d1820b34362ae7de4d3bdb"
sha256 cellar: :any, arm64_monterey: "4d1d4906bb6cb9bd484b6c2c38a2ed7433105bf6d4df916f79621fdf1c205d18"
sha256 cellar: :any, arm64_big_sur: "0f785bee9e338033415641d5e44bf454335d03b114858096d073a110504d8578"
sha256 cellar: :any, ventura: "16a86032b66c2614905ff6d18ea3744cdba9d0383976cf1734f8aa200aaa3384"
sha256 cellar: :any, monterey: "90ad05f462d0c0116a3795a78602ebcec5091009277048c0fd0a5d5f479236f0"
sha256 cellar: :any, big_sur: "fb9ffdcd5bf3dfeb32944aff13f5dc4b88c38aada6e880fa819524d4d860cf27"
sha256 cellar: :any_skip_relocation, x86_64_linux: "a8b66c3644b17c553f6c3018654301a590979da0114d54857be99df1364cef1b"
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.11"
uses_from_macos "curl"
fails_with gcc: "5"
def python3
"python3.11"
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