-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathlibrespeed-cli.rb
More file actions
22 lines (19 loc) · 884 Bytes
/
librespeed-cli.rb
File metadata and controls
22 lines (19 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class LibrespeedCli < Formula
desc "Command-line client for LibreSpeed"
homepage "https://github.com/librespeed/speedtest-cli"
url "https://github.com/librespeed/speedtest-cli/archive/refs/tags/v1.0.13.tar.gz"
sha256 "5ad938b61e3edc0ca95e2ccff0c06e97a69383f3cbb0243bd47b21b9865f9f55"
head "https://github.com/librespeed/speedtest-cli.git"
depends_on "go" => :build
def install
build_time = Utils.safe_popen_read("date -u '+%Y-%m-%d %H:%M:%S %Z' 2> /dev/null").chomp
ldflags = ["-w -s",
"-X \"librespeed-cli/defs.ProgName=librespeed-cli\"",
"-X \"librespeed-cli/defs.ProgVersion=v#{version}\"",
"-X \"librespeed-cli/defs.BuildDate=#{build_time}\""]
system "go", "build", "-o", bin/"librespeed-cli", "-ldflags", ldflags.join(" "), "-trimpath", "main.go"
end
test do
system bin/"librespeed-cli"
end
end