-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
/
Copy pathfantom.rb
36 lines (29 loc) · 1.1 KB
/
fantom.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class Fantom < Formula
desc "Object oriented, portable programming language"
homepage "https://fantom.org/"
url "https://github.com/fantom-lang/fantom/releases/download/v1.0.79/fantom-1.0.79.zip"
sha256 "d70d706b55b65c2e9abd8c970448b4e7bd28d1243724dbdea9d0f3c0fa8d5e4c"
license "AFL-3.0"
bottle do
sha256 cellar: :any_skip_relocation, all: "1eb3e699119225b4fb0dd6779daccf09d937a4506da9829d0dd14398f9e2c672"
end
depends_on "openjdk"
def install
rm_f Dir["bin/*.exe", "bin/*.dll", "lib/dotnet/*"]
# Select OpenJDK path in the config file
java_home = Formula["openjdk"].opt_libexec/"openjdk.jdk/Contents/Home"
inreplace "etc/build/config.props", %r{//jdkHome=/System.*$}, "jdkHome=#{java_home}"
libexec.install Dir["*"]
chmod 0755, Dir["#{libexec}/bin/*"]
bin.install Dir["#{libexec}/bin/*"]
bin.env_script_all_files libexec/"bin", JAVA_HOME: java_home
end
test do
(testpath/"test.fan").write <<~EOS
class ATest {
static Void main() { echo("a test") }
}
EOS
assert_match "a test", shell_output("#{bin}/fan test.fan").chomp
end
end