From a16738a8ea851a26ec13bb9022c29b870fa987f8 Mon Sep 17 00:00:00 2001 From: Rob Prentiss Date: Fri, 6 Jan 2017 10:47:25 -0800 Subject: [PATCH 1/4] Correct URLs and filenames Actual filenames include `10.6` between `darwin` and `amd64` Signed-off-by: Rob Prentiss --- gitea.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gitea.rb b/gitea.rb index 1409031..90c2ef6 100644 --- a/gitea.rb +++ b/gitea.rb @@ -5,14 +5,14 @@ class Gitea < Formula head "https://github.com/go-gitea/gitea.git" stable do - url "http://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-darwin-amd64" - sha256 `curl -s http://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-darwin-amd64.sha256`.split(" ").first + url "http://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-darwin-10.6-amd64" + sha256 `curl -s http://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-darwin-10.6-amd64.sha256`.split(" ").first version "1.0.0" end devel do - url "http://dl.gitea.io/gitea/master/gitea-master-darwin-amd64" - sha256 `curl -s http://dl.gitea.io/gitea/master/gitea-master-darwin-amd64.sha256`.split(" ").first + url "http://dl.gitea.io/gitea/master/gitea-master-darwin-10.6-amd64" + sha256 `curl -s http://dl.gitea.io/gitea/master/gitea-master-darwin-10.6-amd64.sha256`.split(" ").first version "master" end @@ -42,7 +42,7 @@ class Gitea < Formula bin.install "#{buildpath}/bin/gitea" => "gitea" else - bin.install "#{buildpath}/gitea-master-darwin-amd64" => "gitea" + bin.install "#{buildpath}/gitea-master-darwin-10.6-amd64" => "gitea" end end end From 5d204cd8dcaa09144a6bb45c08aaab17375891ab Mon Sep 17 00:00:00 2001 From: Rob Prentiss Date: Fri, 6 Jan 2017 11:06:57 -0800 Subject: [PATCH 2/4] Add -L option for curl to follow redirects Signed-off-by: Rob Prentiss --- gitea.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitea.rb b/gitea.rb index 90c2ef6..dd90083 100644 --- a/gitea.rb +++ b/gitea.rb @@ -6,13 +6,13 @@ class Gitea < Formula stable do url "http://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-darwin-10.6-amd64" - sha256 `curl -s http://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-darwin-10.6-amd64.sha256`.split(" ").first + sha256 `curl -Ls http://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-darwin-10.6-amd64.sha256`.split(" ").first version "1.0.0" end devel do url "http://dl.gitea.io/gitea/master/gitea-master-darwin-10.6-amd64" - sha256 `curl -s http://dl.gitea.io/gitea/master/gitea-master-darwin-10.6-amd64.sha256`.split(" ").first + sha256 `curl -Ls http://dl.gitea.io/gitea/master/gitea-master-darwin-10.6-amd64.sha256`.split(" ").first version "master" end From ae04bd1e021c9991decece5fd34845d03dd23698 Mon Sep 17 00:00:00 2001 From: Rob Prentiss Date: Fri, 6 Jan 2017 13:21:54 -0800 Subject: [PATCH 3/4] Fix `bin.install` filenames for stable and devel Signed-off-by: Rob Prentiss --- gitea.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gitea.rb b/gitea.rb index dd90083..48264f7 100644 --- a/gitea.rb +++ b/gitea.rb @@ -41,8 +41,10 @@ class Gitea < Formula system("make", "build") bin.install "#{buildpath}/bin/gitea" => "gitea" - else + elsif build.devel? bin.install "#{buildpath}/gitea-master-darwin-10.6-amd64" => "gitea" + else + bin.install "#{buildpath}/gitea-1.0.0-darwin-10.6-amd64" => "gitea" end end end From 7a09017eaab9a990515012ab3171d482adfc24ab Mon Sep 17 00:00:00 2001 From: Rob Prentiss Date: Fri, 6 Jan 2017 13:51:06 -0800 Subject: [PATCH 4/4] Fix HEAD install `git` is already required for homebrew, no need to have it as a dependency, as it causes errors during install. The `make build` fails unless running inside of `src/code.gitea.io/gitea` directory, and the resultant binary is not in the `./bin` directory. Signed-off-by: Rob Prentiss --- gitea.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gitea.rb b/gitea.rb index 48264f7..0c03ff0 100644 --- a/gitea.rb +++ b/gitea.rb @@ -20,7 +20,6 @@ class Gitea < Formula url "https://github.com/go-gitea/gitea.git", :branch => "master" depends_on "go" => :build - depends_on "git" => :build end test do @@ -38,9 +37,9 @@ class Gitea < Formula ENV["GOHOME"] = buildpath ENV["TAGS"] = "sqlite" - system("make", "build") + system "cd src/code.gitea.io/gitea && make build" - bin.install "#{buildpath}/bin/gitea" => "gitea" + bin.install "#{buildpath}/gitea" => "gitea" elsif build.devel? bin.install "#{buildpath}/gitea-master-darwin-10.6-amd64" => "gitea" else