-
Notifications
You must be signed in to change notification settings - Fork 1
/
cql.rb
32 lines (29 loc) · 1.25 KB
/
cql.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
class Cql < Formula
desc "Decentralized SQL database with blockchain features"
homepage "https://covenantsql.io"
url "https://github.com/CovenantSQL/CovenantSQL/archive/v0.6.0.tar.gz"
sha256 "2e14e9f44940c0cc3d861ebd7430a962e08c91b3569d85cc6be7460ebe3215aa"
head "https://github.com/CovenantSQL/CovenantSQL.git"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
ENV["CQLVERSION"] = "v0.6.0"
ENV["CGO_ENABLED"] = "1"
mkdir_p "src/github.com/CovenantSQL"
ldflags = "-X main.version=v0.6.0 " \
"-X github.com/CovenantSQL/CovenantSQL/conf.RoleTag=C " \
"-X github.com/CovenantSQL/CovenantSQL/utils/log.SimpleLog=Y"
ln_s buildpath, "src/github.com/CovenantSQL/CovenantSQL"
system "go", "build", "-tags", "sqlite_omit_load_extension",
"-ldflags", ldflags, "-o", "bin/cql", "github.com/CovenantSQL/CovenantSQL/cmd/cql"
bin.install "bin/cql"
bash_completion.install "bin/completion/cql-completion.bash"
zsh_completion.install "bin/completion/_cql"
end
test do
testconf = testpath/"confgen"
system bin/"cql", "generate", "-config", testconf, "-no-password", "config"
assert_predicate testconf/"private.key", :exist?
assert_predicate testconf/"config.yaml", :exist?
end
end