forked from pokt-network/homebrew-pocket-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpocket.rb
26 lines (24 loc) · 947 Bytes
/
pocket.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
class Pocket < Formula
desc "Official implementation of the Pocket Network Protocol"
homepage "https://www.pokt.network"
url "https://github.com/pokt-network/pocket-core/archive/RC-0.11.1.tar.gz"
sha256 "db7c6b015d42520c55062b890e8cfe7d35883361c717e2c802f16ff05782a80f"
depends_on "go@1.21" => [:build, "1.21"]
depends_on "leveldb" => :build
def install
ENV["GOPATH"] = buildpath
bin_path = buildpath/"src/github.com/pokt-network/pocket-core"
# Copy all files from their current location (GOPATH root)
# to $GOPATH/src/github.com/pokt-network/pocket-core
bin_path.install Dir["*"]
cd bin_path do
# Install the compiled binary into Homebrew's `bin` - a pre-existing
# global variable
system "go", "mod", "vendor"
system "go", "build", "-tags", "cleveldb", "-o", bin/"pocket", "./app/cmd/pocket_core/main.go"
end
end
test do
shell_output("#{bin}/pocket", "help")
end
end