Replace runtime bundle with openjdk@17 dependency provided by Homebrew.

This commit is contained in:
David Kocher
2021-12-10 21:15:22 +01:00
parent d324e702f8
commit d03e77ab6a
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -5,9 +5,13 @@ class Duck < Formula
sha256 "${ARCHIVE.SHA256}"
license "GPL-3.0-only"
depends_on "openjdk@17"
def install
# Because compiling would need a JDK and xcodebuild we just use the pre-compiled binary.
libexec.install Dir["*"]
rm_r "#{libexec}/Contents/PlugIns/Runtime.jre"
ln_s Formula["openjdk@17"].libexec/"openjdk.jdk", "#{libexec}/Contents/PlugIns/Runtime.jre"
bin.install_symlink "#{libexec}/Contents/MacOS/duck" => "duck"
end
+3
View File
@@ -11,6 +11,7 @@ class Duck < Formula
regex(/href=.*?duck-src[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
depends_on "openjdk@17"
depends_on "ant" => :build
depends_on "maven" => :build
depends_on xcode: :build
@@ -25,6 +26,8 @@ class Duck < Formula
system "mvn", "-DskipTests", "-Dgit.commitsCount=#{revision}",
"--projects", "cli/osx", "--also-make", "verify"
libexec.install Dir["cli/osx/target/duck.bundle/*"]
rm_r "#{libexec}/Contents/PlugIns/Runtime.jre"
ln_s Formula["openjdk@17"].libexec/"openjdk.jdk", "#{libexec}/Contents/PlugIns/Runtime.jre"
bin.install_symlink "#{libexec}/Contents/MacOS/duck" => "duck"
end