From 8dbb32e1b5210a74d813734ab3e1cfca8f4c7283 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sat, 14 Apr 2012 10:01:57 -0700 Subject: Sphix: add options to force database selection --- Library/Formula/sphinx.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/sphinx.rb b/Library/Formula/sphinx.rb index 497ab7b4f..e7f9a0ee5 100644 --- a/Library/Formula/sphinx.rb +++ b/Library/Formula/sphinx.rb @@ -32,6 +32,13 @@ class Sphinx < Formula EOS end + def options + [ + ['--mysql', 'Force compiling against MySQL.'], + ['--pgsql', 'Force compiling against PostgreSQL.'], + ] + end + def install lstem = Pathname.pwd+'libstemmer_c' Libstemmer.new.brew { lstem.install Dir['*'] } @@ -45,8 +52,8 @@ class Sphinx < Formula args << "--with-libstemmer" # configure script won't auto-select PostgreSQL - args << "--with-pgsql" if which 'pg_config' - args << "--without-mysql" unless which 'mysql_config' + args << "--with-pgsql" if ARGV.include?('--pgsql') or which 'pg_config' + args << "--without-mysql" unless ARGV.include?('--mysql') or which 'mysql_config' system "./configure", *args system "make install" -- cgit v1.2.3