-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpylucene.rb
More file actions
36 lines (33 loc) · 1.3 KB
/
Copy pathpylucene.rb
File metadata and controls
36 lines (33 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class Pylucene < Formula
desc "Python extension for accessing Java Lucene"
homepage "https://lucene.apache.org/pylucene/index.html"
url "https://downloads.apache.org/lucene/pylucene/pylucene-10.0.0-src.tar.gz"
sha256 "100c3d61d6799ac16b7b8c1826cddf07fb1715141ebdb0d7b8119cdd96b24574"
head do
url "https://dist.apache.org/repos/dist/dev/lucene/pylucene/10.3.0-rc1/pylucene-10.3.0-src.tar.gz"
sha256 "fdbdc098de21c6982e61e3264157e03cbdaddc169a2f90cadec8a0ceb2462406"
end
depends_on "python"
depends_on "openjdk@21" => :build
def install
ENV["JCC_JDK"] = ENV.fetch("HOMEBREW_JDK", Language::Java.java_home)
ENV["NO_SHARED"] = "1"
ENV.deparallelize # the jars must be built serially
version = Language::Python.major_minor_version "python"
packages = lib/"python#{version}/site-packages"
ENV.prepend_create_path "PYTHONPATH", packages
cd "jcc" do
system "pip install --prefix #{prefix} build setuptools"
system "python -m build -nw"
system "pip install --prefix #{prefix} dist/*.whl"
end
system "make", "all", "install",
"PYTHON=python",
"JCC=python -m jcc",
"NUM_FILES=16",
"INSTALL_OPT=--prefix #{prefix} --install-dir #{packages}"
end
test do
system "python3", "-c", "import lucene; assert lucene.initVM()"
end
end