hybridgroup / gort

Command Line Interface (CLI) for RobotOps

Home Page:http://gort.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Help installing gort using Homebrew

alanbsmith opened this issue Β· comments

Hi,

I'm just trying to get artoo-sphero working, but I'm having trouble installing gort. I downloaded the zip folders, ran the exec files, but they just open a terminal screen that says process completed at the end. I'm not sure where to go next. Any help would be greatly appreciated.

Hi, @alanbsmith. You need to run gort from the command line. First, open a terminal window before running it. Hope that helps!

If you provide more information of what you are trying to do, we can help you to get started...

That functionality is no longer available in Artoo. Now it is all Gort.

There should really be a Homebrew recipe... if anyone is interested I could try making one? πŸ˜„

That would be great!

Unfortunately the guys at Homebrew want it to be compiled at installation (downloaded as source) - how would I set the target directory (where it places the binary) after compiling it?

The correct location is /usr/local/Cellar/gort/_version_/gort and then it's symlinked into /usr/local/bin.

I have some progress with Homebrew formula, but need help, because I'm not Go programmer =)
This is my local formula:

require "language/go"

class Gort < Formula
  homepage "https://github.com/hybridgroup/gort"
  head "https://github.com/hybridgroup/gort.git"

  url "https://github.com/hybridgroup/gort/archive/0.3.0.tar.gz"
  sha1 "c99e2896d4a6f5b46cdcb3cb38fbec9fb0c2bfe2"

  depends_on "go" => :build

  go_resource "github.com/jteeuwen/go-bindata" do
    url "https://github.com/jteeuwen/go-bindata/archive/v3.0.7.tar.gz"
    sha1 "b348b4f39204a31a87fd396ea1418e2ef5b07e90"
  end

  go_resource "github.com/laher/goxc" do
    url "https://github.com/laher/goxc/archive/v0.8.3.tar.gz"
    sha1 "f5c89df9b48b967b9243dde1e49e3d33d554eff1"
  end

  def install
    ENV["GOPATH"] = buildpath

    system "go", "get", "golang.org/x/tools/cmd/vet"
    system "go", "get", "github.com/codegangsta/cli"
    system "go", "get", "github.com/hybridgroup/gort/commands"
    system "go", "get", "github.com/jlaffaye/ftp"
    system "go", "get", "github.com/ziutek/telnet"
    system "go", "get", "golang.org/x/net/html/atom"
    system "go", "get", "golang.org/x/net/websocket"
    system "go", "get", "golang.org/x/text/encoding/..."
    system "go", "get", "golang.org/x/text/transform"

    Language::Go.stage_deps resources, buildpath/"src"
    cd "#{buildpath}/src/github.com/jteeuwen/go-bindata" do
      system "go", "install", "github.com/jteeuwen/go-bindata/..."
    end
    cd "#{buildpath}/src/github.com/laher/goxc" do
      system "go", "install", "github.com/laher/goxc"
    end
    ENV.prepend_path "PATH", buildpath/"bin"

    system "make", "release"
  end

  test do
    system "#{bin}/gort", "help"
  end
end

and I try to run brew install --verbose --debug gort
and have errors on go-test task:

# golang.org/x/text/collate/tools/colcmp
cannot load DWARF output from $WORK/golang.org/x/text/collate/tools/colcmp/_obj//_cgo_.o: decoding dwarf section info at offset 0x0: too short
--- FAIL: TestConn (0.00s)
    client_test.go:17: dial tcp 127.0.0.1:21: connection refused
--- FAIL: TestConn2 (77.14s)
    client_test.go:128: dial tcp 63.245.215.46:52537: operation timed out
FAIL
FAIL    github.com/jlaffaye/ftp 77.162s

and

--- FAIL: TestPingGoogle (0.13s)
    ping_test.go:125: got reflection from 173.194.113.209:0
    ping_test.go:105: write udp: no route to host [2a00:1450:4010:c02::67]:0
FAIL
FAIL    golang.org/x/net/icmp   0.157s

full dump in: https://gist.github.com/Jesterovskiy/daf3ae182377a1b83b20

πŸ‘ brew support would be great !

+1 for brew support!

If somebody knows Go language - help me with error, that I showed before =)

Noticed this article today http://octavore.com/posts/2016/02/15/distributing-go-apps-os-x\

Anyone want to take a pass at this?

3 options for homebrew tap:

  1. Hybrid group can do their own tap and supply recipes for their products.
    Pros: Controlled by you and can be quickly updated (quicker than Homebrew PRs). Single tap for all hybrid group binary releases.
    Cons: Discoverability. One must install your tap before they can use your apps.

  2. Submit a PR to homebrew/binary: https://github.com/homebrew/homebrew-binary
    Pros: A commonly tapped (though small) official binary repo
    Cons: Wait times for PRs.

  3. Submit a PR to cask: http://caskroom.io/
    Pros: Another largely visible tap.
    Cons: Mostly for larger apps, not single executables. Wait time for PRs.

Either way, the base recipe should be simple (and the same) for all three (not using source, but binary releases)... just need to pick one!

I think most people find Gort via the website or via Gobot/Cylon.js/Artoo so discoverability is not so much an issue, so it sounds like option 1. However, if we want more people to know about Gort, than option 3?

IMHO go with #1 as it provides flexibility in releases and multiple binaries...

A few good examples of why option 1 would be best

Hashicorp and Docker go binaries... They both rely on homebrew and/or caskroom and the wait times and uncoordination of PRs made it so versions became incompatible quickly... or duplicated... If one binary depended on another (docker and it's tools) you can have lots of people updating brew and having mismatched software... Hashicorp has some of their tools in homebrew proper, some in homebrew/binary, and some in caskroom... Requires a user to tap both in order to have a full suite (if they so want)...

At this point, people who are using caskroom look for things like Chrome... not sure if you're going to gain traction by being in Caskroom (but I don't know the stats on caskroom tap numbers)

OK, I am convinced on option 1.

This works for 0.5.2

https://gist.github.com/whoisjake/56c8d887c12bb592d546

Tested it on my local machine

So...

  1. Create hybridgroup/homebrew-tools
  2. Put gort.rb (contents in gist at top level)
  3. Update READMEs
brew install hybridgroup/tools/gort

or the old way

brew tap hybridgroup/tools
brew install gort

Caveat If they already have gort on their system at /usr/local/bin ... they'll have to do:

brew link --overwrite gort

I was just about to ask how to do all that, @whoisjake thank you πŸ˜„

OK created https://github.com/hybridgroup/homebrew-tools would you like to submit a PR with your recipe, @whoisjake

 βœ” jake ~  $ brew install hybridgroup/tools/gort
==> Tapping hybridgroup/tools
Cloning into '/usr/local/Library/Taps/hybridgroup/homebrew-tools'...
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 4 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), done.
Checking connectivity... done.
Tapped 1 formula (27 files, 17.5K)
==> Installing gort from hybridgroup/tools
==> Downloading https://s3.amazonaws.com/gort-io/0.5.2/gort_0.5.2_darwin_amd64.z
Already downloaded: /Library/Caches/Homebrew/gort-0.5.2.zip
🍺  /usr/local/Cellar/gort/0.5.2: 4 files, 7.8M, built in 0 seconds

Done! Also, this repo can be used for all of you binary distributions, not just gort!

And also added to README. I think we can now close this, thanks so much @whoisjake