Gitea: Homebrew
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

48 lines
1.3 KiB

  1. require "formula"
  2. class Lgtm < Formula
  3. homepage "https://github.com/go-gitea/lgtm"
  4. head "https://github.com/go-gitea/lgtm.git"
  5. stable do
  6. version "1.0.0"
  7. url "https://dl.gitea.io/lgtm/#{version}/lgtm-#{version}-darwin-10.6-amd64"
  8. sha256 `curl -s https://dl.gitea.io/lgtm/#{version}/lgtm-#{version}-darwin-10.6-amd64.sha256`.split(" ").first
  9. end
  10. devel do
  11. url "https://dl.gitea.io/lgtm/master/lgtm-master-darwin-10.6-amd64"
  12. sha256 `curl -s https://dl.gitea.io/lgtm/master/lgtm-master-darwin-10.6-amd64.sha256`.split(" ").first
  13. version "master"
  14. end
  15. head do
  16. url "https://github.com/go-gitea/lgtm.git", :branch => "master"
  17. depends_on "go" => :build
  18. end
  19. test do
  20. system "#{bin}/lgtm", "--version"
  21. end
  22. def install
  23. case
  24. when build.head?
  25. mkdir_p buildpath/File.join("src", "github.com", "go-gitea")
  26. ln_s buildpath, buildpath/File.join("src", "github.com", "go-gitea", "lgtm")
  27. ENV.append_path "PATH", File.join(buildpath, "bin")
  28. ENV["GOPATH"] = buildpath
  29. ENV["GOHOME"] = buildpath
  30. ENV["TAGS"] = ""
  31. system "cd src/github.com/go-gitea/lgtm && make build"
  32. bin.install "#{buildpath}/lgtm" => "lgtm"
  33. else
  34. bin.install "#{buildpath}/lgtm-#{version}-darwin-10.6-amd64" => "lgtm"
  35. end
  36. end
  37. end