-
Notifications
You must be signed in to change notification settings - Fork 0
/
ggz.rb
39 lines (30 loc) · 948 Bytes
/
ggz.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
require "formula"
class Ggz < Formula
homepage "https://github.com/go-ggz/ggz"
head "https://github.com/go-ggz/ggz.git"
stable do
version "0.1.1"
url "https://github.com/go-ggz/ggz/releases/download/#{version}/ggz-#{version}-darwin-amd64"
end
head do
url "https://github.com/go-ggz/ggz.git", :branch => "master"
depends_on "go" => :build
end
test do
system "#{bin}/ggz", "--version"
end
def install
case
when build.head?
mkdir_p buildpath/File.join("src", "github.com", "go-ggz")
ln_s buildpath, buildpath/File.join("src", "github.com", "go-ggz", "ggz")
ENV.append_path "PATH", File.join(buildpath, "bin")
ENV["GOPATH"] = buildpath
ENV["GOHOME"] = buildpath
system "cd src/github.com/go-ggz/ggz && make build"
bin.install "#{buildpath}/bin/ggz" => "ggz"
else
bin.install "#{buildpath}/ggz-#{version}-darwin-amd64" => "ggz"
end
end
end