mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #286] macOS: Homebrew / brew support #221
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#221
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @h2ogeek on GitHub (May 30, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/286
Please add homebrew installation support
@vielmetti commented on GitHub (Jul 17, 2022):
it looks like
goreleaserhas support for Homebrew taps, here:https://goreleaser.com/customization/homebrew/
A limitation, though:
"Note that GoReleaser does not generate a valid homebrew-core formula. The generated formulas are meant to be published as homebrew taps, and in their current form will not be accepted in any of the official homebrew repositories."
@Moulick commented on GitHub (Nov 24, 2022):
I made a PR at https://github.com/Homebrew/homebrew-core/pull/116607. This currently only builds the CLI part without the server. Maybe later I can improve this to also handle the npm run build and install parts
@binwiederhier commented on GitHub (Nov 24, 2022):
Very cool.
Is this only for macOS, or will it be available for Linux as well?
What was the issue when you tried the full server support? For macOS I don't officially support that, but if the build is also for Linux it'd be nice to build and install the server like that too. I know it's harder, due to CGO for SQLite, but it'd be sweet.
@Moulick commented on GitHub (Nov 24, 2022):
We can support both MacOs and Linux in brew. Directly building the server on macOS does work (I tried and tested it). CGO should also be fine, not a problem for brew. The only challenge for me for the server is the npm part, not even that but just how to do it cleanly in homebrew's syntax and inbuilt functions aka this
@Moulick commented on GitHub (Nov 24, 2022):
Just tried brew on a Linux cloud machine. Cannot run
brew install --build-from-source ntfythere. I think it'll only be available once https://github.com/Homebrew/homebrew-core/pull/116607 is merged and @BrewTestBot builds the bottles for:x86_64_linux. That's how I think it'll work comparingyq.rband a couple othergobased formula@Moulick commented on GitHub (Nov 24, 2022):
@binwiederhier is docs necessary for the server?
@Moulick commented on GitHub (Nov 24, 2022):
Now I have achieved building web + server + cli in brew. but not the docs as now that needs python
@binwiederhier commented on GitHub (Nov 24, 2022):
Awesome!
The docs are not required, but I'd like to include everything in the build. Do you have to build it from source? Can't you just pull down the binary dist tarball from GitHub and use that? Or is that now allowed in their policies?
You are largly copying commands from the Makefile, which means stuff will break if I ever change that. Is there a way to reuse build instructions from the Makefile?
@Moulick commented on GitHub (Nov 24, 2022):
Ideally, if we can find any other project that is in brew and also is a node + go combo would make it much easier to reference changes
@decadent commented on GitHub (Nov 25, 2022):
One possible reason is that if anything changes between the OS versions, users need to compile the software from the source. Same goes for when any dependencies or necessary configurations differ from the default.
This can be seen with Brew's compiled ‘bottles’, as Brew only supports the latest MacOS version—unless some bottles are left around by chance.
@AliCihan commented on GitHub (Jan 30, 2023):
hi @Moulick , thanks for your effort. is this addition work-in-progress or abandoned?
@Moulick commented on GitHub (Jan 31, 2023):
I do intend to come back to this. I switched jobs around the end of November and hence got busy 😬. Meanwhile, if you have the capacity to take this, please feel free to help. The thing pending was essentially updating the Makefile to move build out from
ntfy.rbto the makefile. Like the makefile needs to be invokable in a brew build environment with npm, go, sqlite etchttps://github.com/Homebrew/homebrew-core/pull/116607
@AliCihan commented on GitHub (Jan 31, 2023):
unfortunately not :( but great that you mentioned this explicitly, maybe others with the required skills can help.
@nwithan8 commented on GitHub (Mar 14, 2023):
Just wanted to chime in, quickly patched together a formula (client-only, confirmed on MacOS, untested on Linux) in my personal tap (
nwithan8/tap).Was running into the same issue @Moulick was having when trying to compile the server-included CLI on MacOS.
@binwiederhier commented on GitHub (Mar 14, 2023):
Awesome, is the tap something we could make public and/or include in this repo?
As (I believe so) mentioned before, the macOS server is not officially supported, and I don't really want to support it. The Makefile instructions are only there to support iOS development.
@nwithan8 commented on GitHub (Mar 14, 2023):
Absolutely, it's the same as the one I submitted to
pcopy. I'll make a PR for adding it to the README, let me confirm it works on Linux first though.@binwiederhier commented on GitHub (Mar 14, 2023):
Help me out here, you submitted a thing in the README for pcopy, but I meant to actually merge the source of the "tap" to the repo. I also cannot find it on brew.sh at all. But then I don't know how homebrew works at all .... Excuse my ignorance.
@nwithan8 commented on GitHub (Mar 14, 2023):
You're all good.
It would be easiest probably if you had your own tap, and was able to "push" updates to your projects into your own tap via GoReleaser and GitHub Actions.
Instead, in the meantime, I set up my tap to "pull" updates from a couple GitHub projects that don't have brew formula, including this and
pcopy.I believe @Moulick was trying to build a brew formula for this and get it merged into the official Homebrew repo, which has a lot stricter regulations around what gets approved and what doesn't. I took the easy way out with a third-party tap to avoid that PR nightmare process. Although yes, the eventual goal should be to get this merged into Homebrew Core and retire it from my third-party tap.
If you do go about setting up your own tap, by all means, feel free to take the formula I've already made, but you could also start over fresh and automated with something like Homebrew Releaser.
@binwiederhier commented on GitHub (Mar 15, 2023):
Thank you for the explanation. Now that I understand how it works (roughly), let's start with what you did for pcopy, and work our way towards something more official.
Btw, I tried it on Linux and this is what I get:
@nwithan8 commented on GitHub (Apr 9, 2023):
Sorry for the late reply, have been meaning to circle back on this.
Odd that it didn't find
pcopyafter you added the tap. Perhaps abrew updateorbrew upgradewill pull in the package listing?I originally was concerned that you were having issues with the build process on Linux (this brew formula, for both
ntfyandpcopyactually pulls down the source code and compiles it to install it, rather than downloading the pre-compiled assets), but on re-read, that doesn't seem to be the problem. I double-checked the logic via your Makefiles, and it seems like the compile steps will work on both Linux and MacOS (still, I have enhanced the formulas to allow for per-platform compile instructions in case those ever do deviate).I haven't gotten a chance to test this on Linux, but I can confirm that both
pcopyandntfyinstall (download and compile) properly on MacOS from a fresh tap.@Moulick commented on GitHub (Apr 9, 2023):
I created a new PR https://github.com/Homebrew/homebrew-core/pull/127927. This will at least get the ntfy client only build into the official homebrew-core. To add the client+server+web+docs for linux brew needs more work
@Moulick commented on GitHub (Apr 9, 2023):
Well, it's finally merged, now everyone can do
brew install ntfyto get the ntfy cli, both on MacOS and Linux 🎉 🥳. Let's open a separate issue for enhancing the installation to also include docs + web + server?Well, actually adding the server including CGO + SQlite is not difficult, it's the web interface and docs that make it complicated.
@binwiederhier commented on GitHub (Apr 11, 2023):
That is fantastic news. Thank you for your effort. I'll update the install docs.
@binwiederhier commented on GitHub (Apr 11, 2023):
Awesome, great work. Added install instructions https://docs.ntfy.sh/install/#homebrew ❤️
@AliCihan commented on GitHub (Apr 12, 2023):
Thanks a lot, everyone; it is working now.
@binwiederhier , will you close the issue, or is there anything else that needs to be done? I installed it directly with the brew command, and here is how it looks... is there anything else that I have to do in order to get it working?
@binwiederhier commented on GitHub (Apr 22, 2023):
I think that's more of a question for @Moulick
@Moulick commented on GitHub (Apr 22, 2023):
I think nothing more to do, except if we want to bundle the docs + web + server for Linux builds
@nwithan8 commented on GitHub (Jan 26, 2025):
For future travelers, this has been fixed. Apparently, Homebrew is case-sensitive and my folder in my repo needs to be exactly "Formula", not "formula"...