hamsterdb: use :java instead of custom requirement
Closes Homebrew/homebrew#37119. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
b365397929
commit
b6d93a99ba
1 changed files with 2 additions and 27 deletions
|
@ -1,28 +1,3 @@
|
|||
class JavaRequirement < Requirement
|
||||
fatal true
|
||||
|
||||
def self.jdk_home
|
||||
[
|
||||
`/usr/libexec/java_home`.chomp,
|
||||
ENV['JAVA_HOME']
|
||||
].find { |dir| dir && File.exist?("#{dir}/bin/javac") && File.exist?("#{dir}/include") }
|
||||
end
|
||||
|
||||
satisfy :build_env => false do
|
||||
self.class.jdk_home
|
||||
end
|
||||
|
||||
def message; <<-EOS.undent
|
||||
Could not find a JDK (i.e. not a JRE)
|
||||
|
||||
Do one of the following:
|
||||
- install a JDK that is detected with /usr/libexec/java_home
|
||||
- set the JAVA_HOME environment variable
|
||||
- specify --without-java
|
||||
EOS
|
||||
end
|
||||
end
|
||||
|
||||
class Hamsterdb < Formula
|
||||
homepage "http://hamsterdb.com"
|
||||
url "http://files.hamsterdb.com/dl/hamsterdb-2.1.9.tar.gz"
|
||||
|
@ -48,7 +23,7 @@ class Hamsterdb < Formula
|
|||
|
||||
depends_on "boost"
|
||||
depends_on "gnutls"
|
||||
depends_on JavaRequirement if build.with? "java"
|
||||
depends_on :java => :recommended
|
||||
depends_on "protobuf" if build.with? "remote"
|
||||
|
||||
resource "libuv" do
|
||||
|
@ -77,7 +52,7 @@ class Hamsterdb < Formula
|
|||
features = []
|
||||
|
||||
if build.with? "java"
|
||||
features << "JDK=#{JavaRequirement.jdk_home}"
|
||||
features << "JDK=#{ENV["JAVA_HOME"]}"
|
||||
else
|
||||
features << "--disable-java"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue