From fd333c84054c42503a73408b5d89ae3c89ef2916 Mon Sep 17 00:00:00 2001 From: Thierry Moisan Date: Thu, 11 Jul 2019 22:19:50 -0400 Subject: [PATCH] mapserver 7.4.2 Closes #41884. Signed-off-by: Rui Chen --- Formula/mapserver.rb | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/Formula/mapserver.rb b/Formula/mapserver.rb index 02de1ea9e9..efb36b6ced 100644 --- a/Formula/mapserver.rb +++ b/Formula/mapserver.rb @@ -1,9 +1,8 @@ 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.2.2.tar.gz" - sha256 "287f8dfe10961bc685bb87e118b7aa81382df907b2b3961d6559169b527ba95c" - revision 1 + url "https://download.osgeo.org/mapserver/mapserver-7.4.2.tar.gz" + sha256 "e15497eca57768932822d9f8524fef0b5e328df05b6a1c30bd73f5e5b3e4125d" bottle do cellar :any @@ -26,13 +25,13 @@ class Mapserver < Formula depends_on "postgresql" depends_on "proj" depends_on "protobuf-c" + depends_on "python" def install - # Harfbuzz support requires fribidi and fribidi support requires - # harfbuzz but fribidi currently fails to build with: - # fribidi-common.h:61:12: fatal error: 'glib.h' file not found + ENV.cxx11 + + python_executable = Utils.popen_read("python3 -c 'import sys;print(sys.executable)'").chomp args = std_cmake_args + %w[ - -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python -DWITH_CLIENT_WFS=ON -DWITH_CLIENT_WMS=ON -DWITH_CURL=ON @@ -44,37 +43,34 @@ class Mapserver < Formula -DWITH_KML=ON -DWITH_OGR=ON -DWITH_POSTGIS=ON - -DWITH_PROJ=ON -DWITH_PYTHON=ON -DWITH_SOS=ON -DWITH_WFS=ON - -WITH_CAIRO=ON ] + args << "-DPYTHON_EXECUTABLE=#{python_executable}" + args << "-DPHP_EXTENSION_DIR=#{lib}/php/extensions" # Install within our sandbox inreplace "mapscript/python/CMakeLists.txt" do |s| - s.gsub! "${PYTHON_SITE_PACKAGES}", lib/"python2.7/site-packages" s.gsub! "${PYTHON_LIBRARIES}", "-Wl,-undefined,dynamic_lookup" end - inreplace "mapscript/php/CMakeLists.txt", "${PHP5_EXTENSION_DIR}", lib/"php/extensions" # 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" - # Use Proj 6.0.0 compatibility headers - # https://github.com/mapserver/mapserver/issues/5766 - ENV.append_to_cflags "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" - mkdir "build" do system "cmake", "..", *args system "make", "install" + cd "mapscript/python" do + system "python3", *Language::Python.setup_install_args(prefix) + end end end test do assert_match version.to_s, shell_output("#{bin}/mapserv -v") - system "python2.7", "-c", "import mapscript" + system "python3", "-c", "import mapscript" end end