2014-09-14 02:15:31 +00:00
|
|
|
require "formula"
|
|
|
|
require "language/go"
|
|
|
|
|
|
|
|
class Forego < Formula
|
|
|
|
homepage "https://github.com/ddollar/forego"
|
2014-09-18 17:44:38 +00:00
|
|
|
url "https://github.com/ddollar/forego/archive/v0.13.1.tar.gz"
|
|
|
|
sha1 "63ed315ef06159438e3501512a5b307486d49d5c"
|
2014-09-14 02:15:31 +00:00
|
|
|
|
|
|
|
head "https://github.com/ddollar/forego.git"
|
|
|
|
|
2014-09-17 18:40:23 +00:00
|
|
|
bottle do
|
2014-09-18 18:05:11 +00:00
|
|
|
sha1 "9eac8ca38f6a4557b30737529f8be85b7afb11bb" => :mavericks
|
|
|
|
sha1 "4a08f819f67056758915c4624868e3dc1b012431" => :mountain_lion
|
|
|
|
sha1 "1fdb5c2c67b2990a3e71f4d4bde9a872662718c3" => :lion
|
2014-09-17 18:40:23 +00:00
|
|
|
end
|
|
|
|
|
2014-09-14 02:15:31 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
go_resource "github.com/kr/godep" do
|
|
|
|
url "https://github.com/kr/godep.git", :revision => "edcaa96f040b31f4186738decac57f88d6061b8d"
|
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/kr/fs" do
|
|
|
|
url "https://github.com/kr/fs.git", :revision => "2788f0dbd16903de03cb8186e5c7d97b69ad387b"
|
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "code.google.com/p/go.tools" do
|
|
|
|
url "https://code.google.com/p/go.tools/", :revision => "140fcaadc586", :using => :hg
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
Language::Go.stage_deps resources, buildpath/"src"
|
|
|
|
|
|
|
|
cd "src/github.com/kr/godep" do
|
|
|
|
system "go", "install"
|
|
|
|
end
|
|
|
|
|
2014-09-18 17:44:38 +00:00
|
|
|
ldflags = "-X main.Version #{version} -X main.allowUpdate false"
|
|
|
|
system "./bin/godep", "go", "build", "-ldflags", ldflags, "-o", "forego"
|
2014-09-14 02:15:31 +00:00
|
|
|
bin.install "forego"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"Procfile").write("web: echo \"it works!\"")
|
|
|
|
assert `#{bin}/forego start` =~ /it works!/
|
|
|
|
end
|
|
|
|
end
|