diff options
| author | Aric Coady | 2014-04-28 17:12:38 -0700 | 
|---|---|---|
| committer | Adam Vandenberg | 2014-05-07 14:15:22 -0700 | 
| commit | 0c6e8c986a41395c28c0e7320c9fa7414c68f544 (patch) | |
| tree | 570e37e311b0eb5b8785ef940a7846957e66da74 | |
| parent | b3fa72e662ed9a5b63772f9bc46674e073cf6534 (diff) | |
| download | homebrew-0c6e8c986a41395c28c0e7320c9fa7414c68f544.tar.bz2 | |
pylucene 4.7.2-1
pylucene 4.7.2 (new formula)
Closes #28381.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
| -rw-r--r-- | Library/Formula/pylucene.rb | 37 | 
1 files changed, 37 insertions, 0 deletions
| diff --git a/Library/Formula/pylucene.rb b/Library/Formula/pylucene.rb new file mode 100644 index 000000000..36d321df8 --- /dev/null +++ b/Library/Formula/pylucene.rb @@ -0,0 +1,37 @@ +require "formula" + +class Pylucene < Formula +  homepage "http://lucene.apache.org/pylucene/index.html" +  url "http://www.apache.org/dyn/closer.cgi?path=lucene/pylucene/pylucene-4.7.2-1-src.tar.gz" +  sha1 "dd9bb535ef96e719030f9a7d00a4cf259748e228" + +  option "with-shared", "build jcc as a shared library" + +  depends_on :clt => :build +  depends_on :ant => :build +  depends_on :python + +  def install +    ENV.prepend_create_path "PYTHONPATH", lib/"python2.7/site-packages" +    jcc = "JCC=python -m jcc --arch #{MacOS.preferred_arch}" +    opt = "INSTALL_OPT=--prefix #{prefix}" +    if build.with? "shared" +      jcc << " --shared" +      opoo "shared option requires python to be built with the same compiler: #{ENV.compiler}" +    else +      opt << " --use-distutils"  # setuptools only required with shared +      ENV["NO_SHARED"] = "1" +    end + +    cd "jcc" do +      system "python", "setup.py", "install", "--prefix=#{prefix}" +    end +    ENV.deparallelize  # the jars must be built serially +    system "make", "all", "install", opt, jcc, "ANT=ant", "PYTHON=python", "NUM_FILES=8" +  end + +  test do +    ENV.prepend_path "PYTHONPATH", HOMEBREW_PREFIX/"lib/python2.7/site-packages" +    system "python", "-c", "import lucene; assert lucene.initVM()" +  end +end | 
