2009-10-21 19:52:59 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class XapianBindings <Formula
|
2010-05-13 12:18:34 +00:00
|
|
|
url 'http://oligarchy.co.uk/xapian/1.0.20/xapian-bindings-1.0.20.tar.gz'
|
2009-10-21 19:52:59 +00:00
|
|
|
homepage 'http://xapian.org'
|
2010-05-13 12:18:34 +00:00
|
|
|
md5 '8ba9d695d5646501efd547debe37f086'
|
2009-10-21 19:52:59 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
class Xapian <Formula
|
2010-05-13 12:18:34 +00:00
|
|
|
url 'http://oligarchy.co.uk/xapian/1.0.20/xapian-core-1.0.20.tar.gz'
|
2009-10-21 19:52:59 +00:00
|
|
|
homepage 'http://xapian.org'
|
2010-05-13 12:18:34 +00:00
|
|
|
md5 'fd3980da28be014a5ac29e40fa1fbbac'
|
2009-10-21 19:52:59 +00:00
|
|
|
|
|
|
|
def options
|
|
|
|
[
|
|
|
|
["--ruby", "Ruby bindings"],
|
|
|
|
["--python", "Python bindings"],
|
|
|
|
["--php", "PHP bindings"],
|
|
|
|
["--java", "Java bindings"],
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
def skip_clean? path
|
|
|
|
path.extname == '.la'
|
|
|
|
end
|
|
|
|
|
2010-05-18 03:41:51 +00:00
|
|
|
def build_any_bindings?
|
|
|
|
ARGV.include? '--ruby' or ARGV.include? '--python' or ARGV.include? '--java' or ARGV.include? '--php'
|
|
|
|
end
|
|
|
|
|
|
|
|
def arg_for_lang lang
|
|
|
|
(ARGV.include? "--#{lang}") ? "--with-#{lang}" : "--without-#{lang}"
|
|
|
|
end
|
|
|
|
|
2009-10-21 19:52:59 +00:00
|
|
|
def install
|
|
|
|
ENV.O3 # takes forever otherwise
|
|
|
|
|
|
|
|
system "./configure", "--prefix=#{prefix}", "--disable-assertions",
|
|
|
|
"--disable-dependency-tracking"
|
|
|
|
system "make install"
|
|
|
|
|
2010-05-18 03:41:51 +00:00
|
|
|
if build_any_bindings?
|
|
|
|
XapianBindings.new.brew do
|
2009-10-21 19:52:59 +00:00
|
|
|
args = [
|
2009-12-29 21:12:49 +00:00
|
|
|
"XAPIAN_CONFIG=#{bin}/xapian-config",
|
2009-10-21 19:52:59 +00:00
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--disable-debug",
|
|
|
|
"--disable-dependency-tracking",
|
|
|
|
"--without-csharp",
|
|
|
|
"--without-tcl"
|
|
|
|
]
|
2010-05-18 03:41:51 +00:00
|
|
|
|
|
|
|
args << arg_for_lang('ruby')
|
|
|
|
args << arg_for_lang('python')
|
|
|
|
args << arg_for_lang('java')
|
|
|
|
|
2009-10-21 19:52:59 +00:00
|
|
|
if ARGV.include? '--php'
|
2010-05-18 03:41:51 +00:00
|
|
|
extension_dir = lib+'php/extensions'
|
|
|
|
extension_dir.mkpath
|
2009-10-21 19:52:59 +00:00
|
|
|
args << "--with-php PHP_EXTENSION_DIR=#{extension_dir}"
|
|
|
|
else
|
|
|
|
args << "--without-php"
|
|
|
|
end
|
2010-05-18 03:41:51 +00:00
|
|
|
|
2009-10-21 19:52:59 +00:00
|
|
|
system "./configure", *args
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2010-05-13 12:18:34 +00:00
|
|
|
end
|