2021-11-29 02:42:27 +05:30
|
|
|
require_relative './utils/macos_codesign.rb'
|
2021-11-29 02:15:57 +05:30
|
|
|
|
Fix homebrew tap by removing head and shipping compiled binaries (#136)
fixes #135
This fix Homebrew tap by removing the head method and shipping only pre-compiled binaries, as you guys already ship binaries for most (all?) supported platforms.
Also, for gitea.rb and tea.rb, I removed the curl for fetching files checksum, because for every install, it runs `curl` 5 times, slowing the install. So, I created a script to bump versions to latest and fix sha256 checksum in the formula files.
I created also an gitea-head and tea-head formulae to download latest pre-compiled binaries for head, and here we are fetching checksum by `curl`, as I imagine, it is not common/recommended scenario.
IMO, this is the best possible approach for shipping binaries from a custom tap.
Co-authored-by: Marcos de Oliveira <markinholiveira@gmail.com>
Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/136
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: markkrj <markkrj@noreply.gitea.io>
Co-committed-by: markkrj <markkrj@noreply.gitea.io>
2021-06-29 23:30:18 +05:30
|
|
|
class GiteaHead < Formula
|
|
|
|
desc "Git with a cup of tea, painless self-hosted git service"
|
|
|
|
homepage "https://gitea.io"
|
|
|
|
version "main"
|
|
|
|
|
|
|
|
os = OS.mac? ? "darwin-10.12" : "linux"
|
|
|
|
arch = case Hardware::CPU.arch
|
|
|
|
when :i386 then "386"
|
|
|
|
when :x86_64 then "amd64"
|
|
|
|
when :arm64 then "arm64"
|
|
|
|
else
|
|
|
|
raise "gitea: Unsupported system architecture #{Hardware::CPU.arch}"
|
|
|
|
end
|
|
|
|
|
|
|
|
@@filename = "gitea-#{version}-#{os}-#{arch}"
|
2021-10-09 09:53:39 +05:30
|
|
|
@@url = "https://dl.gitea.io/gitea/#{version}/#{@@filename}"
|
|
|
|
@@using = :nounzip
|
|
|
|
|
|
|
|
if os == "darwin-10.12" || arch == "amd64"
|
|
|
|
@@url += ".xz"
|
|
|
|
@@using = nil
|
|
|
|
depends_on "xz"
|
|
|
|
end
|
|
|
|
|
Fix homebrew tap by removing head and shipping compiled binaries (#136)
fixes #135
This fix Homebrew tap by removing the head method and shipping only pre-compiled binaries, as you guys already ship binaries for most (all?) supported platforms.
Also, for gitea.rb and tea.rb, I removed the curl for fetching files checksum, because for every install, it runs `curl` 5 times, slowing the install. So, I created a script to bump versions to latest and fix sha256 checksum in the formula files.
I created also an gitea-head and tea-head formulae to download latest pre-compiled binaries for head, and here we are fetching checksum by `curl`, as I imagine, it is not common/recommended scenario.
IMO, this is the best possible approach for shipping binaries from a custom tap.
Co-authored-by: Marcos de Oliveira <markinholiveira@gmail.com>
Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/136
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: markkrj <markkrj@noreply.gitea.io>
Co-committed-by: markkrj <markkrj@noreply.gitea.io>
2021-06-29 23:30:18 +05:30
|
|
|
@@sha256 = %x[ curl -sL #{@@url}.sha256 ].split.first
|
|
|
|
|
|
|
|
sha256 @@sha256
|
2021-10-09 09:53:39 +05:30
|
|
|
url @@url,
|
|
|
|
using: @@using
|
Fix homebrew tap by removing head and shipping compiled binaries (#136)
fixes #135
This fix Homebrew tap by removing the head method and shipping only pre-compiled binaries, as you guys already ship binaries for most (all?) supported platforms.
Also, for gitea.rb and tea.rb, I removed the curl for fetching files checksum, because for every install, it runs `curl` 5 times, slowing the install. So, I created a script to bump versions to latest and fix sha256 checksum in the formula files.
I created also an gitea-head and tea-head formulae to download latest pre-compiled binaries for head, and here we are fetching checksum by `curl`, as I imagine, it is not common/recommended scenario.
IMO, this is the best possible approach for shipping binaries from a custom tap.
Co-authored-by: Marcos de Oliveira <markinholiveira@gmail.com>
Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/136
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: markkrj <markkrj@noreply.gitea.io>
Co-committed-by: markkrj <markkrj@noreply.gitea.io>
2021-06-29 23:30:18 +05:30
|
|
|
|
|
|
|
conflicts_with "gitea", because: "both install gitea binaries"
|
|
|
|
def install
|
2021-10-09 09:53:39 +05:30
|
|
|
if stable.using.blank?
|
|
|
|
filename = GiteaHead.class_variable_get("@@filename")
|
|
|
|
else
|
|
|
|
filename = downloader.cached_location
|
|
|
|
end
|
2021-11-29 02:15:57 +05:30
|
|
|
apply_ad_hoc_signature(filename)
|
Fix homebrew tap by removing head and shipping compiled binaries (#136)
fixes #135
This fix Homebrew tap by removing the head method and shipping only pre-compiled binaries, as you guys already ship binaries for most (all?) supported platforms.
Also, for gitea.rb and tea.rb, I removed the curl for fetching files checksum, because for every install, it runs `curl` 5 times, slowing the install. So, I created a script to bump versions to latest and fix sha256 checksum in the formula files.
I created also an gitea-head and tea-head formulae to download latest pre-compiled binaries for head, and here we are fetching checksum by `curl`, as I imagine, it is not common/recommended scenario.
IMO, this is the best possible approach for shipping binaries from a custom tap.
Co-authored-by: Marcos de Oliveira <markinholiveira@gmail.com>
Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/136
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: markkrj <markkrj@noreply.gitea.io>
Co-committed-by: markkrj <markkrj@noreply.gitea.io>
2021-06-29 23:30:18 +05:30
|
|
|
bin.install filename => "gitea"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/gitea", "--version"
|
|
|
|
end
|
|
|
|
end
|