-
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.34.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 "6a9bae4e57aaf8bf814cd62df6d527d402394eca59257b2bb1dddd3bcb3a51a7"
end
on_intel do
url "https://github.com/tinygo-org/tinygo/releases/download/v#{version}/tinygo#{version}.darwin-amd64.tar.gz"
sha256 "451c51a080b3b64d1ac99906840478f712ac62bbf7e1e9bc55ddd04e3730455e"
end
end
on_linux do
url "https://github.com/tinygo-org/tinygo/releases/download/v#{version}/tinygo#{version}.linux-amd64.tar.gz"
sha256 "8acd27a39090e1e5c3ca341e81350f813ec6a02bf8090c4fc7c4b1afd4186341"
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