aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorCharlie Sharpsteen2012-10-28 21:10:44 -0700
committerCharlie Sharpsteen2012-11-02 10:22:55 -0700
commit8750fbb29c474833efffce1fce3605784b06fabc (patch)
tree916e8c250cbb2fe0ab7adf816f755c0ec9361f2f /Library
parent38e3ab5bb7c459b783018390a86e907dc998f31a (diff)
downloadhomebrew-8750fbb29c474833efffce1fce3605784b06fabc.tar.bz2
gdal: Transition to options DSL
Replace `def options` with `option` statements and replace all calls to `ARGV.include?` with `build.include?`.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/gdal.rb34
1 files changed, 15 insertions, 19 deletions
diff --git a/Library/Formula/gdal.rb b/Library/Formula/gdal.rb
index 4d03c9b48..fb731b5cd 100644
--- a/Library/Formula/gdal.rb
+++ b/Library/Formula/gdal.rb
@@ -1,19 +1,19 @@
require 'formula'
def complete?
- ARGV.include? "--complete"
+ build.include? 'complete'
end
def postgres?
- ARGV.include? "--with-postgres"
+ build.include? 'with-postgres'
end
def mysql?
- ARGV.include? "--with-mysql"
+ build.include? 'with-mysql'
end
def no_python?
- ARGV.include? "--without-python"
+ build.include? 'without-python'
end
def which_python
@@ -21,11 +21,11 @@ def which_python
end
def opencl?
- ARGV.include? "--enable-opencl"
+ build.include? 'enable-opencl'
end
def armadillo?
- ARGV.include? "--enable-armadillo"
+ build.include? 'enable-armadillo'
end
@@ -36,8 +36,15 @@ class Gdal < Formula
head 'https://svn.osgeo.org/gdal/trunk/gdal'
+ option 'complete', 'Use additional Homebrew libraries to provide more drivers.'
+ option 'with-postgres', 'Specify PostgreSQL as a dependency.'
+ option 'with-mysql', 'Specify MySQL as a dependency.'
+ option 'without-python', 'Build without Python support (disables a lot of tools).'
+ option 'enable-opencl', 'Build with OpenCL acceleration.'
+ option 'enable-armadillo', 'Build with Armadillo accelerated TPS transforms.'
+
# For creating up to date man pages.
- depends_on 'doxygen' => :build if ARGV.build_head?
+ depends_on 'doxygen' => :build if build.head?
depends_on :libpng
@@ -76,17 +83,6 @@ class Gdal < Formula
depends_on "xz" # get liblzma compression algorithm library from XZutils
end
- def options
- [
- ['--complete', 'Use additional Homebrew libraries to provide more drivers.'],
- ['--with-postgres', 'Specify PostgreSQL as a dependency.'],
- ['--with-mysql', 'Specify MySQL as a dependency.'],
- ['--without-python', 'Build without Python support (disables a lot of tools).'],
- ['--enable-opencl', 'Build with OpenCL acceleration.'],
- ['--enable-armadillo', 'Build with Armadillo accelerated TPS transforms.']
- ]
- end
-
def get_configure_args
args = [
# Base configuration.
@@ -256,7 +252,7 @@ class Gdal < Formula
end
end
- system 'make', 'man' if ARGV.build_head?
+ system 'make', 'man' if build.head?
system 'make', 'install-man'
# Clean up any stray doxygen files.
Dir[bin + '*.dox'].each { |p| rm p }