-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathviam-server.rb
63 lines (57 loc) · 2.09 KB
/
viam-server.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
class ViamServer < Formula
desc "Main server application of the viam robot development kit (RDK)"
homepage "https://www.viam.com/"
url "https://github.com/viamrobotics/rdk/archive/refs/tags/v0.63.0.tar.gz"
sha256 "fcec86e4dc244fd0ac3ac7567f52348574dffd2eac68d994e490a5bae155783e"
license "AGPL-3.0"
head "https://github.com/viamrobotics/rdk.git", branch: "main"
bottle do
root_url "https://ghcr.io/v2/viamrobotics/brews"
rebuild 18
sha256 cellar: :any, arm64_sequoia: "4b256a25c190bb5884e060285eec31292461824721ca0d4b4c0cb6c2a9e52b54"
sha256 cellar: :any, arm64_sonoma: "ab823e243a7f8a499a4aa9075bd694d306338c16df5addf3f408ae80d222378f"
sha256 cellar: :any_skip_relocation, x86_64_linux: "e34c5799173d6d19cea55e846ca9fba488aee4ebce513f62af3b65cf95a96def"
end
depends_on "go" => :build
depends_on "node@20" => :build
depends_on "pkg-config" => :build
depends_on "ffmpeg"
depends_on "jpeg-turbo"
depends_on "nlopt-static"
depends_on "opus"
depends_on "x264"
def install
with_env(
"TAG_VERSION" => "v#{version}",
) do
system "make", "server"
end
if OS.linux?
if Hardware::CPU.intel?
bin.install "bin/Linux-x86_64/viam-server" => "viam-server"
elsif Hardware::CPU.arm?
bin.install "bin/Linux-aarch64/viam-server" => "viam-server"
end
elsif OS.mac?
if Hardware::CPU.intel?
bin.install "bin/Darwin-x86_64/viam-server" => "viam-server"
elsif Hardware::CPU.arm?
bin.install "bin/Darwin-arm64/viam-server" => "viam-server"
end
end
etc.install "etc/configs/fake.json" => "viam.json"
end
service do
log_path var/"log/viam.log"
error_log_path var/"log/viam.log"
run [bin/"viam-server", "-config", etc/"viam.json"]
end
def caveats
<<~EOS
Note that when installed via homebrew, the default location for the viam-server config is
#{HOMEBREW_PREFIX}/etc/viam.json
To manage viam-server as a service, use brew's service command. Run the following for more info:
# brew services --help
EOS
end
end