This repository has been archived by the owner on Jul 13, 2019. It is now read-only.
/
gitea.rb
47 lines (37 loc) · 1.3 KB
/
gitea.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
require "formula"
class Gitea < Formula
homepage "https://github.com/go-gitea/gitea"
head "https://github.com/go-gitea/gitea.git"
stable do
version "1.8.3"
url "https://dl.gitea.io/gitea/#{version}/gitea-#{version}-darwin-10.6-amd64"
sha256 `curl -s https://dl.gitea.io/gitea/#{version}/gitea-#{version}-darwin-10.6-amd64.sha256`.split(" ").first
end
devel do
url "https://dl.gitea.io/gitea/master/gitea-master-darwin-10.6-amd64"
sha256 `curl -s https://dl.gitea.io/gitea/master/gitea-master-darwin-10.6-amd64.sha256`.split(" ").first
version "master"
end
head do
url "https://github.com/go-gitea/gitea.git", :branch => "master"
depends_on "go" => :build
end
test do
system "#{bin}/gitea", "--version"
end
def install
case
when build.head?
mkdir_p buildpath/File.join("src", "code.gitea.io")
ln_s buildpath, buildpath/File.join("src", "code.gitea.io", "gitea")
ENV.append_path "PATH", File.join(buildpath, "bin")
ENV["GOPATH"] = buildpath
ENV["GOHOME"] = buildpath
ENV["TAGS"] = "bindata sqlite tidb"
system "cd src/code.gitea.io/gitea && make generate build"
bin.install "#{buildpath}/gitea" => "gitea"
else
bin.install "#{buildpath}/gitea-#{version}-darwin-10.6-amd64" => "gitea"
end
end
end