Skip to content

Commit a686be0

Browse files
committed
crip: switch to graalvm
1 parent 65a9740 commit a686be0

1 file changed

Lines changed: 29 additions & 6 deletions

File tree

Formula/c/crip.rb

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,36 @@ class Crip < Formula
1414
sha256 cellar: :any_skip_relocation, x86_64_linux: "f168b5098ac9ee43fba009ed7473dc040b97b20ff8339c704dbace009f10f2ca"
1515
end
1616

17-
depends_on "maven" => :build
18-
depends_on "openjdk"
17+
if OS.mac? && Hardware::CPU.intel?
18+
depends_on "maven" => :build
19+
depends_on "openjdk"
1920

20-
def install
21-
system "mvn", "clean", "package", "-Pfat-jar", "-DskipTests=true"
22-
libexec.install "target/crip.jar"
23-
bin.write_jar_script libexec/"crip.jar", "crip"
21+
def install
22+
system "mvn", "clean", "package", "-Pfat-jar", "-DskipTests=true"
23+
libexec.install "target/crip.jar"
24+
bin.write_jar_script libexec/"crip.jar", "crip"
25+
end
26+
else
27+
depends_on "graalvm" => :build
28+
depends_on "maven" => :build
29+
30+
on_linux do
31+
depends_on "zlib-ng-compat"
32+
end
33+
34+
def install
35+
ENV["JAVA_HOME"] = if OS.mac?
36+
Formula["graalvm"].opt_libexec/"graalvm.jdk/Contents/Home"
37+
else
38+
Formula["graalvm"].opt_libexec
39+
end
40+
41+
native_image_env = ENV.keys.grep(/^HOMEBREW_/).map { |key| "-E#{key}" }
42+
ENV.prepend "NATIVE_IMAGE_OPTIONS", native_image_env.join(" ")
43+
44+
system "mvn", "clean", "package", "-Pnative-image", "-DskipTests=true"
45+
bin.install "target/crip"
46+
end
2447
end
2548

2649
test do

0 commit comments

Comments
 (0)