Browse files

xapian 1.2.10 and fix ruby+php bindings

* Upgrade xapian to version 1.2.10
* Fix php bindings - args concat issue
* Fix ruby bindings - attempts to install to /Library/Ruby
* Add ruby caveat
* Remove `--disable-debug` from the subformula.  It's unrecognized.

Fix the php bindings by adjusting the `args <<` statement so that
the array is created with correctly separated strings.  Otherwise
there is a configure error brewing the subformula.

Fix the ruby bindings from installing into /Library by setting
two environment variables which `configure` queries so that they
now install to `lib+'ruby/site_ruby'`.  The only other formula
that uses a similar Ruby directory is `subversion`, and it installs
to `lib+'ruby/1.8'` when built against the system Ruby.  So these
two formulas don't clash, and both compile without error.

Tested on Lion with llvm-gcc and clang from XCode-4.3.2, all opts.

Closes #12165.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
  • Loading branch information...
1 parent a8d228d commit aaab5746d86721f7f407f92fc457301750cb203e @2bits 2bits committed with jacknagel May 9, 2012
Showing with 28 additions and 13 deletions.
  1. +28 −13 Library/Formula/xapian.rb
View
41 Library/Formula/xapian.rb
@@ -2,14 +2,14 @@
class XapianBindings < Formula
homepage 'http://xapian.org'
- url 'http://oligarchy.co.uk/xapian/1.2.8/xapian-bindings-1.2.8.tar.gz'
- sha1 '92cf39c9c00a52a33727e47a1a7aaee2a1b23c2f'
+ url 'http://oligarchy.co.uk/xapian/1.2.10/xapian-bindings-1.2.10.tar.gz'
+ sha1 '631c7650ac2ca47f8a72434a06d463da5b7596f4'
end
class Xapian < Formula
homepage 'http://xapian.org'
- url 'http://oligarchy.co.uk/xapian/1.2.8/xapian-core-1.2.8.tar.gz'
- sha1 '4bdd3845278812d467b8d0fb73ee27a5be05b2d9'
+ url 'http://oligarchy.co.uk/xapian/1.2.10/xapian-core-1.2.10.tar.gz'
+ sha1 '1be1896ab11a3a66c6c0ade962c700d96678116e'
def options
[
@@ -33,24 +33,29 @@ def arg_for_lang lang
end
def install
- system "./configure", "--prefix=#{prefix}", "--disable-assertions",
- "--disable-dependency-tracking"
+ system './configure', "--prefix=#{prefix}", '--disable-dependency-tracking'
system "make install"
return unless build_any_bindings?
XapianBindings.new.brew do
args = [
"XAPIAN_CONFIG=#{bin}/xapian-config",
"--prefix=#{prefix}",
- "--disable-debug",
"--disable-dependency-tracking",
"--without-csharp",
"--without-tcl"
]
- args << arg_for_lang('ruby')
args << arg_for_lang('java')
+ if ARGV.include? '--ruby'
+ ruby_site = lib+'ruby/site_ruby'
+ ENV['RUBY_LIB'] = ENV['RUBY_LIB_ARCH'] = ruby_site
+ args << '--with-ruby'
+ else
+ args << '--without-ruby'
+ end
+
if ARGV.include? '--python'
python_lib = lib/which_python/'site-packages'
python_lib.mkpath
@@ -65,22 +70,32 @@ def install
if ARGV.include? '--php'
extension_dir = lib+'php/extensions'
extension_dir.mkpath
- args << "--with-php PHP_EXTENSION_DIR=#{extension_dir}"
+ args << "--with-php" << "PHP_EXTENSION_DIR=#{extension_dir}"
else
args << "--without-php"
end
-
system "./configure", *args
system "make install"
end
end
def caveats
- if ARGV.include? "--python" then <<-EOS.undent
- The Python bindings won't function until you amend your PYTHONPATH like so:
- export PYTHONPATH=#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages:$PYTHONPATH
+ s = ''
+ if ARGV.include? '--python'
+ s += <<-EOS.undent
+ The Python bindings won't function until you amend your PYTHONPATH like so:
+ export PYTHONPATH=#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages:$PYTHONPATH
+
+ EOS
+ end
+ if ARGV.include? '--ruby'
+ s += <<-EOS.undent
+ You may need to add the Ruby bindings to your RUBYLIB from:
+ #{HOMEBREW_PREFIX}/lib/ruby/site_ruby
+
EOS
end
+ return s.empty? ? nil : s
end
def which_python

0 comments on commit aaab574

Please sign in to comment.