Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide Way to Install with Homebrew on macOS #46

Open
ryandanielspmc opened this issue Dec 29, 2020 · 4 comments
Open

Provide Way to Install with Homebrew on macOS #46

ryandanielspmc opened this issue Dec 29, 2020 · 4 comments
Assignees

Comments

@ryandanielspmc
Copy link

It would be great to be able to install amber with Homebrew on macOS. Please provide a way to do that.

@dalance dalance self-assigned this Dec 30, 2020
@dalance
Copy link
Owner

dalance commented Dec 30, 2020

Homebrew accepts PR through https://github.com/Homebrew/homebrew-core.
If you are interesting in Homebrew packaging, could you try to send PR?
I can't maintain Homebrew package because I don't use brew and don't have macOS machine.

@danopia
Copy link

danopia commented Jan 7, 2021

Similarly, Homebrew on Linux support would be quite nice. This is one of the few tools that I have to seek out a binary of when setting up a Linux dev env vs. adding it to a brew install copy paste.

To my understanding Homebrew wants to be able to build everything from source, so one would want to expect to tell it how to do that (and then the prebuilts will be formed from the same instructions). So it'd probably be smart to look at other Rust taps/formulas/whatever.

@dalance
Copy link
Owner

dalance commented Jan 8, 2021

I used Homebrew on Linux, but don't use now because glibc compatibility issue can't be resolved on my environment.
If anyone try to send PR, the following may be helpful.

https://github.com/Homebrew/homebrew-core/pull/39584/files

I think the formula of amber is like below:

class Amber < Formula
  desc "A code search and replace tool"
  homepage "https://github.com/dalance/amber"
  url "https://github.com/dalance/amber/archive/v0.5.8.tar.gz"
  sha256 "f12e0b176273e011209e7d8613d1b9a049e50aeb536871c1f6c05a9d6a494935"

  depends_on "rust" => :build

  def install
    system "cargo", "install", "--root", prefix, "--path", "."
  end

  test do
    output = shell_output("#{bin}/ambr --help")
    count = output.lines.count
    assert count > 2
    assert output.start_with?("ambr")
  end
end

@danopia
Copy link

danopia commented Jan 8, 2021

I've published a variant of the above on a personal tap, you can use it like so on either platform:

brew install danopia/tools/amber

This is the formula before bottles were inserted: https://github.com/danopia/homebrew-tools/blob/241fb4eeb58e301efb463a1d6bc52ffb9bd34fd1/Formula/amber.rb

I use both macOS and Linux so was able to verify this on both machines. (It's actually quite smooth to make a personal tap...)

To get the formula listed upstream, I believe it has to be PR'd to both https://github.com/Homebrew/homebrew-core and https://github.com/Homebrew/linuxbrew-core (the same file to both repos... There's ongoing work to merge the repos but it has not happened yet). The formula I wrote should pass any criteria though maybe the name should be more specific. Perhaps amber-search to line up with AUR.

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

No branches or pull requests

3 participants