2010-09-26 20:29:29 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Grass < Formula
|
2010-09-26 20:29:29 +00:00
|
|
|
homepage 'http://grass.osgeo.org/'
|
2014-03-17 18:34:28 +00:00
|
|
|
|
|
|
|
stable do
|
|
|
|
url "http://grass.osgeo.org/grass64/source/grass-6.4.3.tar.gz"
|
|
|
|
sha1 "925da985f3291c41c7a0411eaee596763f7ff26e"
|
|
|
|
|
|
|
|
# Patches that files are not installed outside of the prefix.
|
|
|
|
patch :DATA
|
|
|
|
end
|
|
|
|
|
|
|
|
head do
|
|
|
|
url "https://svn.osgeo.org/grass/grass/trunk"
|
|
|
|
|
|
|
|
patch do
|
|
|
|
url "https://gist.github.com/jctull/0fe3db92a3e7c19fa6e0/raw/42e819f0a9b144de782c94f730dbc4da136e9227/grassPatchHead.diff"
|
|
|
|
sha1 "ffbe31682d8a7605d5548cdafd536f1c785d3a23"
|
|
|
|
end
|
|
|
|
end
|
2012-05-10 14:10:12 +00:00
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
option "without-gui", "Build without WxPython interface. Command line tools still available."
|
|
|
|
|
2013-10-19 23:30:24 +00:00
|
|
|
depends_on :macos => :lion
|
2013-11-14 05:52:22 +00:00
|
|
|
depends_on 'apple-gcc42' if MacOS.version >= :mountain_lion
|
2011-03-19 16:33:50 +00:00
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on "gettext"
|
2012-11-11 03:12:26 +00:00
|
|
|
depends_on "readline"
|
2010-09-26 20:29:29 +00:00
|
|
|
depends_on "gdal"
|
|
|
|
depends_on "libtiff"
|
|
|
|
depends_on "unixodbc"
|
|
|
|
depends_on "fftw"
|
2013-12-31 09:00:47 +00:00
|
|
|
depends_on "wxpython" => :recommended # prefer over OS X's version because of 64bit
|
2013-06-03 22:33:15 +00:00
|
|
|
depends_on :postgresql => :optional
|
2013-01-21 09:33:56 +00:00
|
|
|
depends_on :mysql => :optional
|
2013-10-27 01:49:23 +00:00
|
|
|
depends_on "cairo"
|
2013-01-21 09:33:56 +00:00
|
|
|
depends_on :x11 # needs to find at least X11/include/GL/gl.h
|
2010-09-26 20:29:29 +00:00
|
|
|
|
2012-04-21 19:18:38 +00:00
|
|
|
fails_with :clang do
|
2013-02-09 17:49:01 +00:00
|
|
|
cause "Multiple build failures while compiling GRASS tools."
|
2012-04-21 19:18:38 +00:00
|
|
|
end
|
|
|
|
|
2013-04-21 08:44:24 +00:00
|
|
|
def headless?
|
|
|
|
# The GRASS GUI is based on WxPython. Unfortunately, Lion does not include
|
|
|
|
# this module so we have to drop it.
|
2014-03-06 20:40:26 +00:00
|
|
|
build.without? "gui" or MacOS.version == :lion
|
2013-04-21 08:44:24 +00:00
|
|
|
end
|
|
|
|
|
2010-09-26 20:29:29 +00:00
|
|
|
def install
|
2014-02-25 14:33:37 +00:00
|
|
|
readline = Formula["readline"].opt_prefix
|
|
|
|
gettext = Formula["gettext"].opt_prefix
|
2010-09-26 20:29:29 +00:00
|
|
|
|
2011-04-08 18:16:37 +00:00
|
|
|
args = [
|
|
|
|
"--disable-debug", "--disable-dependency-tracking",
|
2010-09-26 20:29:29 +00:00
|
|
|
"--enable-largefile",
|
|
|
|
"--enable-shared",
|
|
|
|
"--with-cxx",
|
|
|
|
"--without-motif",
|
2013-01-21 09:33:56 +00:00
|
|
|
"--with-python",
|
2010-09-26 20:29:29 +00:00
|
|
|
"--with-blas",
|
|
|
|
"--with-lapack",
|
|
|
|
"--with-sqlite",
|
|
|
|
"--with-odbc",
|
2014-03-06 05:28:31 +00:00
|
|
|
"--with-geos=#{Formula["geos"].opt_bin}/geos-config",
|
2010-09-26 20:29:29 +00:00
|
|
|
"--with-png",
|
2014-02-25 14:33:37 +00:00
|
|
|
"--with-readline-includes=#{readline}/include",
|
|
|
|
"--with-readline-libs=#{readline}/lib",
|
2010-09-26 20:29:29 +00:00
|
|
|
"--with-readline",
|
2014-02-25 14:33:37 +00:00
|
|
|
"--with-nls-includes=#{gettext}/include",
|
|
|
|
"--with-nls-libs=#{gettext}/lib",
|
2010-09-26 20:29:29 +00:00
|
|
|
"--with-nls",
|
|
|
|
"--with-freetype",
|
|
|
|
"--without-tcltk" # Disabled due to compatibility issues with OS X Tcl/Tk
|
|
|
|
]
|
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
unless MacOS::CLT.installed?
|
|
|
|
# On Xcode-only systems (without the CLT), we have to help:
|
|
|
|
args << "--with-macosx-sdk=#{MacOS.sdk_path}"
|
|
|
|
args << "--with-opengl-includes=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers"
|
|
|
|
end
|
|
|
|
|
|
|
|
if headless? or build.without? 'wxmac'
|
2012-04-21 19:18:38 +00:00
|
|
|
args << "--without-wxwidgets"
|
|
|
|
else
|
2014-03-06 05:28:31 +00:00
|
|
|
args << "--with-wxwidgets=#{Formula["wxmac"].opt_bin}/wx-config"
|
2012-04-21 19:18:38 +00:00
|
|
|
end
|
|
|
|
|
2013-08-02 02:46:56 +00:00
|
|
|
args << "--enable-64bit" if MacOS.prefer_64_bit?
|
|
|
|
args << "--with-macos-archs=#{MacOS.preferred_arch}"
|
2010-09-26 20:29:29 +00:00
|
|
|
|
2014-02-25 14:33:37 +00:00
|
|
|
cairo = Formula["cairo"]
|
2013-10-27 01:49:23 +00:00
|
|
|
args << "--with-cairo-includes=#{cairo.include}/cairo"
|
|
|
|
args << "--with-cairo-libs=#{cairo.lib}"
|
2011-04-08 18:16:37 +00:00
|
|
|
args << "--with-cairo"
|
2010-09-26 20:29:29 +00:00
|
|
|
|
|
|
|
# Database support
|
2013-11-28 03:54:46 +00:00
|
|
|
args << "--with-postgres" if build.with? "postgresql"
|
2013-01-12 23:01:57 +00:00
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
if build.with? "mysql"
|
2014-02-25 14:33:37 +00:00
|
|
|
mysql = Formula["mysql"]
|
2013-10-27 01:49:36 +00:00
|
|
|
args << "--with-mysql-includes=#{mysql.include}/mysql"
|
2013-11-19 16:20:52 +00:00
|
|
|
args << "--with-mysql-libs=#{mysql.lib}"
|
2011-04-08 18:16:37 +00:00
|
|
|
args << "--with-mysql"
|
2010-09-26 20:29:29 +00:00
|
|
|
end
|
|
|
|
|
2011-04-08 18:16:37 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}", *args
|
2013-11-14 19:54:52 +00:00
|
|
|
system "make GDAL_DYNAMIC=" # make and make install must be separate steps.
|
|
|
|
system "make GDAL_DYNAMIC= install" # GDAL_DYNAMIC set to blank for r.external compatability
|
2010-09-26 20:29:29 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
2012-04-21 19:18:38 +00:00
|
|
|
if headless?
|
|
|
|
<<-EOS.undent
|
|
|
|
This build of GRASS has been compiled without the WxPython GUI. This is
|
|
|
|
done by default on Lion because there is no stable build of WxPython
|
|
|
|
available to compile against.
|
|
|
|
|
|
|
|
The command line tools remain fully functional.
|
|
|
|
EOS
|
2013-01-21 09:33:56 +00:00
|
|
|
elsif MacOS.version < :lion
|
|
|
|
# On Lion or above, we are very happy with our brewed wxwidgets.
|
2012-04-21 19:18:38 +00:00
|
|
|
<<-EOS.undent
|
|
|
|
GRASS is currently in a transition period with respect to GUI support.
|
|
|
|
The old Tcl/Tk GUI cannot be built using the version of Tcl/Tk provided
|
2013-01-21 09:33:56 +00:00
|
|
|
by OS X. This has the unfortunate consquence of disabling the NVIZ
|
|
|
|
visualization system. A keg-only Tcl/Tk brew or some deep hackery of
|
2013-09-10 13:30:57 +00:00
|
|
|
the GRASS source may be possible ways to get around this.
|
2012-04-21 19:18:38 +00:00
|
|
|
|
2013-09-10 13:30:57 +00:00
|
|
|
Tcl/Tk will eventually be deprecated in GRASS 7 and this version has
|
2013-01-21 09:33:56 +00:00
|
|
|
been built to support the newer wxPython based GUI. However, there is
|
2012-04-21 19:18:38 +00:00
|
|
|
a problem as wxWidgets does not compile as a 64 bit library on OS X
|
2013-01-21 09:33:56 +00:00
|
|
|
which affects Snow Leopard users. In order to remedy this, the GRASS
|
2012-04-21 19:18:38 +00:00
|
|
|
startup script:
|
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
#{prefix}/grass-#{version}/etc/Init.sh
|
2012-04-21 19:18:38 +00:00
|
|
|
|
|
|
|
has been modified to use the OS X system Python and to start it in 32 bit mode.
|
|
|
|
EOS
|
|
|
|
end
|
2010-09-26 20:29:29 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
__END__
|
2012-04-21 21:26:32 +00:00
|
|
|
Remove two lines of the Makefile that try to install stuff to
|
|
|
|
/Library/Documentation---which is outside of the prefix and usually fails due
|
|
|
|
to permissions issues.
|
|
|
|
|
|
|
|
diff --git a/Makefile b/Makefile
|
|
|
|
index f1edea6..be404b0 100644
|
|
|
|
--- a/Makefile
|
|
|
|
+++ b/Makefile
|
|
|
|
@@ -304,8 +304,6 @@ ifeq ($(strip $(MINGW)),)
|
|
|
|
-tar cBf - gem/skeleton | (cd ${INST_DIR}/etc ; tar xBf - ) 2>/dev/null
|
|
|
|
-${INSTALL} gem/gem$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) ${BINDIR} 2>/dev/null
|
|
|
|
endif
|
|
|
|
- @# enable OSX Help Viewer
|
|
|
|
- @if [ "`cat include/Make/Platform.make | grep -i '^ARCH.*darwin'`" ] ; then /bin/ln -sfh "${INST_DIR}/docs/html" /Library/Documentation/Help/GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR} ; fi
|
2014-03-06 20:40:26 +00:00
|
|
|
|
|
|
|
|
2012-04-21 21:26:32 +00:00
|
|
|
install-strip: FORCE
|