2021-11-29 02:42:27 +05:30
|
|
|
require_relative './utils/macos_codesign.rb'
|
2021-11-29 02:15:57 +05:30
|
|
|
|
2019-04-25 22:37:52 +05:30
|
|
|
class Tea < Formula
|
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
|
|
|
desc "A command line tool to interact with Gitea servers"
|
2019-06-02 22:59:48 +05:30
|
|
|
homepage "https://gitea.com/gitea/tea"
|
2023-03-14 12:49:47 +05:30
|
|
|
version "0.9.2"
|
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
|
|
|
|
|
|
|
os = OS.mac? ? "darwin" : "linux"
|
|
|
|
arch = case Hardware::CPU.arch
|
2021-10-09 09:53:39 +05:30
|
|
|
when :i386 then "386"
|
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
|
|
|
when :x86_64 then "amd64"
|
|
|
|
when :arm64 then "arm64"
|
|
|
|
else
|
|
|
|
raise "tea: Unsupported system architecture #{Hardware::CPU.arch}"
|
|
|
|
end
|
|
|
|
|
|
|
|
@@filename = "tea-#{version}-#{os}-#{arch}"
|
2021-10-09 09:53:39 +05:30
|
|
|
@@url = "https://dl.gitea.io/tea/#{version}/#{@@filename}"
|
|
|
|
@@using = :nounzip
|
|
|
|
|
|
|
|
if os == "darwin" || 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 = case "#{os}-#{arch}"
|
2023-03-14 12:49:47 +05:30
|
|
|
when "linux-386" then "f0d0080db67403bb872a3ff71d77f56f2fc38d95d1e72796e5e85fce4f2a7692" # binary
|
|
|
|
when "linux-amd64" then "32ed8217e7facc718f45d272d8549ad3d2f82735855cc25bfca525c8f72a4d8d"
|
|
|
|
when "linux-arm64" then "be1aa529ca50dfad520206c21ee9c8b179482c11c4f462ddcfa0101d798fbaea" # binary
|
|
|
|
when "darwin-amd64" then "96b5696bc1fa3b65292ac3ac36809e1466df574c3537bd6b0d905ebadeae67bd"
|
|
|
|
when "darwin-arm64" then "fb5e295f901837aa6290942bad5cfd7f12fd218fbce8501e0f3f63807faae236"
|
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
|
|
|
else
|
|
|
|
raise "tea: Unsupported system #{os}-#{arch}"
|
|
|
|
end
|
|
|
|
|
|
|
|
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 "tea-head", because: "both install tea binaries"
|
|
|
|
def install
|
2021-10-09 09:53:39 +05:30
|
|
|
if stable.using.blank?
|
|
|
|
filename = Tea.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 => "tea"
|
2019-04-25 22:37:52 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/tea", "--version"
|
|
|
|
end
|
|
|
|
end
|