-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtinygo.rb
More file actions
36 lines (31 loc) · 1.25 KB
/
tinygo.rb
File metadata and controls
36 lines (31 loc) · 1.25 KB
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.40.1"
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 "a20841a616de3b3403e52e3789cb60c147ab52b3fe6c33b31fdffba0164ae031"
end
on_intel do
url "https://github.com/tinygo-org/tinygo/releases/download/v#{version}/tinygo#{version}.darwin-amd64.tar.gz"
sha256 "36c9423a63f9548d142908b06c67e198d878a0fed076b8ec5dbf8a3350a73eb4"
end
end
on_linux do
url "https://github.com/tinygo-org/tinygo/releases/download/v#{version}/tinygo#{version}.linux-amd64.tar.gz"
sha256 "064fc0c07f4d71f7369b168c337caa88ef32a6b00b16449cea44790ccadfc2b4"
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