homebrew-core/Formula/fantom.rb

37 lines
1.1 KiB
Ruby

class Fantom < Formula
desc "Object oriented, portable programming language"
homepage "https://fantom.org/"
url "https://github.com/fantom-lang/fantom/releases/download/v1.0.77/fantom-1.0.77.zip"
sha256 "f53ed7d3f0fc1b406ae65bc841a66756076563b57c783e1b097ab94f72da6825"
license "AFL-3.0"
bottle do
sha256 cellar: :any_skip_relocation, all: "8d089cb1de9383b0f1e7e247042da8e819554f20f231648b981b5207792cd3cc"
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