Tweaks to xapian formula
parent
3015952dd9
commit
1dfb0928d5
|
@ -24,6 +24,14 @@ class Xapian <Formula
|
||||||
path.extname == '.la'
|
path.extname == '.la'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
def install
|
def install
|
||||||
ENV.O3 # takes forever otherwise
|
ENV.O3 # takes forever otherwise
|
||||||
|
|
||||||
|
@ -31,8 +39,8 @@ class Xapian <Formula
|
||||||
"--disable-dependency-tracking"
|
"--disable-dependency-tracking"
|
||||||
system "make install"
|
system "make install"
|
||||||
|
|
||||||
XapianBindings.new.brew do
|
if build_any_bindings?
|
||||||
if ARGV.include? '--ruby' or ARGV.include? '--python' or ARGV.include? '--java' or ARGV.include? '--php'
|
XapianBindings.new.brew do
|
||||||
args = [
|
args = [
|
||||||
"XAPIAN_CONFIG=#{bin}/xapian-config",
|
"XAPIAN_CONFIG=#{bin}/xapian-config",
|
||||||
"--prefix=#{prefix}",
|
"--prefix=#{prefix}",
|
||||||
|
@ -41,29 +49,19 @@ class Xapian <Formula
|
||||||
"--without-csharp",
|
"--without-csharp",
|
||||||
"--without-tcl"
|
"--without-tcl"
|
||||||
]
|
]
|
||||||
if ARGV.include? '--ruby'
|
|
||||||
args << "--with-ruby"
|
args << arg_for_lang('ruby')
|
||||||
else
|
args << arg_for_lang('python')
|
||||||
args << "--without-ruby"
|
args << arg_for_lang('java')
|
||||||
end
|
|
||||||
if ARGV.include? '--python'
|
|
||||||
args << "--with-python"
|
|
||||||
else
|
|
||||||
args << "--without-python"
|
|
||||||
end
|
|
||||||
if ARGV.include? '--php'
|
if ARGV.include? '--php'
|
||||||
lib.mkdir
|
extension_dir = lib+'php/extensions'
|
||||||
extension_dir = (lib+'php'+'extensions')
|
extension_dir.mkpath
|
||||||
extension_dir.mkdir
|
|
||||||
args << "--with-php PHP_EXTENSION_DIR=#{extension_dir}"
|
args << "--with-php PHP_EXTENSION_DIR=#{extension_dir}"
|
||||||
else
|
else
|
||||||
args << "--without-php"
|
args << "--without-php"
|
||||||
end
|
end
|
||||||
if ARGV.include? '--java'
|
|
||||||
args << "--with-java"
|
|
||||||
else
|
|
||||||
args << "--without-java"
|
|
||||||
end
|
|
||||||
system "./configure", *args
|
system "./configure", *args
|
||||||
system "make install"
|
system "make install"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue