2014-09-14 02:15:31 +00:00
|
|
|
require "language/go"
|
|
|
|
|
|
|
|
class Forego < Formula
|
|
|
|
homepage "https://github.com/ddollar/forego"
|
2015-04-22 17:42:09 +00:00
|
|
|
url "https://github.com/ddollar/forego/archive/v0.16.1.tar.gz"
|
|
|
|
sha256 "d4c8305262ac18c7e51d9d8028827f83b37fb3f9373d304686d084d68033ac6d"
|
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
|
2015-04-22 22:06:43 +00:00
|
|
|
cellar :any
|
|
|
|
sha256 "d868a7568c0c80b6af1cb8582b5c7341c1aa42b7aa1f7dc384f20ccca6bb1497" => :yosemite
|
|
|
|
sha256 "f0a098da6534c7a2f13e05ef129ab33a6a738251ffaaffe9792d28f300a992f2" => :mavericks
|
|
|
|
sha256 "8b544fd274c115758cf3ecec09e5c2f66e9f54663bc28b86d55bb310c94e57a2" => :mountain_lion
|
2014-09-17 18:40:23 +00:00
|
|
|
end
|
|
|
|
|
2014-09-14 02:15:31 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
2015-04-22 17:42:09 +00:00
|
|
|
go_resource "github.com/tools/godep" do
|
|
|
|
url "https://github.com/tools/godep.git",
|
|
|
|
:revision => "58d90f262c13357d3203e67a33c6f7a9382f9223"
|
2014-09-14 02:15:31 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
go_resource "github.com/kr/fs" do
|
2015-04-22 17:42:09 +00:00
|
|
|
url "https://github.com/kr/fs.git",
|
|
|
|
:revision => "2788f0dbd16903de03cb8186e5c7d97b69ad387b"
|
2014-09-14 02:15:31 +00:00
|
|
|
end
|
|
|
|
|
2015-04-22 17:42:09 +00:00
|
|
|
go_resource "golang.org/x/tools" do
|
|
|
|
url "https://go.googlesource.com/tools",
|
|
|
|
:using => :git,
|
|
|
|
:revision => "b1aed1a596ad02d2aa2eb5c5af431a7ba2f6afc4"
|
2014-09-14 02:15:31 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
2015-04-22 17:42:09 +00:00
|
|
|
mkdir_p buildpath/"src/github.com/ddollar/"
|
|
|
|
ln_sf buildpath, buildpath/"src/github.com/ddollar/forego"
|
2014-09-14 02:15:31 +00:00
|
|
|
Language::Go.stage_deps resources, buildpath/"src"
|
|
|
|
|
2015-04-22 17:42:09 +00:00
|
|
|
cd "src/github.com/tools/godep" do
|
2014-09-14 02:15:31 +00:00
|
|
|
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
|