1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-08 03:31:59 +02:00

fix(brew): depends_on arch

closes #2270

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos A Becker 2021-05-31 16:44:58 +00:00
parent 3ca9e6d4dc
commit b28b203af4
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
13 changed files with 2 additions and 56 deletions

View File

@ -199,26 +199,8 @@ func buildFormula(ctx *context.Context, brew config.Homebrew, client client.Clie
}
func fixDataDownloads(data templateData) templateData {
if data.MacOSAmd64.DownloadURL != "" {
data.HasMacOSDownloads = true
data.MacOSArches = append(data.MacOSArches, ":x86_64")
}
if data.MacOSArm64.DownloadURL != "" {
data.HasMacOSDownloads = true
data.MacOSArches = append(data.MacOSArches, ":aarch64")
}
if data.LinuxAmd64.DownloadURL != "" {
data.HasLinuxDownloads = true
data.LinuxArches = append(data.LinuxArches, ":x86_64")
}
if data.LinuxArm64.DownloadURL != "" {
data.HasLinuxDownloads = true
data.LinuxArches = append(data.LinuxArches, ":aarch64")
}
if data.LinuxArm.DownloadURL != "" {
data.HasLinuxDownloads = true
data.LinuxArches = append(data.LinuxArches, ":arm")
}
data.HasMacOSDownloads = data.MacOSAmd64.DownloadURL != "" || data.MacOSArm64.DownloadURL != ""
data.HasLinuxDownloads = data.LinuxAmd64.DownloadURL != "" || data.LinuxArm64.DownloadURL != "" || data.LinuxArm.DownloadURL != ""
return data
}

View File

@ -25,8 +25,6 @@ type templateData struct {
LinuxArm64 downloadable
HasMacOSDownloads bool
HasLinuxDownloads bool
MacOSArches []string
LinuxArches []string
}
type downloadable struct {
@ -73,8 +71,6 @@ class {{ .Name }} < Formula
sha256 "{{ .MacOSArm64.SHA256 }}"
end
{{- end }}
depends_on arch: [{{ join .MacOSArches ", " }}]
end
{{- end }}
@ -103,8 +99,6 @@ class {{ .Name }} < Formula
sha256 "{{ .LinuxArm64.SHA256 }}"
end
{{- end }}
depends_on arch: [{{ join .LinuxArches ", " }}]
end
{{- end }}

View File

@ -18,8 +18,6 @@ class Test < Formula
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_arm64.tar.gz"
sha256 "1633f61598ab0791e213135923624eb342196b349490sadasdsadsadasdasdsd"
end
depends_on arch: [:x86_64, :aarch64]
end
on_linux do
@ -35,8 +33,6 @@ class Test < Formula
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Arm64.tar.gz"
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c67"
end
depends_on arch: [:x86_64, :aarch64, :arm]
end
devel do

View File

@ -22,8 +22,6 @@ class Test < Formula
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Arm64.tar.gz"
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c67"
end
depends_on arch: [:x86_64, :aarch64, :arm]
end
def install

View File

@ -14,8 +14,6 @@ class CustomBlock < Formula
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
end
depends_on arch: [:x86_64]
end
head "https://github.com/caarlos0/test.git"

View File

@ -14,8 +14,6 @@ class CustomDownloadStrategy < Formula
url "https://dummyhost/download/v1.0.1/bin.tar.gz", :using => GitHubPrivateRepositoryReleaseDownloadStrategy
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
end
depends_on arch: [:x86_64]
end
depends_on "zsh" => :optional

View File

@ -15,8 +15,6 @@ class CustomRequire < Formula
url "https://dummyhost/download/v1.0.1/bin.tar.gz", :using => CustomDownloadStrategy
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
end
depends_on arch: [:x86_64]
end
depends_on "zsh" => :optional

View File

@ -14,8 +14,6 @@ class Default < Formula
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
end
depends_on arch: [:x86_64]
end
depends_on "zsh" => :optional

View File

@ -14,8 +14,6 @@ class DefaultGitlab < Formula
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
end
depends_on arch: [:x86_64]
end
depends_on "zsh" => :optional

View File

@ -13,8 +13,6 @@ class MultipleArmv5 < Formula
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
end
depends_on arch: [:x86_64]
end
on_linux do
@ -26,8 +24,6 @@ class MultipleArmv5 < Formula
url "https://dummyhost/download/v1.0.1/arm64.tar.gz"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
end
depends_on arch: [:aarch64, :arm]
end
depends_on "zsh"

View File

@ -13,8 +13,6 @@ class MultipleArmv6 < Formula
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
end
depends_on arch: [:x86_64]
end
on_linux do
@ -26,8 +24,6 @@ class MultipleArmv6 < Formula
url "https://dummyhost/download/v1.0.1/arm64.tar.gz"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
end
depends_on arch: [:aarch64, :arm]
end
depends_on "zsh"

View File

@ -13,8 +13,6 @@ class MultipleArmv7 < Formula
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
end
depends_on arch: [:x86_64]
end
on_linux do
@ -26,8 +24,6 @@ class MultipleArmv7 < Formula
url "https://dummyhost/download/v1.0.1/arm64.tar.gz"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
end
depends_on arch: [:aarch64, :arm]
end
depends_on "zsh"

View File

@ -14,8 +14,6 @@ class FooIsBar < Formula
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
end
depends_on arch: [:x86_64]
end
def install