From 9ff199e4dc557bdabcc2c5b9d0df22dc2919ecc1 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Mon, 4 Sep 2023 04:10:36 +0000 Subject: [PATCH] feat: migrate tea into homebrew-core (#175) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently both are supported in homebrew-core, so it might be a good idea to consolidate and increase the collaborations :) ``` $ brew install tea Warning: Treating tea as a formula. For the cask, use homebrew/cask/tea ==> Fetching tea ==> Downloading https://ghcr.io/v2/homebrew/core/tea/manifests/0.9.2 ######################################################################################################################## 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/tea/blobs/sha256:29e52360a6c2dcb368442a59161640e1cf96e565ab59d1520e42c6a2ce38b ######################################################################################################################## 100.0% ==> Pouring tea--0.9.2.arm64_ventura.bottle.tar.gz ==> Caveats Bash completion has been installed to: /opt/homebrew/etc/bash_completion.d ==> Summary 🍺 /opt/homebrew/Cellar/tea/0.9.2: 9 files, 20.7MB ``` For head build, it would be: ``` $ brew install --HEAD tea ``` Co-authored-by: Lunny Xiao Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/175 Reviewed-by: Lunny Xiao Co-authored-by: Rui Chen Co-committed-by: Rui Chen --- tap_migrations.json | 3 +++ tea-head.rb | 48 -------------------------------------- tea.rb | 56 --------------------------------------------- 3 files changed, 3 insertions(+), 104 deletions(-) create mode 100644 tap_migrations.json delete mode 100644 tea-head.rb delete mode 100644 tea.rb diff --git a/tap_migrations.json b/tap_migrations.json new file mode 100644 index 0000000..7058d96 --- /dev/null +++ b/tap_migrations.json @@ -0,0 +1,3 @@ +{ + "tea": "homebrew/core" +} diff --git a/tea-head.rb b/tea-head.rb deleted file mode 100644 index c7b9c18..0000000 --- a/tea-head.rb +++ /dev/null @@ -1,48 +0,0 @@ -require_relative './utils/macos_codesign.rb' - -class TeaHead < Formula - desc "A command line tool to interact with Gitea servers" - homepage "https://gitea.com/gitea/tea" - version "main" - license "MIT" - - os = OS.mac? ? "darwin" : "linux" - arch = case Hardware::CPU.arch - when :i386 then "386" - when :x86_64 then "amd64" - when :arm64 then "arm64" - else - raise "tea: Unsupported system architecture #{Hardware::CPU.arch}" - end - - @@filename = "tea-#{version}-#{os}-#{arch}" - @@url = "https://dl.gitea.com/tea/#{version}/#{@@filename}" - @@using = :nounzip - - if os == "darwin" || arch == "amd64" - @@url += ".xz" - @@using = nil - depends_on "xz" - end - - @@sha256 = %x[ curl -sL #{@@url}.sha256 ].split.first - - sha256 @@sha256 - url @@url, - using: @@using - - conflicts_with "tea", because: "both install tea binaries" - def install - if stable.using.blank? - filename = TeaHead.class_variable_get("@@filename") - else - filename = downloader.cached_location - end - apply_ad_hoc_signature(filename) - bin.install filename => "tea" - end - - test do - system "#{bin}/tea", "--version" - end -end diff --git a/tea.rb b/tea.rb deleted file mode 100644 index f96cd4d..0000000 --- a/tea.rb +++ /dev/null @@ -1,56 +0,0 @@ -require_relative './utils/macos_codesign.rb' - -class Tea < Formula - desc "A command line tool to interact with Gitea servers" - homepage "https://gitea.com/gitea/tea" - version "0.9.2" - license "MIT" - - os = OS.mac? ? "darwin" : "linux" - arch = case Hardware::CPU.arch - when :i386 then "386" - when :x86_64 then "amd64" - when :arm64 then "arm64" - else - raise "tea: Unsupported system architecture #{Hardware::CPU.arch}" - end - - @@filename = "tea-#{version}-#{os}-#{arch}" - @@url = "https://dl.gitea.com/tea/#{version}/#{@@filename}" - @@using = :nounzip - - if os == "darwin" || arch == "amd64" - @@url += ".xz" - @@using = nil - depends_on "xz" - end - - @@sha256 = case "#{os}-#{arch}" - when "linux-386" then "206e47c04f70e13abd910a4f0c0c5097a463bc8899e83d1041822f04f69c52d9" # binary - when "linux-amd64" then "32ed8217e7facc718f45d272d8549ad3d2f82735855cc25bfca525c8f72a4d8d" - when "linux-arm64" then "60d18d6c0c2939befde79afd63becc42204acbeafe89dfe46017447882676a35" # binary - when "darwin-amd64" then "96b5696bc1fa3b65292ac3ac36809e1466df574c3537bd6b0d905ebadeae67bd" - when "darwin-arm64" then "fb5e295f901837aa6290942bad5cfd7f12fd218fbce8501e0f3f63807faae236" - else - raise "tea: Unsupported system #{os}-#{arch}" - end - - sha256 @@sha256 - url @@url, - using: @@using - - conflicts_with "tea-head", because: "both install tea binaries" - def install - if stable.using.blank? - filename = Tea.class_variable_get("@@filename") - else - filename = downloader.cached_location - end - apply_ad_hoc_signature(filename) - bin.install filename => "tea" - end - - test do - system "#{bin}/tea", "--version" - end -end