atlas-engineer / nyxt

Nyxt - the hacker's browser.
https://nyxt-browser.com/
9.91k stars 413 forks source link

Provide a homebrew formula for OSX #577

Open wakatara opened 4 years ago

wakatara commented 4 years ago

Few people use macports these days in favour of homebrew.

Would it be possible to have a formula for Next. I do believe it would perhaps increase the community size trying or contributing amongst the applerati.

jmercouris commented 4 years ago

Hello! Thank you for your interest in the project. I don't use Homebrew and will be unable to make a formula. I believe one used to exist, but I am not sure. Anyone in the community is welcome to package Next for Homebrew and we could list it in the install options :-)

ghost commented 4 years ago

Just wanted to say I'm in the same boat. I found out about the browser yesterday, went to install it today and there was no bundle(?) and no homebrew so... I gave up rather quickly.

Not that my using the browser is of critical importance to anyone, just giving my experience 😄

svetlyak40wt commented 4 years ago

I found Next browser already installable with Homebrew Cask. Just do:

brew cask install next
jhhb commented 4 years ago

I took a shot at making a homebrew formula against master, but hit a wall with WebKitGTK+. I targeted master because there seemed to be fewer dependencies to wrestle with versus the official releases.

All of the other dependencies seem to be available as brew formulae, WebKitGTK+ doesn't seem to be, probably because it's not very well supported for Mac (I believe it requires some patching to get it to work).

It does exist in Macports and has a stable build there: https://ports.macports.org/port/webkit2-gtk/summary and a development port at https://ports.macports.org/port/webkit2-gtk-devel/summary.

I think if we wanted to get a homebrew formula for Nyxt working, it would make sense to try either of:

(1) Try the QT installation route (2) Port the linked webkit2-gtk-devel MacPort into a HomeBrew formula, and use that formula in a Homebrew formula for Nyxt

edit: add correct Macports port

Ambrevar commented 4 years ago

Thanks for looking into this, this is very helpful! :)

(1) Try the QT installation route

The Qt renderer support is broken at the moment. Hopefully Someone© will find time to work on it soon ;)

(2) Port the linked webkit2-gtk-devel MacPort into a HomeBrew formula, and use that formula in a Homebrew formula for Nyxt

This is probably the right way to go :)

outthought commented 4 years ago

Nyxt looks promising. I can't seem to get it installed on Mac OS X. A brew formula would be highly appreciated. Thank you.

svetlyak40wt commented 4 years ago

Probably it is better to publish it AppStore?

outthought commented 4 years ago

Brew is superior to the AppStore.

svetlyak40wt commented 4 years ago

Probably, but I'm not sure that all OSX users are aware of Homebrew. But sure all of them learned how to use AppStore because it is provided out of the box.

Ambrevar commented 4 years ago

Cc @jmercouris

jmercouris commented 4 years ago

Thank you for your interest. The challenge is porting webkitgtk+ to Homebrew from MacPorts. You can take a look at the portfile and the patches if you are interested, the information is all there. The only thing blocking us from releasing a package that users can simply install (think of a "xyz.pkg" style file) is that for some reason when we produce it, external URLs refuse to load. No idea why this is!

jhhb commented 4 years ago

When I looked at trying to do this several months ago, the Qt rendering was broken, which blocked trying to setup the homebrew formula using Qt, and made using WebkitGTK+ as the rendering engine the only viable path.

Because of the difficulty I had with webkitGTK and trying to get a working build, before I consider giving it another go I wanted to ask:

(1) Is the Qt rendering still broken? (2) If so, do we know if there's a timeline for unbreaking it? 😄 (3) Irrespective of the status of Qt, is there a long-term plan to support both Qt and WebkitGTK+ ?

jmercouris commented 4 years ago
  1. Qt rendering is still broken
  2. Timeline, no not available
  3. Yes, tentatively. I am personally not fully committed to it. I am not opposed to it either.
junwei-wang commented 3 years ago

Probably, but I'm not sure that all OSX users are aware of Homebrew. But sure all of them learned how to use AppStore because it is provided out of the box.

People who does not use Homebrew, probably would never use Nyxt.

albert-ying commented 3 years ago

Any update on this? It would be significantly easier to install with Homebrew... I just tried to install Nyxt using MacPorts and it took me hours to figure out how, and still encountered some error for dependencies. 😢

outthought commented 3 years ago

brew install next This command just succeeded for me. It installs Next.app into /Applications.

babariviere commented 3 years ago

@outthought It's an old version of this project. The current homebrew formula is at version 1.2.0 while the most up-to-date version is 1.5.0.

popoiopo commented 3 years ago

I would also be very interested in a brew formula, just tried it with MacPorts and also hit a wall.. :(

gamecubate commented 3 years ago

I would love to pipe in, saying how interested I am in this and asking for a brew formula, but that might be annoying, so I won't. :)

jmercouris commented 3 years ago

What if you could run it in Docker? would that work?

gamecubate commented 3 years ago

It might, but I would prefer not to go that way, i.e., I'm looking for as seamless installation and running experience as possible. I've been spoiled by brew and I wouldn't want to stray far from that. I'll keep a lookout for any changes in your project as I find it very interesting.

svetlyak40wt commented 3 years ago

Did somebody one of these Homebrew formulas for WebkitGTK?

jmercouris commented 3 years ago

I really believe the most promising direction to be here: https://github.com/NixOS/nixpkgs/pull/123298

BR00l commented 3 years ago

Building in Mac as of now feels a bit painfull, I think the best and easiest way to get through this, is by adding this to brew repo, having a lot of problems building atm.

incidentist commented 3 years ago

I'm working on a Nyxt homebrew formula that synthesizes previous attempts. As a first step, I've made a webkitgtk formula that builds cleanly on my 2017 MBP running Big Sur: https://github.com/incidentist/homebrew-nyxt . macOS folks can help by running brew install --build-from-source incidentist/nyxt/webkitgtk, waiting awhile for it to build (it took 85 minutes for me) and letting me know what happens (as well as your hardware/software config).

My level of expertise here is pretty low. I'm mostly blindly synthesizing the Nix package definitions into Homebrew formula. If it looks like I'm missing something obvious, I probably am.

svetlyak40wt commented 3 years ago

@incidentist I've tried to run the build, but it failed. Created a separate issue: https://github.com/incidentist/homebrew-nyxt/issues/1

incidentist commented 3 years ago

My tap repo at https://github.com/incidentist/homebrew-nyxt now has an initial Nyxt formula as well. See the README there for updated instructions. It's initial in the sense that it builds and runs (!) but it throws some funky warnings, does not respond to most keystrokes, and every website fails with TLS Certificate Error. I am following the Nix discussions here, here and here. Basically the Nix folks are doing a great job of patching things to run on Darwin, and I will try to bring those patches into the homebrew formula until they are available upstream.

abrampers commented 3 years ago

@incidentist Thanks for your effort to create a Nyxt homebrew formula 🙂. I have tried to install Nyxt using your brew formula and it successfully installed! However, few problems I have faced was:

  1. Nyxt was noticably slow compared to other browser I'm currently using (firefox) in startup time and webpage loading
  2. My keyboard doesn't work when I want to type. I used vi and already in insert mode but typing regularly won't show characters typed. However, commands and modifier keys are still working (C-SPC, C-h b, etc). I noticed that if I type with Command key pressed, the characters will show, but this will be a problem because Cmd-c, Cmd-v, Cmd-h is mapped to their functionalities on OS level.

I'd love to help to do some more testing if necessary. Thanks!

My System: MacBook Pro (16-inch, 2019) macOS Big Sur 11.2.2

incidentist commented 3 years ago

@abrampers Thanks for giving it a shot! Yes, it's basically unusable right now because of the issues you mentioned, and the fact that it doesn't work with https sites (did you encounter that?). I am going to try applying some of the patches from this Nix PR and see what happens. Also, it doesn't seem to build at all on earlier versions of macOS. So yeah, still a few things to iron out before it's ready for everyday use.

incidentist commented 3 years ago

@abrampers I've pushed a few changes to the homebrew formula. In particular, the keyboard fix from https://github.com/NixOS/nixpkgs/pull/126101#issuecomment-867818507 has been integrated and works for me.

If you want to try again, please reinstall incidentist/nyxt/webkitgtk and incidentist/nyxt/nyxt. The main thing I'm curious about is: are you able to load any SSL sites? I cannot, and I don't know why. Something in libsoup or glib-networking is not finding my TLS CA certs. I wonder if you have the same problem. I think this new build is still pretty slow, but being able to use the keyboard makes it feel faster :).

(I also tried building 2.1.0 but that gave me a runtime crash I haven't had a chance to look into)

abrampers commented 3 years ago

@incidentist Thanks for keeping up the work on this front. I have reinstalled Nyxt with the updated homebrew formula and here's how it goes:

  1. I can successfully open SSL sites (https://google.com, https://youtube.com)
  2. Keyboard issue is gone. I can type without any noticable issue now
  3. When opening youtube, the video can't play (I'm not sure whether this is homebrew formula issue or not)
  4. Startup time is still slow (about 5-7 secs for me)
  5. Nyxt is still crashing after 2/3 minutes of usage
ag91 commented 3 years ago

I have just installed it as well on Mac and the formula seems to work fine. I will check if I am missing some dependencies for YouTube videos. My Nyxt did not crash after 2/3 minutes (I am on Big Sur). @Ambrevar just a note: also this formula suffers of #1632 , same error. Hopefully fixing that, will fix this as well.

Reefersleep commented 3 years ago

@NightMachinary I think you misread @junwei-wang 's comment in more than one way; he's arguing for a brew formula, not against it, and I don't think he meant to be derogatory, but rather that if any effort were to be spent, it'd be better spent on a brew formula rather than putting Nyxt on the App Store, since the type of users who'd be interested in Nyxt would probably be developers who primarily install stuff via brew (or at least moreso than via the App Store).

Here's another +1 from me for a brew formula of Nyxt.

NightMachinery commented 3 years ago

@NightMachinary I think you misread @junwei-wang 's comment in more than one way; he's arguing for a brew formula, not against it, and I don't think he meant to be derogatory, but rather that if any effort were to be spent, it'd be better spent on a brew formula rather than putting Nyxt on the App Store, since the type of users who'd be interested in Nyxt would probably be developers who primarily install stuff via brew (or at least moreso than via the App Store).

Here's another +1 from me for a brew formula of Nyxt.

@junwei-wang He’s right, I am sorry. I misread your comment. I should cultivate a habit to (carefully) reread things that sound controversial.

andrewcrook commented 2 years ago

I found Next browser already installable with Homebrew Cask. Just do:

brew cask install next

says its deprecated in cask rb file I presume this browser was once called next and renamed to nyxt?

+1 for getting this working and on homebrew

Ambrevar commented 2 years ago

I presume this browser was once called next and renamed to nyxt?

Yes.

Maybe try https://github.com/incidentist/homebrew-nyxt, it may work for you.

shaunsingh commented 1 year ago

Looks like homebrew-nyxt is deprecated now as well

I think it might be looking into using qtwebengine on Darwin + nix (https://github.com/NixOS/nixpkgs/pull/203310 seems like a good start)

shaunsingh commented 1 year ago

Its also worth noting that I did get webkitgtk to build on macOS (https://github.com/shaunsingh/nix-darwin-dotfiles/blob/6f6969028e10fc8afa7b504453c6eb086e6c5b83/flake.nix#L395), though its a year-old build and not very performant.

Its actually cl-cffi-gtk that fails to build on macOS altogether

DieracDelta commented 1 year ago

With this old version of webkitgtk, were you able to build nyxt on macOS @shaunsingh ? I see a nyxt-3 in that commit's flake.nix. But it's since been removed?

shaunsingh commented 1 year ago

I was able to build nyxt, but the app bundle wouldn't launch. However, the test web browser bundled with webkitgtk didn't work either, so its likely a webkitgtk issue, I still think its possible to build nyxt on macOS through nix, I just haven't gotten around to it yet.

I see a nyxt-3

That was a quick test to see if I could package nyxt. I did manage to, but it had quite a few mismatched dependencies. Your best bet is to clone the nyxt repo directly, use the build-scripts/shell.nix, and then run make tasks in a nix-shell

DieracDelta commented 1 year ago

Hmm, their shell.nix doesn't build b/c webkitgtk is broken. Maybe pulling your version in may help...

shaunsingh commented 1 year ago

I modified shell.nix to replace webkitgtk with an overlay, I am currently using asahi linux to build and test nyxt, Ibut will try to set aside some time to see if I can get the mac build working as well.

DieracDelta commented 1 year ago

I'm getting the following warnings when I overlay the shell.nix with the old version of webkitgtk from your flake then run make all:

WARNING:
   Type initializer for class 'GdkX11DeviceXI2' (GType 'GDK-X11-DEVICE-XI2') is invalid: foreign symbol 'gdk_x11_device_xi2_get_type'
WARNING:
   Type initializer for class 'GdkX11DeviceManagerCore' (GType 'GDK-X11-DEVICE-MANAGER-CORE') is invalid: foreign symbol 'gdk_x11_device_manager_core_get_type'
WARNING:
   Type initializer for class 'GdkX11DeviceManagerXI2' (GType 'GDK-X11-DEVICE-MANAGER-XI2') is invalid: foreign symbol 'gdk_x11_device_manager_xi2_get_type'
WARNING:
   Type initializer for class 'GtkPlug' (GType 'GTK-PLUG') is invalid: foreign symbol 'gtk_plug_get_type'
WARNING:
   Type initializer for class 'GtkSocket' (GType 'GTK-SOCKET') is invalid: foreign symbol 'gtk_socket_get_type'
WARNING:
   Type initializer for class 'WebKitURISchemeResponse' (GType 'WEBKIT-URI-SCHEME-RESPONSE') is invalid: foreign symbol 'webkit_uri_scheme_response_get_type'

Hmm. The actual error is:

   #<THREAD "main thread" RUNNING {7005260433}>:
  The variable NAME is defined but never used.

What's your modified shell.nix look like on asahi?

shaunsingh commented 1 year ago

on asahi I am using the default shell.nix, the webkitgtk provide by nixos works as expected. on macOS I've only gotten the webkitgtk in my flake to build and run with the test browser, I haven't begun to try with nyxt

DieracDelta commented 1 year ago

This flake builds if the debugger continues past warnings. The resulting executable (if renamed, since it tries to create a directory in the same spot as the executable) stops responding after the following stdout:

WARNING:
   Type initializer for class 'GdkX11DeviceXI2' (GType 'GDK-X11-DEVICE-XI2') is invalid: foreign symbol 'gdk_x11_device_xi2_get_type'
WARNING:
   Type initializer for class 'GdkX11DeviceManagerCore' (GType 'GDK-X11-DEVICE-MANAGER-CORE') is invalid: foreign symbol 'gdk_x11_device_manager_core_get_type'
WARNING:
   Type initializer for class 'GdkX11DeviceManagerXI2' (GType 'GDK-X11-DEVICE-MANAGER-XI2') is invalid: foreign symbol 'gdk_x11_device_manager_xi2_get_type'
WARNING:
   Type initializer for class 'GtkPlug' (GType 'GTK-PLUG') is invalid: foreign symbol 'gtk_plug_get_type'
WARNING:
   Type initializer for class 'GtkSocket' (GType 'GTK-SOCKET') is invalid: foreign symbol 'gtk_socket_get_type'
WARNING:
   Type initializer for class 'WebKitURISchemeResponse' (GType 'WEBKIT-URI-SCHEME-RESPONSE') is invalid: foreign symbol 'webkit_uri_scheme_response_get_type'
Arguments parsed: (FAILSAFE T VERBOSE T URLS NIL) and NIL
Nyxt version 3-pre-release-3
 <INFO> [16:57:50] nyxt start.lisp (start-browser) -
  Source location: #P"/Users/jrestivo/dev/nyxt/"
 <INFO> [16:57:50] nyxt start.lisp (start-browser) - Profile: "nofile"
<DEBUG> [16:57:50] nyxt/renderer/gi-gtk gi-gtk.lisp (ffi-initialize gi-gtk-browser) -
  Initializing GI-GTK Interface
<DEBUG> [16:57:50] nyxt/renderer/gtk gtk.lisp (ffi-initialize gtk-browser) -
  Initializing GTK Interface

What version of webkitgtk are you running with the test browser?

shaunsingh commented 1 year ago

2.36.5, so significantly newer

https://github.com/shaunsingh/nix-darwin-dotfiles/blob/main/derivations/webkitgtk.nix is the new derivation I wrote

shaunsingh commented 1 year ago

Compiling with the above, similar issue

zuma-tests". Please only define "montezuma" and secondary systems with a name starting with "montezuma/" (e.g. "montezuma/test") in that file.
WARNING: System definition file #P"/Users/shauryasingh/Projects/testing/nyxt/_build/cl-fad/cl-fad.asd" contains definition for system "cl-fad-test". Please only define "cl-fad" and secondary systems with a name starting with "cl-fad/" (e.g. "cl-fad/test") in that file.
WARNING:
   Type initializer for class 'GdkX11DeviceXI2' (GType 'GDK-X11-DEVICE-XI2') is invalid: foreign symbol 'gdk_x11_device_xi2_get_type'
WARNING:
   Type initializer for class 'GdkX11DeviceManagerCore' (GType 'GDK-X11-DEVICE-MANAGER-CORE') is invalid: foreign symbol 'gdk_x11_device_manager_core_get_type'
WARNING:
   Type initializer for class 'GdkX11DeviceManagerXI2' (GType 'GDK-X11-DEVICE-MANAGER-XI2') is invalid: foreign symbol 'gdk_x11_device_manager_xi2_get_type'
WARNING:
   Type initializer for class 'GtkPlug' (GType 'GTK-PLUG') is invalid: foreign symbol 'gtk_plug_get_type'
WARNING:
   Type initializer for class 'GtkSocket' (GType 'GTK-SOCKET') is invalid: foreign symbol 'gtk_socket_get_type'
;;; Computing Hangul syllable namesWARNING: redefining S-SERIALIZATION::SERIALIZE-SEXP-INTERNAL in DEFGENERIC

main not defined is the error I get as well, stopping buillding

unhandled condition in --disable-debugger mode, quitting
;
; compilation unit aborted
;   caught 2 fatal ERROR conditions
SLYNK's ASDF loader finished.make: *** [makefile:48: nyxt] Error 1
DieracDelta commented 1 year ago

I'm not sure what to make of the error; it looks like a style thing? If I remove the --non-interactive flags from the makefile, then continue with option 0 in the debugger, it builds successfully for me. But hangs on run while initializing gtk. (this is with this webkitgtk 2.36.5)

shaunsingh commented 1 year ago

I'll try to build nyxt against webkitgtk from macports, that way we can isolate if the errors are on the nyxt side or the nix side of things. Likely, its an issue with my nix derivation.

If the macports webkit works, then we can take a look at what flags they enable

johnnyutahh commented 1 year ago

Checking in: any updates on this issue?

I do not yet see a working nyxt formula on my system. Details below.

$ date
Mon May 29 09:44:28 CDT 2023
$ brew update
Already up-to-date.
$
$ brew search nyxt
==> Formulae
nyx

==> Casks
next
$
$ sw_vers
ProductName:    macOS
ProductVersion: 12.6.5
BuildVersion:   21G531
$