diff --git a/config/config.go b/config/config.go index ec395f7cb..0bf71fe19 100644 --- a/config/config.go +++ b/config/config.go @@ -35,22 +35,21 @@ func (r Repo) String() string { // Homebrew contains the brew section type Homebrew struct { - Name string `yaml:",omitempty"` - GitHub Repo `yaml:",omitempty"` - CommitAuthor CommitAuthor `yaml:"commit_author,omitempty"` - Folder string `yaml:",omitempty"` - Caveats string `yaml:",omitempty"` - Plist string `yaml:",omitempty"` - Install string `yaml:",omitempty"` - Dependencies []string `yaml:",omitempty"` - BuildDependencies []string `yaml:"build_dependencies,omitempty"` - Test string `yaml:",omitempty"` - Conflicts []string `yaml:",omitempty"` - Description string `yaml:",omitempty"` - Homepage string `yaml:",omitempty"` - SkipUpload bool `yaml:"skip_upload,omitempty"` - DownloadStrategy string `yaml:"download_strategy,omitempty"` - SourceTarball string `yaml:"-"` + Name string `yaml:",omitempty"` + GitHub Repo `yaml:",omitempty"` + CommitAuthor CommitAuthor `yaml:"commit_author,omitempty"` + Folder string `yaml:",omitempty"` + Caveats string `yaml:",omitempty"` + Plist string `yaml:",omitempty"` + Install string `yaml:",omitempty"` + Dependencies []string `yaml:",omitempty"` + Test string `yaml:",omitempty"` + Conflicts []string `yaml:",omitempty"` + Description string `yaml:",omitempty"` + Homepage string `yaml:",omitempty"` + SkipUpload bool `yaml:"skip_upload,omitempty"` + DownloadStrategy string `yaml:"download_strategy,omitempty"` + SourceTarball string `yaml:"-"` } // Scoop contains the scoop.sh section diff --git a/pipeline/brew/brew.go b/pipeline/brew/brew.go index fb693e835..82491be0b 100644 --- a/pipeline/brew/brew.go +++ b/pipeline/brew/brew.go @@ -165,23 +165,22 @@ func dataFor(ctx *context.Context, client client.Client, artifact artifact.Artif } var cfg = ctx.Config.Brew return templateData{ - Name: formulaNameFor(ctx.Config.Brew.Name), - DownloadURL: ctx.Config.GitHubURLs.Download, - Desc: cfg.Description, - Homepage: cfg.Homepage, - Repo: ctx.Config.Release.GitHub, - Tag: ctx.Git.CurrentTag, - Version: ctx.Version, - Caveats: split(cfg.Caveats), - File: artifact.Name, - SHA256: sum, - Dependencies: cfg.Dependencies, - BuildDependencies: cfg.BuildDependencies, - Conflicts: cfg.Conflicts, - Plist: cfg.Plist, - Install: split(cfg.Install), - Tests: split(cfg.Test), - DownloadStrategy: cfg.DownloadStrategy, + Name: formulaNameFor(ctx.Config.Brew.Name), + DownloadURL: ctx.Config.GitHubURLs.Download, + Desc: cfg.Description, + Homepage: cfg.Homepage, + Repo: ctx.Config.Release.GitHub, + Tag: ctx.Git.CurrentTag, + Version: ctx.Version, + Caveats: split(cfg.Caveats), + File: artifact.Name, + SHA256: sum, + Dependencies: cfg.Dependencies, + Conflicts: cfg.Conflicts, + Plist: cfg.Plist, + Install: split(cfg.Install), + Tests: split(cfg.Test), + DownloadStrategy: cfg.DownloadStrategy, }, nil } diff --git a/pipeline/brew/brew_test.go b/pipeline/brew/brew_test.go index 9e820c474..6a091950a 100644 --- a/pipeline/brew/brew_test.go +++ b/pipeline/brew/brew_test.go @@ -107,9 +107,6 @@ func TestRunPipe(t *testing.T) { "custom_download_strategy": func(ctx *context.Context) { ctx.Config.Brew.DownloadStrategy = "GitHubPrivateRepositoryReleaseDownloadStrategy" }, - "build_from_source": func(ctx *context.Context) { - ctx.Config.Brew.BuildDependencies = []string{"go"} - }, } { t.Run(name, func(t *testing.T) { folder, err := ioutil.TempDir("", "goreleasertest") diff --git a/pipeline/brew/template.go b/pipeline/brew/template.go index 07cf6a8f8..d457fbb67 100644 --- a/pipeline/brew/template.go +++ b/pipeline/brew/template.go @@ -3,35 +3,29 @@ package brew import "github.com/goreleaser/goreleaser/config" type templateData struct { - Name string - Desc string - Homepage string - DownloadURL string - Repo config.Repo // FIXME: will not work for anything but github right now. - Tag string - Version string - Caveats []string - File string - SHA256 string - Plist string - DownloadStrategy string - Install []string - Dependencies []string - BuildDependencies []string - Conflicts []string - Tests []string + Name string + Desc string + Homepage string + DownloadURL string + Repo config.Repo // FIXME: will not work for anything but github right now. + Tag string + Version string + Caveats []string + File string + SHA256 string + Plist string + DownloadStrategy string + Install []string + Dependencies []string + Conflicts []string + Tests []string } const formulaTemplate = `class {{ .Name }} < Formula desc "{{ .Desc }}" homepage "{{ .Homepage }}" - {{ if .BuildDependencies -}} - url "{{ .DownloadURL }}/{{ .Repo.Owner }}/{{ .Repo.Name }}/archive/{{ .Tag }}.tar.gz" - head "https://github.com/{{ .Repo.Owner }}/{{ .Repo.Name }}.git" - {{- else -}} url "{{ .DownloadURL }}/{{ .Repo.Owner }}/{{ .Repo.Name }}/releases/download/{{ .Tag }}/{{ .File }}" {{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }} - {{- end }} version "{{ .Version }}" sha256 "{{ .SHA256 }}" @@ -40,11 +34,6 @@ const formulaTemplate = `class {{ .Name }} < Formula depends_on "{{ . }}" {{- end }} {{- end -}} - {{- with .BuildDependencies -}} - {{ range $index, $element := . }} - depends_on "{{ . }}" => :build - {{- end }} - {{- end -}} {{- with .Conflicts }} {{ range $index, $element := . }} diff --git a/www/content/homebrew.md b/www/content/homebrew.md index 1683dc97a..de596373f 100644 --- a/www/content/homebrew.md +++ b/www/content/homebrew.md @@ -64,11 +64,6 @@ brew: - git - zsh - # Packages your source package depends on. - build_dependencies: - - make - - gcc - # Packages that conflict with your package. conflicts: - svn