aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorYousef Ourabi2013-01-12 15:01:57 -0800
committerAdam Vandenberg2013-01-12 15:09:02 -0800
commit349836a25b0185cde906bcf24f01444dc8a5a23f (patch)
treec3f43d087e5309ea9983338b9b98f017ed85331c /Library/Formula
parent75709a1ff2ef2050e9344e43057285bde9e35a81 (diff)
downloadhomebrew-349836a25b0185cde906bcf24f01444dc8a5a23f.tar.bz2
grass: new style options
Closes #17044. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/grass.rb27
1 files changed, 9 insertions, 18 deletions
diff --git a/Library/Formula/grass.rb b/Library/Formula/grass.rb
index 715ffc4e2..548cc1f4c 100644
--- a/Library/Formula/grass.rb
+++ b/Library/Formula/grass.rb
@@ -1,20 +1,12 @@
require 'formula'
-def postgres?
- ARGV.include? "--with-postgres"
-end
-
-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.version >= :lion
+ build.include? 'without-gui' or MacOS.version >= :lion
end
class Grass < Formula
@@ -46,13 +38,9 @@ class Grass < Formula
EOS
end
- def options
- [
- ['--with-postgres', 'Specify PostgreSQL as a dependency'],
- ['--with-mysql', 'Specify MySQL as a dependency'],
- ['--without-gui', 'Build without WxPython interface. Command line tools still available.']
- ]
- end
+ option "with-postgres", "specify PostgreSQL as a dependency."
+ option "with-mysql", "Specify MySQL as a dependency."
+ option "without-gui", "Build without WxPython interface. Command line tools still available."
def install
readline = Formula.factory('readline')
@@ -112,8 +100,11 @@ class Grass < Formula
args << "--with-cairo"
# Database support
- args << "--with-postgres" if postgres?
- if mysql?
+ if build.include? "with-postgres"
+ args << "--with-postgres"
+ end
+
+ if build.include? "with-mysql"
mysql = Formula.factory('mysql')
args << "--with-mysql-includes=#{mysql.include + 'mysql'}"
args << "--with-mysql-libs=#{mysql.lib + 'mysql'}"