diff --git a/Formula/grass.rb b/Formula/grass.rb index 92bc4fa5bf..7f92b141b1 100644 --- a/Formula/grass.rb +++ b/Formula/grass.rb @@ -8,6 +8,15 @@ def mysql? ARGV.include? "--with-mysql" end +def headless? + # The GRASS GUI is based on WxPython. Unfortunately, Lion does not include + # this module so we have to drop it. + # + # This restriction can be lifted once WxMac hits a stable release that is + # 64-bit capable. + ARGV.include? '--without-gui' or MacOS.lion? +end + class Grass < Formula homepage 'http://grass.osgeo.org/' url 'http://grass.osgeo.org/grass64/source/grass-6.4.2.tar.gz' @@ -28,10 +37,19 @@ class Grass < Formula # are not installed outside of the prefix. def patches; DATA; end + fails_with :clang do + build 318 + + cause <<-EOS.undent + Multiple build failures while compiling GRASS tools. + EOS + end + def options [ ['--with-postgres', 'Specify PostgreSQL as a dependency'], - ['--with-mysql', 'Specify MySQL as a dependency'] + ['--with-mysql', 'Specify MySQL as a dependency'], + ['--without-gui', 'Build without WxPython interface. Command line tools still available.'] ] end @@ -50,7 +68,6 @@ class Grass < Formula "--with-x", "--without-motif", "--with-python=/usr/bin/python-config", - "--with-wxwidgets=/usr/bin/wx-config", "--with-blas", "--with-lapack", "--with-sqlite", @@ -69,6 +86,12 @@ class Grass < Formula "--without-tcltk" # Disabled due to compatibility issues with OS X Tcl/Tk ] + if headless? + args << "--without-wxwidgets" + else + args << "--with-wxwidgets=/usr/bin/wx-config" + end + if MacOS.prefer_64_bit? args << "--enable-64bit" args << "--with-macosx-archs=x86_64" @@ -102,22 +125,33 @@ class Grass < Formula end def caveats - caveats = <<-EOS -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 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 the GRASS source may be possible -ways to get around this around this. + 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. -Tcl/Tk will eventually be depreciated in GRASS 7 and this version has been built -to support the newer wxPython based GUI. However, there is a problem as -wxWidgets does not compile as a 64 bit library on OS X which affects Snow -Leopard users. In order to remedy this, the GRASS startup script: + The command line tools remain fully functional. + EOS + else + <<-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 + 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 + the GRASS source may be possible ways to get around this around this. - #{prefix}/grass-6.4.0/etc/Init.sh + Tcl/Tk will eventually be depreciated in GRASS 7 and this version has + been built to support the newer wxPython based GUI. However, there is + a problem as wxWidgets does not compile as a 64 bit library on OS X + which affects Snow Leopard users. In order to remedy this, the GRASS + startup script: -has been modified to use the OS X system Python and to start it in 32 bit mode. - EOS + #{prefix}/grass-6.4.0/etc/Init.sh + + has been modified to use the OS X system Python and to start it in 32 bit mode. + EOS + end end end