aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorJack Nagel2013-02-26 17:52:53 -0600
committerJack Nagel2013-02-26 17:53:44 -0600
commit059c572f2ee3c77d66cf8fc757467b74da8be810 (patch)
tree90a18048ddddede51e54b13cf5fbb069dad17839 /Library/Formula
parent953dea15c88d72ce459b77181d281f4d4a6add72 (diff)
downloadhomebrew-059c572f2ee3c77d66cf8fc757467b74da8be810.tar.bz2
sphinx: clean up mysql/postgres handling
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/sphinx.rb31
1 files changed, 16 insertions, 15 deletions
diff --git a/Library/Formula/sphinx.rb b/Library/Formula/sphinx.rb
index fb9178ba1..3455d9fd6 100644
--- a/Library/Formula/sphinx.rb
+++ b/Library/Formula/sphinx.rb
@@ -15,6 +15,13 @@ class Sphinx < Formula
head 'http://sphinxsearch.googlecode.com/svn/trunk/'
+ option 'mysql', 'Force compiling against MySQL'
+ option 'pgsql', 'Force compiling against PostgreSQL'
+ option 'id64', 'Force compiling with 64-bit ID support'
+
+ depends_on :mysql if build.include? 'mysql'
+ depends_on :postgresql if build.include? 'pgsql'
+
fails_with :llvm do
build 2334
cause "ld: rel32 out of range in _GetPrivateProfileString from /usr/lib/libodbc.a(SQLGetPrivateProfileString.o)"
@@ -27,30 +34,24 @@ class Sphinx < Formula
EOS
end
- option 'mysql', 'Force compiling against MySQL'
- option 'pgsql', 'Force compiling against PostgreSQL'
- option 'id64', 'Force compiling with 64-bit ID support'
-
def install
Libstemmer.new.brew { (buildpath/'libstemmer_c').install Dir['*'] }
args = %W[--prefix=#{prefix}
--disable-dependency-tracking
- --localstatedir=#{var}]
+ --localstatedir=#{var}
+ --with-libstemmer]
- # always build with libstemmer support
- args << "--with-libstemmer"
+ args << "--enable-id64" if build.include? 'id64'
- # configure script won't auto-select PostgreSQL
- if build.include?('mysql') || which('mysql_config')
- args << "--with-mysql"
- else
- args << "--without-mysql"
+ %w{mysql pgsql}.each do |db|
+ if build.include? db
+ args << "--with-#{db}"
+ else
+ args << "--without-#{db}"
+ end
end
- args << "--with-pgsql" if build.include?('pgsql') || which('pg_config')
- args << "--enable-id64" if build.include?('id64')
-
system "./configure", *args
system "make install"
end