-
Notifications
You must be signed in to change notification settings - Fork 1
/
hof.rb
46 lines (40 loc) · 1.37 KB
/
hof.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
37
38
39
40
41
42
43
44
45
46
class Hof < Formula
desc "CUE powered developer tools & framework"
homepage "https://hofstadter.io/"
version "v0.6.9"
url "https://github.com/hofstadter-io/hof.git",
tag: "v0.6.9",
revision: "bebc58f867e4341e3060f2421910acef6b743ea5"
license "Apache-2"
head "https://github.com/hofstadter-io/hof.git", branch: "_dev"
depends_on "go" => :build
depends_on "docker" => :test
def install
arch = Hardware::CPU.intel? ? "amd64" : Hardware::CPU.arch.to_s
os = OS.kernel_name.downcase
ldflags = %W[
-s
-w
-X
github.com/hofstadter-io/hof/cmd/hof/verinfo.Version=#{version}
-X
github.com/hofstadter-io/hof/cmd/hof/verinfo.Commit=#{Utils.git_head}
-X
github.com/hofstadter-io/hof/cmd/hof/verinfo.BuildDate=#{time.iso8601}
-X
github.com/hofstadter-io/hof/cmd/hof/verinfo.GoVersion=#{Formula["go"].version}
-X
github.com/hofstadter-io/hof/cmd/hof/verinfo.BuildOS=#{os}
-X
github.com/hofstadter-io/hof/cmd/hof/verinfo.BuildArch=#{arch}
]
ENV["CGO_ENABLED"] = "0"
ENV["HOF_TELEMETRY_DISABLED"] = "1"
system "go", "build", *std_go_args(ldflags: ldflags), "./cmd/hof"
generate_completions_from_executable(bin / "hof", "completion")
end
test do
ENV["HOF_TELEMETRY_DISABLED"] = "1"
assert_match "v#{version}", shell_output("#{bin}/hof version")
end
end