mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-04-13 11:50:34 +02:00
fix: improve brew formula (#2261)
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
parent
b030cfdced
commit
e2c93f5f39
@ -198,8 +198,39 @@ func buildFormula(ctx *context.Context, brew config.Homebrew, client client.Clie
|
||||
return doBuildFormula(ctx, data)
|
||||
}
|
||||
|
||||
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")
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
func doBuildFormula(ctx *context.Context, data templateData) (string, error) {
|
||||
t, err := template.New(data.Name).Parse(formulaTemplate)
|
||||
data = fixDataDownloads(data)
|
||||
|
||||
t, err := template.
|
||||
New(data.Name).
|
||||
Funcs(template.FuncMap{
|
||||
"join": strings.Join,
|
||||
}).
|
||||
Parse(formulaTemplate)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
@ -130,7 +130,6 @@ func TestFormulaeSimple(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assertDefaultTemplateData(t, formulae)
|
||||
require.NotContains(t, formulae, "def caveats")
|
||||
require.NotContains(t, formulae, "depends_on")
|
||||
require.NotContains(t, formulae, "def plist;")
|
||||
}
|
||||
|
||||
|
@ -3,26 +3,30 @@ package brew
|
||||
import "github.com/goreleaser/goreleaser/pkg/config"
|
||||
|
||||
type templateData struct {
|
||||
Name string
|
||||
Desc string
|
||||
Homepage string
|
||||
Version string
|
||||
License string
|
||||
Caveats []string
|
||||
Plist string
|
||||
DownloadStrategy string
|
||||
Install []string
|
||||
PostInstall string
|
||||
Dependencies []config.HomebrewDependency
|
||||
Conflicts []string
|
||||
Tests []string
|
||||
CustomRequire string
|
||||
CustomBlock []string
|
||||
MacOSAmd64 downloadable
|
||||
MacOSArm64 downloadable
|
||||
LinuxAmd64 downloadable
|
||||
LinuxArm downloadable
|
||||
LinuxArm64 downloadable
|
||||
Name string
|
||||
Desc string
|
||||
Homepage string
|
||||
Version string
|
||||
License string
|
||||
Caveats []string
|
||||
Plist string
|
||||
DownloadStrategy string
|
||||
Install []string
|
||||
PostInstall string
|
||||
Dependencies []config.HomebrewDependency
|
||||
Conflicts []string
|
||||
Tests []string
|
||||
CustomRequire string
|
||||
CustomBlock []string
|
||||
MacOSAmd64 downloadable
|
||||
MacOSArm64 downloadable
|
||||
LinuxAmd64 downloadable
|
||||
LinuxArm downloadable
|
||||
LinuxArm64 downloadable
|
||||
HasMacOSDownloads bool
|
||||
HasLinuxDownloads bool
|
||||
MacOSArches []string
|
||||
LinuxArches []string
|
||||
}
|
||||
|
||||
type downloadable struct {
|
||||
@ -45,46 +49,62 @@ class {{ .Name }} < Formula
|
||||
license "{{ .License }}"
|
||||
{{ end -}}
|
||||
bottle :unneeded
|
||||
{{- if and (not .MacOSAmd64.DownloadURL) (not .MacOSArm64.DownloadURL) (or .LinuxAmd64.DownloadURL .LinuxArm.DownloadURL .LinuxArm64.DownloadURL) }}
|
||||
{{- if and (not .HasLinuxDownloads) .HasMacOSDownloads }}
|
||||
depends_on :macos
|
||||
{{- end }}
|
||||
{{- if and (not .HasMacOSDownloads) .HasLinuxDownloads }}
|
||||
depends_on :linux
|
||||
{{- end }}
|
||||
{{- printf "\n" }}
|
||||
{{- if .MacOSAmd64.DownloadURL }}
|
||||
if OS.mac? && Hardware::CPU.intel?
|
||||
url "{{ .MacOSAmd64.DownloadURL }}"
|
||||
{{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }}
|
||||
sha256 "{{ .MacOSAmd64.SHA256 }}"
|
||||
end
|
||||
{{- end }}
|
||||
{{- if .MacOSArm64.DownloadURL }}
|
||||
if OS.mac? && Hardware::CPU.arm?
|
||||
url "{{ .MacOSArm64.DownloadURL }}"
|
||||
{{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }}
|
||||
sha256 "{{ .MacOSArm64.SHA256 }}"
|
||||
|
||||
{{- if .HasMacOSDownloads }}
|
||||
on_macos do
|
||||
{{- if .MacOSAmd64.DownloadURL }}
|
||||
if Hardware::CPU.intel?
|
||||
url "{{ .MacOSAmd64.DownloadURL }}"
|
||||
{{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }}
|
||||
sha256 "{{ .MacOSAmd64.SHA256 }}"
|
||||
end
|
||||
{{- end }}
|
||||
{{- if .MacOSArm64.DownloadURL }}
|
||||
if Hardware::CPU.arm?
|
||||
url "{{ .MacOSArm64.DownloadURL }}"
|
||||
{{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }}
|
||||
sha256 "{{ .MacOSArm64.SHA256 }}"
|
||||
end
|
||||
{{- end }}
|
||||
|
||||
depends_on arch: [{{ join .MacOSArches ", " }}]
|
||||
end
|
||||
{{- end }}
|
||||
|
||||
{{- if .LinuxAmd64.DownloadURL }}
|
||||
if OS.linux? && Hardware::CPU.intel?
|
||||
url "{{ .LinuxAmd64.DownloadURL }}"
|
||||
{{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }}
|
||||
sha256 "{{ .LinuxAmd64.SHA256 }}"
|
||||
end
|
||||
{{- end }}
|
||||
{{- if and .HasMacOSDownloads .HasLinuxDownloads }}{{ printf "\n" }}{{ end }}
|
||||
|
||||
{{- if .LinuxArm.DownloadURL }}
|
||||
if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
|
||||
url "{{ .LinuxArm.DownloadURL }}"
|
||||
{{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }}
|
||||
sha256 "{{ .LinuxArm.SHA256 }}"
|
||||
end
|
||||
{{- end }}
|
||||
{{- if .HasLinuxDownloads }}
|
||||
on_linux do
|
||||
{{- if .LinuxAmd64.DownloadURL }}
|
||||
if Hardware::CPU.intel?
|
||||
url "{{ .LinuxAmd64.DownloadURL }}"
|
||||
{{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }}
|
||||
sha256 "{{ .LinuxAmd64.SHA256 }}"
|
||||
end
|
||||
{{- end }}
|
||||
{{- if .LinuxArm.DownloadURL }}
|
||||
if Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
|
||||
url "{{ .LinuxArm.DownloadURL }}"
|
||||
{{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }}
|
||||
sha256 "{{ .LinuxArm.SHA256 }}"
|
||||
end
|
||||
{{- end }}
|
||||
{{- if .LinuxArm64.DownloadURL }}
|
||||
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||
url "{{ .LinuxArm64.DownloadURL }}"
|
||||
{{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }}
|
||||
sha256 "{{ .LinuxArm64.SHA256 }}"
|
||||
end
|
||||
{{- end }}
|
||||
|
||||
{{- if .LinuxArm64.DownloadURL }}
|
||||
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||
url "{{ .LinuxArm64.DownloadURL }}"
|
||||
{{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }}
|
||||
sha256 "{{ .LinuxArm64.SHA256 }}"
|
||||
depends_on arch: [{{ join .LinuxArches ", " }}]
|
||||
end
|
||||
{{- end }}
|
||||
|
||||
|
@ -7,10 +7,15 @@ class CustomBlock < Formula
|
||||
homepage "https://github.com/goreleaser"
|
||||
version "1.0.1"
|
||||
bottle :unneeded
|
||||
depends_on :macos
|
||||
|
||||
if OS.mac? && Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
on_macos do
|
||||
if Hardware::CPU.intel?
|
||||
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"
|
||||
|
@ -7,10 +7,15 @@ class CustomDownloadStrategy < Formula
|
||||
homepage "https://github.com/goreleaser"
|
||||
version "1.0.1"
|
||||
bottle :unneeded
|
||||
depends_on :macos
|
||||
|
||||
if OS.mac? && Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz", :using => GitHubPrivateRepositoryReleaseDownloadStrategy
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
on_macos do
|
||||
if Hardware::CPU.intel?
|
||||
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
|
||||
|
@ -8,10 +8,15 @@ class CustomRequire < Formula
|
||||
homepage "https://github.com/goreleaser"
|
||||
version "1.0.1"
|
||||
bottle :unneeded
|
||||
depends_on :macos
|
||||
|
||||
if OS.mac? && Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz", :using => CustomDownloadStrategy
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
on_macos do
|
||||
if Hardware::CPU.intel?
|
||||
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
|
||||
|
11
internal/pipe/brew/testdata/default.rb.golden
vendored
11
internal/pipe/brew/testdata/default.rb.golden
vendored
@ -7,10 +7,15 @@ class Default < Formula
|
||||
homepage "https://github.com/goreleaser"
|
||||
version "1.0.1"
|
||||
bottle :unneeded
|
||||
depends_on :macos
|
||||
|
||||
if OS.mac? && Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
on_macos do
|
||||
if Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
|
||||
depends_on arch: [:x86_64]
|
||||
end
|
||||
|
||||
depends_on "zsh" => :optional
|
||||
|
@ -7,10 +7,15 @@ class DefaultGitlab < Formula
|
||||
homepage "https://gitlab.com/goreleaser"
|
||||
version "1.0.1"
|
||||
bottle :unneeded
|
||||
depends_on :macos
|
||||
|
||||
if OS.mac? && Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
on_macos do
|
||||
if Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
|
||||
depends_on arch: [:x86_64]
|
||||
end
|
||||
|
||||
depends_on "zsh" => :optional
|
||||
|
11
internal/pipe/brew/testdata/foo_is_bar.rb.golden
vendored
11
internal/pipe/brew/testdata/foo_is_bar.rb.golden
vendored
@ -7,10 +7,15 @@ class FooIsBar < Formula
|
||||
homepage ""
|
||||
version "1.0.1"
|
||||
bottle :unneeded
|
||||
depends_on :macos
|
||||
|
||||
if OS.mac? && Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
on_macos do
|
||||
if Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
|
||||
depends_on arch: [:x86_64]
|
||||
end
|
||||
|
||||
def install
|
||||
|
@ -8,17 +8,26 @@ class MultipleArmv5 < Formula
|
||||
version "1.0.1"
|
||||
bottle :unneeded
|
||||
|
||||
if OS.mac? && Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
on_macos do
|
||||
if Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
|
||||
depends_on arch: [:x86_64]
|
||||
end
|
||||
if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
|
||||
url "https://dummyhost/download/v1.0.1/armv5.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||
url "https://dummyhost/download/v1.0.1/arm64.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
|
||||
on_linux do
|
||||
if Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
|
||||
url "https://dummyhost/download/v1.0.1/armv5.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||
url "https://dummyhost/download/v1.0.1/arm64.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
|
||||
depends_on arch: [:aarch64, :arm]
|
||||
end
|
||||
|
||||
depends_on "zsh"
|
||||
|
@ -8,17 +8,26 @@ class MultipleArmv6 < Formula
|
||||
version "1.0.1"
|
||||
bottle :unneeded
|
||||
|
||||
if OS.mac? && Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
on_macos do
|
||||
if Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
|
||||
depends_on arch: [:x86_64]
|
||||
end
|
||||
if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
|
||||
url "https://dummyhost/download/v1.0.1/armv6.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||
url "https://dummyhost/download/v1.0.1/arm64.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
|
||||
on_linux do
|
||||
if Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
|
||||
url "https://dummyhost/download/v1.0.1/armv6.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||
url "https://dummyhost/download/v1.0.1/arm64.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
|
||||
depends_on arch: [:aarch64, :arm]
|
||||
end
|
||||
|
||||
depends_on "zsh"
|
||||
|
@ -8,17 +8,26 @@ class MultipleArmv7 < Formula
|
||||
version "1.0.1"
|
||||
bottle :unneeded
|
||||
|
||||
if OS.mac? && Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
on_macos do
|
||||
if Hardware::CPU.intel?
|
||||
url "https://dummyhost/download/v1.0.1/bin.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
|
||||
depends_on arch: [:x86_64]
|
||||
end
|
||||
if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
|
||||
url "https://dummyhost/download/v1.0.1/armv7.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||
url "https://dummyhost/download/v1.0.1/arm64.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
|
||||
on_linux do
|
||||
if Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
|
||||
url "https://dummyhost/download/v1.0.1/armv7.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||
url "https://dummyhost/download/v1.0.1/arm64.tar.gz"
|
||||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
end
|
||||
|
||||
depends_on arch: [:aarch64, :arm]
|
||||
end
|
||||
|
||||
depends_on "zsh"
|
||||
|
45
internal/pipe/brew/testdata/test.rb.golden
vendored
45
internal/pipe/brew/testdata/test.rb.golden
vendored
@ -9,25 +9,34 @@ class Test < Formula
|
||||
license "MIT"
|
||||
bottle :unneeded
|
||||
|
||||
if OS.mac? && Hardware::CPU.intel?
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_x86_64.tar.gz"
|
||||
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c68"
|
||||
on_macos do
|
||||
if Hardware::CPU.intel?
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_x86_64.tar.gz"
|
||||
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c68"
|
||||
end
|
||||
if Hardware::CPU.arm?
|
||||
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
|
||||
if OS.mac? && Hardware::CPU.arm?
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_arm64.tar.gz"
|
||||
sha256 "1633f61598ab0791e213135923624eb342196b349490sadasdsadsadasdasdsd"
|
||||
end
|
||||
if OS.linux? && Hardware::CPU.intel?
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Linux_x86_64.tar.gz"
|
||||
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c67"
|
||||
end
|
||||
if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Arm6.tar.gz"
|
||||
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c67"
|
||||
end
|
||||
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Arm64.tar.gz"
|
||||
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c67"
|
||||
|
||||
on_linux do
|
||||
if Hardware::CPU.intel?
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Linux_x86_64.tar.gz"
|
||||
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c67"
|
||||
end
|
||||
if Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Arm6.tar.gz"
|
||||
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c67"
|
||||
end
|
||||
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||
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
|
||||
|
@ -9,17 +9,21 @@ class Test < Formula
|
||||
bottle :unneeded
|
||||
depends_on :linux
|
||||
|
||||
if OS.linux? && Hardware::CPU.intel?
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Linux_x86_64.tar.gz"
|
||||
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c67"
|
||||
end
|
||||
if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Arm6.tar.gz"
|
||||
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c67"
|
||||
end
|
||||
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Arm64.tar.gz"
|
||||
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c67"
|
||||
on_linux do
|
||||
if Hardware::CPU.intel?
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Linux_x86_64.tar.gz"
|
||||
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c67"
|
||||
end
|
||||
if Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Arm6.tar.gz"
|
||||
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c67"
|
||||
end
|
||||
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user