Comments (24)
I too thought it could be complex. Turns out, it is quite easy:
Here's what I went through as macOS user:
- Fork homebrew-core.
- Toggle
brew developer on
. This will activate homebrew "developer mode", i.e. homebrew is just a GH repo: now when you run brew update you will trigger a git pull in your local clone from the master branch. - Run
brew update
. - Run
cd (brew --repository homebrew/core)
to cd into the repo. - Create a new branch
- Add my fork as a remote repo
- Run
brew create --set-name=bob-nvim --rust https://github.com/MordechaiHadad/bob/archive/refs/tags/v2.4.1.tar.gz
The URL is the url of the latest version of bob that I got from bob tags page - Commit and push to my fork.
- Open a PR to homebrew/core to have your formula reviewed (I guess) and merged.
Some more details are at the url I referenced at the top (here too) which is a comment on a similar issue I opened in ttyper
. The only hassle I see with maintaining a homebrew formula is to create a CI/CD workflow to bump the version in the formula itself (the one generated at step 7) and open a similar PR. Depends on how often you plan to release.
from bob.
Hey all, went ahead and made a PR for adding this to homebrew.
@MordechaiHadad fyi, you can make contributions to Homebrew from linux (as brew
supports installing formulae on Linux as well) but depending on the package it can feel more streamlined on macOS.
from bob.
sounds like a good idea, unfortunately I am a bit too busy with other projects.
If you want you can create a PR to do it until I manage to learn and do it
from bob.
awesome! could you elaborate a bit on how homebrew repos work exactly? in Arch linux user repo(AUR) you have to create an account, create a repo with the specification of the package and push it to the repo
from bob.
@baggiponte no problem, sure go ahead lol.
from bob.
Just wanted to point out that you can also have homebrew automatically setup shell completions (see zoxide or rtx for examples).
from bob.
@Amar1729 thats awesome thank you
from bob.
Merged 👍 (i can submit a minor update with instructions to the README in a bit)
also, there is a bump-formulae
GitHub Action that could be used by this repo's CI workflows on release to automatically submit PRs to homebrew, but I'm not as familiar with using it. Also not sure if it's worth it, depending on how frequently new releases happen.
from bob.
Thanks @Amar1729! Just installed bob with brew and it went smoothly. Guess we can close this issue!
from bob.
Would love to! I should have time to work on a draft PR by the weekend.
from bob.
any update on this brew formula yet
from bob.
I plan on adding it, but I barely get the time to do so.
from bob.
sure thanks for the heads up
from bob.
My bad too, barely have time. I am still interested, if you don't mind the waiting I'll gladly take it.
from bob.
I too thought it could be complex. Turns out, it is quite easy:
Here's what I went through as macOS user:
1. Fork [homebrew-core](https://github.com/Homebrew/homebrew-core). 2. Toggle `brew developer on`. This will activate homebrew "developer mode", i.e. homebrew is just a [GH repo](https://github.com/Homebrew/homebrew-core): now when you run brew update you will trigger a git pull in your local clone from the master branch. 3. Run `brew update`. 4. Run `cd (brew --repository homebrew/core)` to cd into the repo. 5. Create a new branch 6. Add my fork as a remote repo 7. Run `brew create --set-name=bob-nvim --rust https://github.com/MordechaiHadad/bob/archive/refs/tags/v2.4.1.tar.gz` The URL is the url of the latest version of bob that I got from [bob tags page](https://github.com/MordechaiHadad/bob/archive/refs/tags) 8. Commit and push to my fork. 9. Open a PR to homebrew/core to have your formula reviewed (I guess) and merged.
Some more details are at the url I referenced at the top (here too) which is a comment on a similar issue I opened in
ttyper
. The only hassle I see with maintaining a homebrew formula is to create a CI/CD workflow to bump the version in the formula itself (the one generated at step 7) and open a similar PR. Depends on how often you plan to release.
Do I have to use macOS for this?
from bob.
Thanks awesome thank you for your work, regarding GH action idk if it's necessary at this point bob is complete-ish so releases are a lot slower now
from bob.
@Amar1729 what does one have to change in the formula file to indicate an update?
from bob.
@MordechaiHadad if nothing changes about the build or test process, generally you only need to change the url
and sha256
. Homebrew's CI will update the bottles
stanza for you during merge.
from bob.
@MordechaiHadad if nothing changes about the build or test process, generally you only need to change the
url
andsha256
. Homebrew's CI will update thebottles
stanza for you during merge.
Oh okay, how do you regenerate new sha256
hashes though?
from bob.
how do you regenerate new
sha256
hashes
There are a couple ways.
-
In practice, what I frequently do is change just the url, then (on my local machine), run
brew install <whatever>
. Homebrew will download the .tar.gz, then warn that the hash doesn't match along with the actual value. Then I just copy the actual value in to the formula file, rerunbrew install
to test, and make a commit+pr. -
There is probably a "better" way to do it with
brew bump-formula-pr
, which i think is something likebrew bump-formula-pr --dry-run --url <url>
(andbrew
will try to determine the new hash if not given?) -
If you don't have brew installed locally, you could simply download the .tar.gz from a release yourself and check the hash (e.g.
sha265sum whatever.tar.gz
).
If you want to do it from within CI, there might be a homebrew action you can use? if not, you would simply do something like (2) in a new manually defined action step using brew (can be installed on macOS or linux) and pass the url from a new release that's been made by a previous CI step
from bob.
how do you regenerate new
sha256
hashesThere are a couple ways.
1. In practice, what I frequently do is change _just_ the url, then (on my local machine), run `brew install <whatever>`. Homebrew will download the .tar.gz, then warn that the hash doesn't match along with the actual value. Then I just copy the actual value in to the formula file, rerun `brew install` to test, and make a commit+pr. 2. There is probably a "better" way to do it with `brew bump-formula-pr`, which i think is something like `brew bump-formula-pr --dry-run --url <url>` (and `brew` will try to determine the new hash if not given?) 3. If you don't have brew installed locally, you could simply download the .tar.gz from a release yourself and check the hash (e.g. `sha265sum whatever.tar.gz`).
If you want to do it from within CI, there might be a homebrew action you can use? if not, you would simply do something like (2) in a new manually defined action step using brew (can be installed on macOS or linux) and pass the url from a new release that's been made by a previous CI step
Anyway I can do it on windows? my WSL arch installed is fucked.
from bob.
Hm - not sure how to check hashes of filles on win of the top of my head but I'd assume there's a powershell cmdlet/windows command to get the hash of a file? If not, could probably just look up "sha256 hash site"? After that, it really is just a change to two lines of a ruby file in a git repo.
from bob.
@Amar1729 what was that CI u mentioned
from bob.
@MordechaiHadad I could draw up an outline for the ci in a new issue to avoid pinging everyone subscribed to this one
from bob.
Related Issues (20)
- error trying to install any version of nvim via bob HOT 5
- Creation of target directories does not honor $HOME variable HOT 2
- Cannot install nightly HOT 29
- Can't install nvim using Powershell 7 HOT 2
- Can't start nvim nightly on macos m2 HOT 11
- [Feature] Add notification system for breaking changes
- Can install, but cannot use neovim HOT 5
- `bob use` breaks in 2.9.0 HOT 4
- [feature]list remote nvim versions available to install HOT 6
- Linked binary opening slower than original HOT 12
- [Feature] add ability installing to system HOT 2
- Compiles Debug build on Windows, but RelWithDebugInfo on Linux HOT 3
- [Feature] Add version list from the command line
- [FIX] Store full commit hash in version sync file instead of short HOT 8
- bug: terminates on usr1 signal HOT 9
- [Feature] bob erase - do not delete non empty installation_location directory HOT 1
- Install based on nvim --version HOT 1
- [Feature] calling bob update without parameters should update the currently used version HOT 2
- certificate error installing nvim latest using bob in ubuntu wsl HOT 4
- Error: File exists (os error 17)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bob.