Last active
September 7, 2016 21:42
-
-
Save turboladen/1977f19a7664669868a3f86ed840b429 to your computer and use it in GitHub Desktop.
Homebrew formula for install mapserver 6.2.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OldMapserver < Formula | |
desc "Publish spatial data and interactive mapping apps to the web" | |
homepage "http://mapserver.org/" | |
url "http://download.osgeo.org/mapserver/mapserver-6.2.2.tar.gz" | |
sha256 "79b81286dde030704f59a668a19e5b01af27bb35d05b3daf91cefe06ca29ffd9" | |
bottle do | |
cellar :any | |
sha256 "8bfa96a50ee83117bd929afc4ed1c6ce3e9e82a7e6da6328e4ca500c4fbb096d" => :yosemite | |
sha256 "7ed6da72cbb724c1dfe92cc701bf292ddac02788dc7976f7a81e5e367b472262" => :mavericks | |
sha256 "28b3fbf520436359a81d6b0a6875c30cb6f8bdb147ebc14f5860f7cf2c61ad47" => :mountain_lion | |
end | |
option "with-fastcgi", "Build with fastcgi support" | |
option "with-geos", "Build support for GEOS spatial operations" | |
option "with-postgresql", "Build support for PostgreSQL as a data source" | |
env :userpaths | |
depends_on "freetype" | |
depends_on "libpng" | |
depends_on "swig" => :build | |
depends_on "giflib" | |
depends_on "gd" | |
depends_on "proj" | |
depends_on "gdal" | |
depends_on "geos" => :optional | |
depends_on "postgresql" => :optional unless MacOS.version >= :lion | |
depends_on "fcgi" if build.with? "fastcgi" | |
depends_on "cairo" => :optional | |
# This patch can be removed when this is merged https://github.com/mapserver/mapserver/pull/5113 | |
patch :DATA | |
def install | |
args = [ | |
"--prefix=#{prefix}", | |
"--with-proj", | |
"--with-gdal", | |
"--with-ogr", | |
"--with-wfs" | |
] | |
args << "--with-geos" if build.with? "geos" | |
args << "--with-cairo" if build.with? "cairo" | |
if build.with? "postgresql" | |
if MacOS.version >= :lion # Lion ships with PostgreSQL libs | |
args << "--with-postgis" | |
else | |
args << "--with-postgis=#{HOMEBREW_PREFIX}/bin/pg_config" | |
end | |
end | |
args << "--with-fastcgi=#{HOMEBREW_PREFIX}" if build.with? "fastcgi" | |
unless MacOS::CLT.installed? | |
inreplace "configure", "_JTOPDIR=`echo \"$_ACJNI_FOLLOWED\" | sed -e 's://*:/:g' -e 's:/[^/]*$::'`", | |
"_JTOPDIR='#{MacOS.sdk_path}/System/Library/Frameworks/JavaVM.framework/Headers'" | |
end | |
system "./configure", *args | |
system "make" | |
system "make", "install" | |
cd "mapscript/ruby" do | |
bin_ruby = ENV.fetch('MAPSCRIPT_RUBY', 'ruby') | |
puts "Installing with ruby: #{bin_ruby}" | |
system "#{bin_ruby} extconf.rb && make && make install" | |
end | |
end | |
def caveats; <<-EOS.undent | |
The Mapserver CGI executable is #{bin}/mapserv | |
EOS | |
end | |
test do | |
system "#{bin}/mapserver-config", "--version" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't seem to be working with Ruby 2.3.x.
Yet still works just fine with Ruby 2.2.x.