alire icon indicating copy to clipboard operation
alire copied to clipboard

Support the Popular Homebrew Package Manager

Open Joebeazelman opened this issue 2 years ago • 12 comments

It would be great if Alire could support the Homebrew package manager. It's a very popular command-line utility for installing programs, tools and utilities through the terminal's command line interface. It was once exclusive to MacOS, but has since expanded its support to Linux and Windows via WSL. Making Alire Homebrew installable helps evangelize Ada to a wider developer base by lowering their resistance to exploring Ada. Moreover, Homebrew automatically notifies the user of any new releases with the option to automatically perform updates, or change versions.

Alire and Homebrew are remarkably similar in their capabilities and command-line syntax. The equivalent of a crate is a Formula which is hosted in public repos, called Taps, and specialized or experimental ones, called Forks. The only issue I foresee is the requirement that Formulas must be buildable using the latest, stable version of Clang. It shouldn't be a big issue since Homebrew downloads and builds dependencies required by the Formula such as GCC.

https://docs.brew.sh/Adding-Software-to-Homebrew#formulae

Joebeazelman avatar May 25 '22 21:05 Joebeazelman

Support for Homebrew is definitely something we want to have. We have yet to find time or someone to work on it.

Fabien-Chouteau avatar May 30 '22 09:05 Fabien-Chouteau

Can I do it?

Joebeazelman avatar May 30 '22 21:05 Joebeazelman

Of course :)

There are two things to consider:

  • Have Alire available as a package in Homebrew
  • Have Alire support the installation of external dependencies using Homebew (like we do with msys2 for windows)

Fabien-Chouteau avatar May 31 '22 10:05 Fabien-Chouteau

Note that currently we only support one PM per platform, so you'd be looking at making homebrew the "official" PM for macOS. For that, take a look at the Alire.Origins.Deployers.System.* hierarchy.

Is homebrew always available on macOS, or would that invove Alire possibly installing it, like we do for msys2 on Windows?

mosteo avatar May 31 '22 12:05 mosteo

Is homebrew always available on macOS, or would that invove Alire possibly installing it, like we do for msys2 on Windows?

One of the reason for installing msys2 automatically on Windows is to have access to essential tools like git and curl. I don't know if there is as strong of a need for that on macOS.

Fabien-Chouteau avatar May 31 '22 14:05 Fabien-Chouteau

Then we can just make use of it if available, and let users install it if wanted

mosteo avatar May 31 '22 15:05 mosteo

  • Have Alire available as a package in Homebrew

I tried to add 1.1.1. It was rejected because it is binary and no Ada compiler in Homebrew.

https://github.com/Homebrew/homebrew-cask/pull/117527

jquorning avatar May 31 '22 20:05 jquorning

"This is true, but we should probably try first anyway. Note that Ada isn't unique in requiring itself to bootstrap -- the same is true for Rust, Go, GHC, LDC, etc."

I don't understand what the last comment means. Try what first?

Joebeazelman avatar May 31 '22 22:05 Joebeazelman

My understanding is that they favor the bootstrapping with an Ada compiler first, even if that's a long process :woman_shrugging:. Anyway, I wouldn't sweat it at this time and wait for 1.2 to drop to try again.

mosteo avatar Jun 01 '22 10:06 mosteo

Indeed the first step would be to get an Ada compiler in Homebrew.

Fabien-Chouteau avatar Jun 01 '22 13:06 Fabien-Chouteau

OK. How about we start with getting Alire on Homebrew? I'll take the initiative.

Joebeazelman avatar Mar 25 '23 13:03 Joebeazelman

OK. How about we start with getting Alire on Homebrew? I'll take the initiative.

I worked a little on the subject and concluded that a Ruby script would do the job. Somewhere on the way I got sidetracked. This is what is available on gh by now, for inspiration: https://github.com/jquorning/AdaNow More inspiration: https://github.com/AJ-Ianozi/getada

jquorning avatar Mar 26 '23 01:03 jquorning