2021-11-29 02:15:57 +05:30
|
|
|
require './utils/macos_codesign.rb'
|
|
|
|
|
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"
|
2021-09-25 21:15:59 +05:30
|
|
|
version "0.8.0"
|
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}"
|
2021-10-09 09:53:39 +05:30
|
|
|
when "linux-386" then "c006b38d6cbede7c3932bb762df1a06fa485e6c2af03d736bd3fa304a60376ba" # binary
|
2021-09-25 21:15:59 +05:30
|
|
|
when "linux-amd64" then "29976cc605f0da406efdc010d4a63ff225f990ebb49efe9f54ecf5c5796e771e"
|
2021-10-09 09:53:39 +05:30
|
|
|
when "linux-arm64" then "f85754008200f4ce3a1de50f77eb72d4960fffd069d19c0655376357a70a5226" # binary
|
2021-09-25 21:15:59 +05:30
|
|
|
when "darwin-amd64" then "8d9aaef2c9e851759a575892d5af8dd2130f0b9c5705189572a282f812126a48"
|
|
|
|
when "darwin-arm64" then "50c14a8bee6df16483eb370dc5491e85db3a0f1a21c8d3790e0b4be0531cf6bd"
|
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
|