Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Homebrew recipe? #12

Open
Govinda-Fichtner opened this issue Oct 13, 2018 · 10 comments
Open

Homebrew recipe? #12

Govinda-Fichtner opened this issue Oct 13, 2018 · 10 comments

Comments

@Govinda-Fichtner
Copy link

Just wanted to ask if there is already a homebrew recipe for installing jiq on Mac OS X. If not I would give it a try...

@fiatjaf
Copy link
Owner

fiatjaf commented Oct 13, 2018

I don't know of any. Actually I don't know what "homebrew recipe" stands for, but it would be great to have one!

@shhac
Copy link

shhac commented Jan 10, 2019

Would also try it out if this is available.

Homebrew is a package manager for macOS (think like a mac equivalent of apt).
It lets you either distribute binaries OR if there is no binary for the user's architecture, it downloads the source + deps and builds on their machine.

https://docs.brew.sh/Formula-Cookbook

You can see the entry for jid here, so I imagine jiq would be very similar
https://github.com/Homebrew/homebrew-core/blob/master/Formula/jid.rb


If you're on linux, there is actually a port for homebrew, which works great due to how it lets you build from source when binaries aren't available

http://linuxbrew.sh/

@fiatjaf
Copy link
Owner

fiatjaf commented Jan 10, 2019

It should be basically the same, just change the names.

@shhac
Copy link

shhac commented Jan 10, 2019

Give a quick go writing a formula, but it seems that brew grabs the upstream of the fork rather than this project..

class Jiq < Formula
  desc "Jid on jq"
  homepage "https://github.com/fiatjaf/jiq"
  url "https://github.com/fiatjaf/jiq/archive/0.6.0.tar.gz"
  sha256 "db070dee12bb292e8d79a509f41b1c22a2afe17969c4b5065871b41102888ef2"

  depends_on "go" => :build

  def install
    ENV["GOPATH"] = buildpath
    ENV["GO111MODULE"] = "on"

    src = buildpath/"src/github.com/fiatjaf/jiq"
    src.install buildpath.children
    src.cd do
      # this will throw as it actually grabbed jid and not jiq
      system "go", "build", "-o", bin/"jiq", "cmd/jiq/jiq.go"
      prefix.install_metafiles
    end
  end

  test do
    assert_match "jiq version v#{version}", shell_output("#{bin}/jiq --version")
  end
end

@davidfetter
Copy link

Bump

@OliverJAsh
Copy link

@shhac Can you give your formula another go with the new 0.6.1 release? It looks like the release you were targeting was created all the way back in 2016, presumably before this fork was created. 0.6.1 was created 14 days ago, so it should be good to use.

@martriay
Copy link

Any news on this?

@fiatjaf
Copy link
Owner

fiatjaf commented Jul 16, 2020

I'm waiting for someone to do it, because I have no idea of how to do it.

Maybe just publishing binaries for MacOS would suffice?

EDIT: binaries are already published.

@ktsuench
Copy link

ktsuench commented May 2, 2022

This is the formula I used based off of @shhac original formula:

class Jiq < Formula
  desc "Jid on jq"
  homepage "https://github.com/fiatjaf/jiq"
  url "https://github.com/fiatjaf/jiq.git",
      tag: "v0.7.2",
      revision: "5dec899436617c8f30cb1526dc76108dc8486cbf"
  head "https://github.com/fiatjaf/jiq.git", branch: "master"

  depends_on "go" => :build

  def install
    ENV["GOPATH"] = buildpath
    ENV["GO111MODULE"] = "on"

    src = buildpath/"src/github.com/fiatjaf/jiq"
    src.install buildpath.children
    src.cd do
      system "go", "build", "-o", bin/"jiq", "cmd/jiq/jiq.go"
      prefix.install_metafiles
    end
  end

  test do
    assert_match "jiq version v#{version}", shell_output("#{bin}/jiq --version")
  end
end

If you want the lastest changes on master, run brew install ./jiq.rb --HEAD otherwise just run brew install ./jiq.rb after saving the above codeblock as a file jiq.rb.

@mahmoudhossam
Copy link

Related: Homebrew/homebrew-core#70434

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants