Skip to content

Commit f5a6a5f

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

1 file changed

Lines changed: 34 additions & 6 deletions

File tree

Formula/c/crip.rb

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,41 @@ 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+
on
1918

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

2654
test do

0 commit comments

Comments
 (0)