-
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathwacli.rb
More file actions
51 lines (45 loc) · 1.83 KB
/
Copy pathwacli.rb
File metadata and controls
51 lines (45 loc) · 1.83 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
class Wacli < Formula
desc "WhatsApp CLI built on whatsmeow"
homepage "https://github.com/openclaw/wacli"
version "0.18.2"
license "MIT"
version_scheme 1
head "https://github.com/openclaw/wacli.git", branch: "main"
depends_on "go" => :build if build.head?
on_macos do
if Hardware::CPU.arm?
url "https://github.com/openclaw/wacli/releases/download/v0.18.2/wacli_0.18.2_darwin_arm64.tar.gz"
sha256 "0662d432e909f766b41bce8987677ebdd23110faf63c17a58187e0c61416b4b3"
end
if Hardware::CPU.intel?
url "https://github.com/openclaw/wacli/releases/download/v0.18.2/wacli_0.18.2_darwin_amd64.tar.gz"
sha256 "ff2ec55f2982a1f23a1a981ab038ba19565873b05faf1fa2ad910aae08baa245"
end
end
on_linux do
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "https://github.com/openclaw/wacli/releases/download/v0.18.2/wacli_0.18.2_linux_arm64.tar.gz"
sha256 "83fd65e09ba2df2bd7f996f1b94a12ce3ad3ed2bc528ed602ffef5c273a414fc"
end
if Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
url "https://github.com/openclaw/wacli/releases/download/v0.18.2/wacli_0.18.2_linux_amd64.tar.gz"
sha256 "d33e8cc4b01acbd4e1ba212e22ac9c6438221e0761112dd3e7a2cc30b3a5946f"
end
end
def install
if File.exist?("wacli")
bin.install "wacli"
else
ldflags = "-s -w -X main.version=#{version}"
# GCC 15+ with glibc 2.42+ treats missing-braces in Go's runtime/cgo as errors.
# See: https://github.com/steipete/wacli/pull/8
ENV["CGO_ENABLED"] = "1"
ENV.append "CGO_CFLAGS", "-Wno-error=missing-braces"
system "go", "build", "-tags", "sqlite_fts5", *std_go_args(ldflags: ldflags), "./cmd/wacli"
end
end
test do
assert_match version.to_s, shell_output("#{bin}/wacli --version")
assert_match "FTS5", shell_output("#{bin}/wacli doctor")
end
end