homebrew-core/Formula/ghq.rb

57 lines
1.9 KiB
Ruby
Raw Normal View History

require "language/go"
class Ghq < Formula
desc "Remote repository management made easy"
homepage "https://github.com/motemen/ghq"
url "https://github.com/motemen/ghq/archive/v0.7.1.tar.gz"
sha256 "c43c469e47761ca67103c056c79d976933265905bd7ddd662035162532c76fb2"
head "https://github.com/motemen/ghq.git"
2015-06-18 09:29:05 +00:00
bottle do
cellar :any
2015-08-04 05:51:02 +00:00
sha256 "cc9970bbbea096ed290fa88eef327ac552c016c2b1db7d8a7376ffe17538317b" => :yosemite
sha256 "dc69157c78931f46074f5456ceb03c1e31f4d96e46ed69dfafb94db80e24dd2c" => :mavericks
sha256 "4dbdf8bb2462ddd5ec2f9ecfe37982b25759a19a8ea5d5f8e06fb5fe0dff6a7a" => :mountain_lion
2015-06-18 09:29:05 +00:00
end
option "without-completions", "Disable zsh completions"
depends_on "go" => :build
go_resource "github.com/codegangsta/cli" do
url "https://github.com/codegangsta/cli.git", :revision => "565493f259bf868adb54d45d5f4c68d405117adf"
end
go_resource "github.com/mitchellh/go-homedir" do
url "https://github.com/mitchellh/go-homedir.git", :revision => "1f6da4a72e57d4e7edd4a7295a585e0a3999a2d4"
end
go_resource "github.com/motemen/go-colorine" do
url "https://github.com/motemen/go-colorine.git", :revision => "49ff36b8fa42db28092361cd20dcefd0b03b1472"
end
go_resource "github.com/daviddengcn/go-colortext" do
url "https://github.com/daviddengcn/go-colortext.git", :revision => "3b18c8575a432453d41fdafb340099fff5bba2f7"
end
def install
mkdir_p "#{buildpath}/src/github.com/motemen/"
ln_s buildpath, "#{buildpath}/src/github.com/motemen/ghq"
ENV["GOPATH"] = buildpath
ENV.append_path "PATH", "#{ENV["GOPATH"]}/bin"
Language::Go.stage_deps resources, buildpath/"src"
system "go", "build", "-ldflags", "-X main.Version #{version}", "-o", "ghq"
bin.install "ghq"
if build.with? "completions"
zsh_completion.install "zsh/_ghq"
end
end
test do
assert_match "#{testpath}/.ghq", shell_output("#{bin}/ghq root")
end
end