aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorelCuervo2014-02-13 10:41:18 -0200
committerMike McQuaid2014-02-14 18:04:23 +0000
commita9c83cb4688c77fe6272e5f6bcc84809447e156d (patch)
tree5dcbf825b2f33ca6e1f0418b478c78a4b90dcefc /Library
parent73e7ad5351c45d627431947d3705864382c42bc5 (diff)
downloadhomebrew-a9c83cb4688c77fe6272e5f6bcc84809447e156d.tar.bz2
gpm 1.0.1 (new formula)
Closes #26693. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/gpm.rb45
1 files changed, 45 insertions, 0 deletions
diff --git a/Library/Formula/gpm.rb b/Library/Formula/gpm.rb
new file mode 100644
index 000000000..a300388e3
--- /dev/null
+++ b/Library/Formula/gpm.rb
@@ -0,0 +1,45 @@
+require "formula"
+
+class GoInstalled < Requirement
+ fatal true
+ default_formula "go"
+ satisfy { which "go" }
+
+ def message
+ "Go is required to use gpm."
+ end
+end
+
+class Gpm < Formula
+ homepage "https://github.com/pote/gpm"
+ url "https://github.com/pote/gpm/archive/v1.0.1.tar.gz"
+ sha1 "f2e74eb20479bff9ddbb05369d19f82290a7b744"
+
+ depends_on GoInstalled
+
+ def install
+ system "./configure", "--prefix=#{prefix}"
+ system "make", "install"
+ end
+
+ test do
+ Pathname("Godeps").write "github.com/pote/gpm-testing-package v6.1"
+
+ ENV["GOPATH"] = testpath
+ system "gpm", "install"
+
+ Pathname("go_code.go").write <<-EOS.undent
+ package main
+
+ import (
+ "fmt"
+ "github.com/pote/gpm-testing-package"
+ )
+
+ func main() {
+ fmt.Print(gpm_testing_package.Version())
+ }
+ EOS
+ `go run go_code.go` == "v6.1"
+ end
+end