homebrew-gitea/lgtm.rb

48 lines
1.3 KiB
Ruby
Raw Normal View History

2016-11-25 13:52:09 +00:00
require "formula"
class Lgtm < Formula
homepage "https://github.com/go-gitea/lgtm"
head "https://github.com/go-gitea/lgtm.git"
stable do
version "1.0.0"
url "https://dl.gitea.io/lgtm/#{version}/lgtm-#{version}-darwin-10.6-amd64"
sha256 `curl -s https://dl.gitea.io/lgtm/#{version}/lgtm-#{version}-darwin-10.6-amd64.sha256`.split(" ").first
2016-11-25 13:52:09 +00:00
end
devel do
2017-01-10 08:28:47 +00:00
url "https://dl.gitea.io/lgtm/master/lgtm-master-darwin-10.6-amd64"
sha256 `curl -s https://dl.gitea.io/lgtm/master/lgtm-master-darwin-10.6-amd64.sha256`.split(" ").first
2016-11-25 13:52:09 +00:00
version "master"
end
head do
url "https://github.com/go-gitea/lgtm.git", :branch => "master"
depends_on "go" => :build
end
test do
system "#{bin}/lgtm", "--version"
end
def install
2016-12-29 11:33:32 +00:00
case
when build.head?
2016-11-25 13:52:09 +00:00
mkdir_p buildpath/File.join("src", "github.com", "go-gitea")
ln_s buildpath, buildpath/File.join("src", "github.com", "go-gitea", "lgtm")
ENV.append_path "PATH", File.join(buildpath, "bin")
ENV["GOPATH"] = buildpath
ENV["GOHOME"] = buildpath
ENV["TAGS"] = ""
2017-01-10 08:28:47 +00:00
system "cd src/github.com/go-gitea/lgtm && make build"
2016-11-25 13:52:09 +00:00
2017-01-10 08:28:47 +00:00
bin.install "#{buildpath}/lgtm" => "lgtm"
2016-12-29 11:33:32 +00:00
else
bin.install "#{buildpath}/lgtm-#{version}-darwin-10.6-amd64" => "lgtm"
2016-11-25 13:52:09 +00:00
end
end
end