pup: depend on gox at build time

Closes #22020.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
commitay 2017-12-23 08:17:03 +10:00 committed by ilovezfs
parent 28a3efcf6f
commit 11d4eaf80a

View file

@ -1,5 +1,3 @@
require "language/go"
class Pup < Formula
desc "Parse HTML at the command-line"
homepage "https://github.com/EricChiang/pup"
@ -17,26 +15,13 @@ class Pup < Formula
end
depends_on "go" => :build
go_resource "github.com/mitchellh/iochan" do
url "https://github.com/mitchellh/iochan.git",
:revision => "87b45ffd0e9581375c491fef3d32130bb15c5bd7"
end
go_resource "github.com/mitchellh/gox" do
url "https://github.com/mitchellh/gox.git",
:revision => "6e9ee79eab7bb1b84155379b3f94ff9a87b344e4"
end
depends_on "gox" => :build
def install
ENV["GOPATH"] = buildpath
dir = buildpath/"src/github.com/ericchiang/pup"
dir.install buildpath.children
Language::Go.stage_deps resources, buildpath/"src"
ENV.prepend_create_path "PATH", buildpath/"bin"
cd("src/github.com/mitchellh/gox") { system "go", "install" }
cd dir do
arch = MacOS.prefer_64_bit? ? "amd64" : "386"
system "gox", "-arch", arch, "-os", "darwin", "./..."