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

Mac homebrew package #49

Closed
LiquidityC opened this issue Jun 12, 2020 · 9 comments
Closed

Mac homebrew package #49

LiquidityC opened this issue Jun 12, 2020 · 9 comments
Labels
hacktoberfest help wanted Extra attention is needed

Comments

@LiquidityC
Copy link
Member

I'd like to make blightmud available through homebrew. However I don't have a mac so even if I did figure out what's needed I wouldn't be able to confirm and test. If anyone has experience with this stuff I'd love some help.

@dnaka91
Copy link

dnaka91 commented Oct 1, 2020

Hello @LiquidityC I created a formula for Blightmud and made a PR to the main Homebrew repository. The brew audit command gave a warning because this repo doesn't have enough stars, forks or watchers so we'll see how it goes.

If it's going to be declined then you would have to create your own tap (a custom homebrew repo) that people can add to install Blightmud.

Homebrew/homebrew-core#61803

@LiquidityC
Copy link
Member Author

Hey, thanks man. Awesome. We'll see how it goes. To be honest I have very little knowledge about homebrew and the inner workings. But I really appreciate the help.

@LiquidityC
Copy link
Member Author

I saw that they responded as you suspected with a reference on notability.
I guess setting up a tap is the next step.

A question for you @dnaka91 since you seem more oriented in homebrew then I am. Would it be valuable to create a tap and provide blightmud in that way? Or would it be just as good to supply a premade mac build with the release?

From my linux perspective I always got the feeling that homebrew is what everyone uses. I'd be happy for some input. 😄

@dnaka91
Copy link

dnaka91 commented Oct 1, 2020

Yes, unfortunately they refused it, but we can set up a new tap. Let me explain you the basic details of homebrew and how taps work. Sorry if it is a little lengthy.

Homebrew in general

So homebrew formulas are just very specialized Ruby scripts with instructions about how to build some piece of software. Everything in the main repository has to adhere to some rules and as it would be asked too much of the maintainers they surely can't take in every single software.

The benefit of being in the main repo is that you get pre-built binaries for free. The homebrew team has a build pipeline that builds the software for several version of MacOS and uploads the binaries to some storage so it can be directly installed on user machines and doesn't have to be compiled every single time.

Personal taps

Creating a personal tap is fairly easy. You run the brew tap-new command to create a new tap repo locally and put your formulas in there. Then you publish it as <username>/homebrew-tap on Github. The generated repo is actually just a README.md and a Formula folder so you don't really have to run the command and a new empty repo will do. Just the repo name is important.

Users will be able to install your software by running either brew install LiquidityC/tap/blightmud or brew tap LiquidityC/tap and then brew install blightmud.

If you want to create a personal tap, you have basically two options at hand:

  • Create a normal formula (same as for the main repo) but homebrew will build it from source for everyone. That means it'll install the full Rust toolchain and locally build Blightmud. This is the easiest but install a ton of extra stuff on the user's machine plus it takes longer to install.
  • Publish binaries with every release in the Blightmud repo and create a formula to simply download the pre-compiled binaries from Github. This means more setup and maintenance for you but is the most convenient for users.

In any case, having a personal tap is an additional maintenance step because after every release you have to update the version, url and hash of the formula.

Benefits to have a tap

  • Compared to the main repo you don't have to follow any rules for the formulas itself.
  • Users can install your software with a single command, don't have to care where to put it and get updates automatically through homebrew.

My recommendation

I would say let's start simple and create a personal tap and then add the exact same formula as I tried for the main repo by PR. Users will have to install it from source for now, but it works.

Then we need to update your current Github Actions pipeline to create the MacOS binaries and include them in new releases. After that's done we update the formulas to use the binaries instead. There is actually a linuxbrew from the same makers so we can adapt that in the formula and users of linuxbrew will be able to install the binaries as well.

@LiquidityC
Copy link
Member Author

Good advice. Well since I don't own a mac I'll let you move your PR to this new repo.

https://github.com/LiquidityC/homebrew-blightmud

Just change everything as needed. And thanks again for all the help. I guess I'll add a macbook to my wishlist for future testing 😄

@LiquidityC
Copy link
Member Author

I'll get to work on a mac-build with the release package.

@LiquidityC
Copy link
Member Author

Hi @dnaka91, I just bumped the version on the tap since we have a new release. There is also a binary mac release included in this release. Feel like helping me out one more time to update the tap?

@dnaka91
Copy link

dnaka91 commented Oct 10, 2020

Sure, no problem 👍

@dnaka91
Copy link

dnaka91 commented Oct 10, 2020

Here is the PR Blightmud/homebrew-blightmud#2.

As I mentioned, if you would like to support Linuxbrew as well (which is just homebrew working on Linux), then you would need to add the linux binary as *.tar.gz or *.zip file to the release as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants