diff options
| author | Alan LaMielle | 2014-09-30 14:33:18 -0700 | 
|---|---|---|
| committer | Mike McQuaid | 2014-09-30 16:28:38 -0700 | 
| commit | 5b8b4429eda98fec5babd0162bf727f8c3a01580 (patch) | |
| tree | 31556b5f2840d095a3bad69793b3a0e1311d5aa7 | |
| parent | 968a81c6ff1dc17a1be04ac42ae6a155277472e5 (diff) | |
| download | homebrew-5b8b4429eda98fec5babd0162bf727f8c3a01580.tar.bz2 | |
glide 0.1.0 (new formula)
Adds the Glide Go workspace manager.  A previous pull request
(https://github.com/Homebrew/homebrew/pull/32812) attempted to add this
(by @intabulas).  However, that formula used a prebuilt Glide formula.
I have reworked this formula to build Glide from Go sources instead.
This formula was based on the NSQ formula, which also builds binaries
based on Go sources (see the nsq.rb formula).
Uses "#{bin}" rather than "#{prefix}/bin" per audit output
Uses the simpler "bin.install" for installing the glide binary
Uses separate arguments to 'system' per pull request feedback
| -rw-r--r-- | Library/Formula/glide.rb | 40 | 
1 files changed, 40 insertions, 0 deletions
diff --git a/Library/Formula/glide.rb b/Library/Formula/glide.rb new file mode 100644 index 000000000..0c8132801 --- /dev/null +++ b/Library/Formula/glide.rb @@ -0,0 +1,40 @@ +require "formula" +require "language/go" + +class Glide < Formula +  homepage "https://github.com/Masterminds/glide" +  url "https://github.com/Masterminds/glide/archive/0.1.0.tar.gz" +  sha1 "8323f0a9620d28fa1bc1b8514e2159ed0d27c135" + +  depends_on "go" => :build + +  go_resource "github.com/kylelemons/go-gypsy" do +    url "https://github.com/kylelemons/go-gypsy.git", +      :revision => "0ddb27ce74ade2ca988ec85587d636e10312dfc6" +  end + +  go_resource "github.com/Masterminds/cookoo" do +    url "https://github.com/Masterminds/cookoo.git", +      :revision => "7020bd3519807e5e891fc73366551473dab38487" +  end + +  go_resource "github.com/codegangsta/cli" do +    url "https://github.com/codegangsta/cli.git", +      :revision => "f7ebb761e83e21225d1d8954fde853bf8edd46c4" +  end + +  def install +    (buildpath + "src/github.com/Masterminds/glide").install "glide.go", "cmd" + +    ENV["GOPATH"] = buildpath +    Language::Go.stage_deps resources, buildpath/"src" + +    system "go", "build", "-o", "glide", "-ldflags", "-X main.version 0.1.0", "#{buildpath}/src/github.com/Masterminds/glide/glide.go" +    bin.install "glide" +  end + +  test do +    version = pipe_output("#{bin}/glide version") +    assert_match /0.1.0/, version +  end +end  | 
