diff options
| author | Jack Nagel | 2012-08-12 19:03:40 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-08-12 19:03:40 -0500 |
| commit | b0795859700da5725fd8fcd0ebb5e59838c3ae4b (patch) | |
| tree | 64733ba6eaf5cc91c41722a40636b3ae0d5dc842 /Library/Formula | |
| parent | 5056906c0ee27ff3ac6afd7048cc85754c2151a6 (diff) | |
| download | homebrew-b0795859700da5725fd8fcd0ebb5e59838c3ae4b.tar.bz2 | |
sqlite: use options DSL
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/sqlite.rb | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/Library/Formula/sqlite.rb b/Library/Formula/sqlite.rb index fa9ccfc1a..781f4acbb 100644 --- a/Library/Formula/sqlite.rb +++ b/Library/Formula/sqlite.rb @@ -20,34 +20,30 @@ class Sqlite < Formula depends_on 'readline' => :optional - def options - [ - ["--with-docs", "Install HTML documentation"], - ["--without-rtree", "Disable the R*Tree index module"], - ["--with-fts", "Enable the FTS Module"], - ["--universal", "Build a universal binary"], - ["--with-functions", "Enable more math and string functions for SQL queries"] - ] - end + option :universal + option 'with-docs', 'Install HTML documentation' + option 'without-rtree' 'Disable the R*Tree index module' + option 'with-fts', 'Enable the FTS module' + option 'with-functions', 'Enable more math and string functions for SQL queries' def install # O2 and O3 leads to corrupt/invalid rtree indexes # http://groups.google.com/group/spatialite-users/browse_thread/thread/8e1cfa79f2d02a00# ENV.Os - ENV.append 'CPPFLAGS', "-DSQLITE_ENABLE_RTREE" unless ARGV.include? "--without-rtree" - ENV.append 'CPPFLAGS', "-DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS" if ARGV.include? "--with-fts" + ENV.append 'CPPFLAGS', "-DSQLITE_ENABLE_RTREE" unless build.include? "without-rtree" + ENV.append 'CPPFLAGS', "-DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS" if build.include? "with-fts" # enable these options by default ENV.append 'CPPFLAGS', "-DSQLITE_ENABLE_COLUMN_METADATA" ENV.append 'CPPFLAGS', "-DSQLITE_ENABLE_STAT3" - ENV.universal_binary if ARGV.build_universal? + ENV.universal_binary if build.universal? system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking", "--enable-dynamic-extensions" system "make install" - if ARGV.include? "--with-functions" + if build.include? "with-functions" SqliteFunctions.new.brew { mv 'extension-functions.c?get=25', buildpath/'extension-functions.c' } system ENV.cc, "-fno-common", "-dynamiclib", @@ -57,11 +53,11 @@ class Sqlite < Formula lib.install "libsqlitefunctions.dylib" end - SqliteDocs.new.brew { doc.install Dir['*'] } if ARGV.include? "--with-docs" + SqliteDocs.new.brew { doc.install Dir['*'] } if build.include? "with-docs" end def caveats - if ARGV.include? '--with-functions' then <<-EOS.undent + if build.include? 'with-functions' then <<-EOS.undent Usage instructions for applications calling the sqlite3 API functions: In your application, call sqlite3_enable_load_extension(db,1) to |
