-
Notifications
You must be signed in to change notification settings - Fork 8
/
tinygo.rb
36 lines (31 loc) · 1.25 KB
/
tinygo.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 Tinygo < Formula
desc "TinyGo is a Go compiler for small places. Microcontrollers, WebAssembly, and command-line tools. Based on LLVM."
homepage "https://tinygo.org/"
version "0.35.0"
depends_on "binaryen"
on_macos do
on_arm do
url "https://github.com/tinygo-org/tinygo/releases/download/v#{version}/tinygo#{version}.darwin-arm64.tar.gz"
sha256 "8c0a32d213e1cc4781b90efb1e7665ff701ea6b18b44d2bcd74271d0ea8f30d9"
end
on_intel do
url "https://github.com/tinygo-org/tinygo/releases/download/v#{version}/tinygo#{version}.darwin-amd64.tar.gz"
sha256 "865f1024a6bce5821c3f214cf102cb08395c81199b8b00ac3fcdf03c74b3c81c"
end
end
on_linux do
url "https://github.com/tinygo-org/tinygo/releases/download/v#{version}/tinygo#{version}.linux-amd64.tar.gz"
sha256 "a6d25bec05e2ee3534ffcda3cb717336a6f4e81e4821296bff7da2fe71bf1678"
end
def install
libexec.install "bin/tinygo"
(bin/"tinygo").write_env_script libexec/"tinygo",
:TINYGOROOT => prefix
lib.install Dir["lib/*"]
prefix.install "src"
prefix.install "targets"
end
test do
system "#{bin}/tinygo", "version"
end
end