From 98ad4f949d045d3ae7084d0eba986d19e4932f7a Mon Sep 17 00:00:00 2001 From: Dario Vladovic Date: Fri, 11 Dec 2020 01:24:29 +0100 Subject: [PATCH] oakc 0.6.1 (new formula) --- Formula/oakc.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Formula/oakc.rb diff --git a/Formula/oakc.rb b/Formula/oakc.rb new file mode 100644 index 0000000000000..d9746cceef14b --- /dev/null +++ b/Formula/oakc.rb @@ -0,0 +1,28 @@ +class Oakc < Formula + desc "Portable programming language with a compact intermediate representation" + homepage "https://github.com/adam-mcdaniel/oakc" + url "https://static.crates.io/crates/oakc/oakc-0.6.1.crate" + sha256 "1f4a90a3fd5c8ae32cb55c7a38730b6bfcf634f75e6ade0fd51c9db2a2431683" + license "Apache-2.0" + head "https://github.com/adam-mcdaniel/oakc.git" + + livecheck do + url "https://docs.rs/oakc" + regex(%r{/oakc/v?(\d+(?:\.\d+)+)/}i) + end + + depends_on "rust" => :build + + def install + system "tar", "--strip-components", "1", "-xzvf", "oakc-#{version}.crate" + system "cargo", "install", *std_cargo_args + pkgshare.install "examples" + end + + test do + system bin/"oak", "-c", "c", pkgshare/"examples/hello_world.ok" + assert_equal "Hello world!\n", shell_output("./main") + assert_match "This file tests Oak's doc subcommand", + shell_output("#{bin}/oak doc #{pkgshare}/examples/flags/doc.ok") + end +end