alire-project / alire

Command-line tool from the Alire project and supporting library
GNU General Public License v3.0
271 stars 47 forks source link

Homebrew on macOS #1172

Open simonjwright opened 1 year ago

simonjwright commented 1 year ago

I've been working on integrating Homebrew into Alire.

I've got it to a point where it works for me; I patched up the ci-linux and ci-macos workflows, the only reasons the latter failed were

-Ada -> Alire_Host_Distro: distro_unknown
+Ada -> Alire_Host_Distro: macos

and

-C -> Alire_Host_Distro: distro_unknown
+C -> Alire_Host_Distro: macos

Is this work of interest? If so, what branch should I base a PR on? (I would do a merge squash on the relevant commits I've made so far in my homebrew-dev branch.)

Further,

Fabien-Chouteau commented 1 year ago

Thanks a lot @simonjwright !

I commented on PR for code details.

  • Is macos OK for Alire.Platforms.Distribution? (actually MacOS). Obviously the test that failed above needs fixing!

As I said on the PR, the distribution should be Homebrew.

* Is there a way of running github actions for testing crates using this version of `alr` from my repo?

I am not sure, we have the Crate CI stuff but I don't know if you can use it (@mosteo ).

* What would the process be for amending external manifests, e.g. `sdl2`, `sdl2_ttf`, `sdl2_image`? We could invite Mac users to make/propose changes as needed?

Once we have this merged in Alire, we can have an extra CI platform that is macOS + Homebew and then you will be able to op PR on the community index to add Homebew packages to the externals.

* What would the process be for amending crates that could use this ability, e.g. `sdlada` (which is maintained by @mosteo but authored by Luke Guest), and ought to use `$HOMEBREW_PREFIX` to find include & library files (Homebrew don't recommend moving it from its default location, but the default location is different between x86_64 and aarch64!)

If it's a change to the code then you have to see with the authors. If it's a change to the manifest then we can review it.