2011-06-27 15:24:13 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Mapserver < Formula
|
|
|
|
homepage 'http://mapserver.org/'
|
2012-07-06 18:53:59 +00:00
|
|
|
url 'http://download.osgeo.org/mapserver/mapserver-6.0.3.tar.gz'
|
2012-07-06 19:06:02 +00:00
|
|
|
sha1 'd7aa1041c6d9a46da7f5e29ae1b66639d5d050ab'
|
2011-06-27 15:24:13 +00:00
|
|
|
|
2012-08-27 02:25:29 +00:00
|
|
|
option "with-fastcgi", "Build with fastcgi support"
|
|
|
|
option "with-geos", "Build support for GEOS spatial operations"
|
|
|
|
option "with-php", "Build PHP MapScript module"
|
|
|
|
option "with-postgresql", "Build support for PostgreSQL as a data source"
|
|
|
|
|
2012-09-02 08:06:33 +00:00
|
|
|
depends_on :freetype
|
|
|
|
depends_on :libpng
|
|
|
|
depends_on 'giflib'
|
2013-02-18 02:37:05 +00:00
|
|
|
depends_on 'gd' => %w{with-freetype}
|
2011-06-27 15:24:13 +00:00
|
|
|
depends_on 'proj'
|
|
|
|
depends_on 'gdal'
|
|
|
|
|
2012-08-27 02:25:29 +00:00
|
|
|
depends_on 'geos' if build.include? 'with-geos'
|
2012-09-05 04:04:01 +00:00
|
|
|
depends_on 'postgresql' if build.include? 'with-postgresql' and not MacOS.version >= :lion
|
2012-08-27 02:25:29 +00:00
|
|
|
depends_on 'fcgi' if build.include? 'with-fastcgi'
|
2011-09-16 05:30:50 +00:00
|
|
|
|
2012-09-02 08:06:33 +00:00
|
|
|
def patches
|
|
|
|
# Fix clang compilation issue, remove on future release
|
|
|
|
# See http://trac.osgeo.org/mapserver/changeset/12809
|
|
|
|
# Fix msGetMarkerSize() called on unloaded pixmap symbol
|
|
|
|
# https://github.com/mapserver/mapserver/issues/4225
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2011-09-16 05:30:50 +00:00
|
|
|
args = [
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--with-proj",
|
|
|
|
"--with-gdal",
|
|
|
|
"--with-ogr",
|
|
|
|
]
|
|
|
|
|
2012-09-02 08:06:33 +00:00
|
|
|
args << "--with-geos" if build.include? 'with-geos'
|
|
|
|
args << "--with-php=/usr/include/php" if build.include? 'with-php'
|
2011-09-16 05:30:50 +00:00
|
|
|
|
2012-08-27 02:25:29 +00:00
|
|
|
if build.include? 'with-postgresql'
|
2012-09-05 04:04:01 +00:00
|
|
|
if MacOS.version >= :lion # Lion ships with PostgreSQL libs
|
2012-08-27 02:25:29 +00:00
|
|
|
args << "--with-postgis"
|
2011-09-16 05:30:50 +00:00
|
|
|
else
|
2012-08-27 02:25:29 +00:00
|
|
|
args << "--with-postgis=#{HOMEBREW_PREFIX}/bin/pg_config"
|
2011-09-16 05:30:50 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-09-02 08:06:33 +00:00
|
|
|
args << "--with-fastcgi=#{HOMEBREW_PREFIX}" if build.include? 'with-fastcgi'
|
2012-03-21 16:09:57 +00:00
|
|
|
|
2012-09-02 08:06:33 +00:00
|
|
|
system "./configure", *args
|
2011-06-27 15:24:13 +00:00
|
|
|
system "make"
|
2012-09-02 08:06:33 +00:00
|
|
|
libexec.install "mapscriptvars"
|
2012-01-23 15:19:48 +00:00
|
|
|
bin.install %w(mapserv shp2img legend shptree shptreevis
|
2012-09-02 08:06:33 +00:00
|
|
|
shptreetst scalebar sortshp tile4ms
|
2012-01-23 15:19:48 +00:00
|
|
|
msencrypt mapserver-config)
|
2011-09-16 05:30:50 +00:00
|
|
|
|
2012-08-27 02:25:29 +00:00
|
|
|
if build.include? 'with-php'
|
2011-09-16 05:30:50 +00:00
|
|
|
prefix.install %w(mapscript/php/php_mapscript.so)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
2012-09-02 08:06:33 +00:00
|
|
|
The Mapserver CGI executable is #{bin}/mapserv
|
2011-09-16 05:30:50 +00:00
|
|
|
|
|
|
|
If you built the PHP option:
|
|
|
|
* Add the following line to php.ini:
|
|
|
|
extension="#{prefix}/php_mapscript.so"
|
|
|
|
* Execute "php -m"
|
|
|
|
* You should see MapScript in the module list
|
|
|
|
EOS
|
2011-06-27 15:24:13 +00:00
|
|
|
end
|
2012-09-02 08:06:33 +00:00
|
|
|
|
|
|
|
def test
|
|
|
|
system "#{bin}/mapserver-config", "--version"
|
|
|
|
end
|
2011-06-27 15:24:13 +00:00
|
|
|
end
|
2012-03-21 16:09:57 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/renderers/agg/include/agg_renderer_outline_aa.h b/renderers/agg/include/agg_renderer_outline_aa.h
|
|
|
|
index 5ff3f20..7a14588 100644
|
|
|
|
--- a/renderers/agg/include/agg_renderer_outline_aa.h
|
|
|
|
+++ b/renderers/agg/include/agg_renderer_outline_aa.h
|
|
|
|
@@ -1365,7 +1365,6 @@ namespace mapserver
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
void profile(const line_profile_aa& prof) { m_profile = &prof; }
|
|
|
|
const line_profile_aa& profile() const { return *m_profile; }
|
|
|
|
- line_profile_aa& profile() { return *m_profile; }
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
int subpixel_width() const { return m_profile->subpixel_width(); }
|
2012-08-16 15:43:27 +00:00
|
|
|
diff --git a/mapsymbol.c b/mapsymbol.c
|
|
|
|
index 164a0ac..f9dcb20 100644
|
|
|
|
--- a/mapsymbol.c
|
|
|
|
+++ b/mapsymbol.c
|
|
|
|
@@ -601,6 +601,10 @@ int msGetMarkerSize(symbolSetObj *symbolset, styleObj *style, int *width, int *h
|
|
|
|
}
|
2012-09-02 08:06:33 +00:00
|
|
|
|
2012-08-16 15:43:27 +00:00
|
|
|
symbol = symbolset->symbol[style->symbol];
|
|
|
|
+ if (symbol->type == MS_SYMBOL_PIXMAP && !symbol->pixmap_buffer) {
|
|
|
|
+ if (MS_SUCCESS != msPreloadImageSymbol(MS_MAP_RENDERER(symbolset->map), symbol))
|
|
|
|
+ return MS_FAILURE;
|
|
|
|
+ }
|
|
|
|
if(style->size == -1) {
|
|
|
|
size = MS_NINT( msSymbolGetDefaultSize(symbol) * scalefactor );
|
|
|
|
}
|