cassandra 4.0.0
parent
3ed45704bc
commit
97899bdb5e
|
@ -1,9 +1,11 @@
|
||||||
class Cassandra < Formula
|
class Cassandra < Formula
|
||||||
|
include Language::Python::Virtualenv
|
||||||
|
|
||||||
desc "Eventually consistent, distributed key-value store"
|
desc "Eventually consistent, distributed key-value store"
|
||||||
homepage "https://cassandra.apache.org"
|
homepage "https://cassandra.apache.org"
|
||||||
url "https://www.apache.org/dyn/closer.lua?path=cassandra/3.11.10/apache-cassandra-3.11.10-bin.tar.gz"
|
url "https://www.apache.org/dyn/closer.lua?path=cassandra/4.0.0/apache-cassandra-4.0.0-bin.tar.gz"
|
||||||
mirror "https://archive.apache.org/dist/cassandra/3.11.10/apache-cassandra-3.11.10-bin.tar.gz"
|
mirror "https://archive.apache.org/dist/cassandra/4.0.0/apache-cassandra-4.0.0-bin.tar.gz"
|
||||||
sha256 "bbe772956c841158e3228c3b6c8fc38cece6bceeface695473c59c0573039bf1"
|
sha256 "2ff17bda7126c50a2d4b26fe6169807f35d2db9e308dc2851109e1c7438ac2f1"
|
||||||
license "Apache-2.0"
|
license "Apache-2.0"
|
||||||
|
|
||||||
bottle do
|
bottle do
|
||||||
|
@ -13,26 +15,9 @@ class Cassandra < Formula
|
||||||
end
|
end
|
||||||
|
|
||||||
depends_on "cython" => :build
|
depends_on "cython" => :build
|
||||||
# Due to Python 2 (https://issues.apache.org/jira/browse/CASSANDRA-10190), cassandra 4 will support python3
|
depends_on "python@3.9" => :build
|
||||||
depends_on :macos
|
depends_on "openjdk@11"
|
||||||
depends_on "openjdk@8" # cassandra 4 will support Java 11
|
depends_on "six"
|
||||||
|
|
||||||
# Only >=Yosemite has new enough setuptools for successful compile of the below deps.
|
|
||||||
# Python 2 needs setuptools < 45.0.0 (https://github.com/pypa/setuptools/issues/2094)
|
|
||||||
resource "setuptools" do
|
|
||||||
url "https://files.pythonhosted.org/packages/b2/40/4e00501c204b457f10fe410da0c97537214b2265247bc9a5bc6edd55b9e4/setuptools-44.1.1.zip"
|
|
||||||
sha256 "c67aa55db532a0dadc4d2e20ba9961cbd3ccc84d544e9029699822542b5a476b"
|
|
||||||
end
|
|
||||||
|
|
||||||
resource "futures" do
|
|
||||||
url "https://files.pythonhosted.org/packages/47/04/5fc6c74ad114032cd2c544c575bffc17582295e9cd6a851d6026ab4b2c00/futures-3.3.0.tar.gz"
|
|
||||||
sha256 "7e033af76a5e35f58e56da7a91e687706faf4e7bdfb2cbc3f2cca6b9bcda9794"
|
|
||||||
end
|
|
||||||
|
|
||||||
resource "six" do
|
|
||||||
url "https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz"
|
|
||||||
sha256 "30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"
|
|
||||||
end
|
|
||||||
|
|
||||||
# thrift==0.9.3
|
# thrift==0.9.3
|
||||||
resource "thrift" do
|
resource "thrift" do
|
||||||
|
@ -46,21 +31,16 @@ class Cassandra < Formula
|
||||||
end
|
end
|
||||||
|
|
||||||
resource "cassandra-driver" do
|
resource "cassandra-driver" do
|
||||||
url "https://files.pythonhosted.org/packages/cd/22/7bf65cfd5d60f3c916ed57c88705803fac30928696f2a300d9ee3751b390/cassandra-driver-3.24.0.tar.gz"
|
url "https://files.pythonhosted.org/packages/af/aa/3d3a6dae349d4f9b69d37e6f3f8b8ef286a06005aa312f0a3dc7af0eb556/cassandra-driver-3.25.0.tar.gz"
|
||||||
sha256 "83ec8d9a5827ee44bb1c0601a63696a8a9086beaf0151c8255556299246081bd"
|
sha256 "8ad7d7c090eb1cac6110b3bfc1fd2d334ac62f415aac09350ebb8d241b7aa7ee"
|
||||||
end
|
end
|
||||||
|
|
||||||
def install
|
def install
|
||||||
(var/"lib/cassandra").mkpath
|
(var/"lib/cassandra").mkpath
|
||||||
(var/"log/cassandra").mkpath
|
(var/"log/cassandra").mkpath
|
||||||
|
|
||||||
pypath = libexec/"vendor/lib/python2.7/site-packages"
|
venv = virtualenv_create(libexec/"vendor", "python3")
|
||||||
ENV.prepend_create_path "PYTHONPATH", pypath
|
venv.pip_install resources
|
||||||
resources.each do |r|
|
|
||||||
r.stage do
|
|
||||||
system "python", *Language::Python.setup_install_args(libexec/"vendor")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
inreplace "conf/cassandra.yaml", "/var/lib/cassandra", "#{var}/lib/cassandra"
|
inreplace "conf/cassandra.yaml", "/var/lib/cassandra", "#{var}/lib/cassandra"
|
||||||
inreplace "conf/cassandra-env.sh", "/lib/", "/"
|
inreplace "conf/cassandra-env.sh", "/lib/", "/"
|
||||||
|
@ -84,7 +64,7 @@ class Cassandra < Formula
|
||||||
"cassandra_storagedir\=\"#{var}/lib/cassandra\""
|
"cassandra_storagedir\=\"#{var}/lib/cassandra\""
|
||||||
|
|
||||||
s.gsub! "#JAVA_HOME=/usr/local/jdk6",
|
s.gsub! "#JAVA_HOME=/usr/local/jdk6",
|
||||||
"JAVA_HOME=#{Language::Java.overridable_java_home_env("1.8")[:JAVA_HOME]}"
|
"JAVA_HOME=#{Language::Java.overridable_java_home_env("11")[:JAVA_HOME]}"
|
||||||
end
|
end
|
||||||
|
|
||||||
rm Dir["bin/*.bat", "bin/*.ps1"]
|
rm Dir["bin/*.bat", "bin/*.ps1"]
|
||||||
|
@ -136,6 +116,7 @@ class Cassandra < Formula
|
||||||
bin.write_exec_script Dir["#{libexec}/bin/*"]
|
bin.write_exec_script Dir["#{libexec}/bin/*"]
|
||||||
|
|
||||||
rm %W[#{bin}/cqlsh #{bin}/cqlsh.py] # Remove existing exec scripts
|
rm %W[#{bin}/cqlsh #{bin}/cqlsh.py] # Remove existing exec scripts
|
||||||
|
pypath = libexec/"vendor"/Language::Python.site_packages("python3")
|
||||||
(bin/"cqlsh").write_env_script libexec/"bin/cqlsh", PYTHONPATH: pypath
|
(bin/"cqlsh").write_env_script libexec/"bin/cqlsh", PYTHONPATH: pypath
|
||||||
(bin/"cqlsh.py").write_env_script libexec/"bin/cqlsh.py", PYTHONPATH: pypath
|
(bin/"cqlsh.py").write_env_script libexec/"bin/cqlsh.py", PYTHONPATH: pypath
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue