Add Linux support with Nix packaging, Flatpak, desktop integration, and CI#197
Add Linux support with Nix packaging, Flatpak, desktop integration, and CI#197ndarilek wants to merge 1 commit intotrypsynth:masterfrom
Conversation
|
Thanks a ton for this! This is a fairly sizable diff and I do have software engineering employment, so my apologies if this takes me a little bit to merge, but thanks a ton for all your work! It does look like CMakeLists has some conflicts, but those should be easy to fix. |
|
No problem, I'm in no rush here. FWIW, I'm partway through a fix for the inaccessible TOC tree--creating a tree widget type that either loosely wraps the native WX widget on most platforms, or just uses a GTK TreeView under WXGTK. I can either add that to this branch or to a followup PR--just wanted to let you know I wasn't done. That one will include a pile of C++ though, so it'll probably need closer review. |
|
|
I just fixed the conflicts between this branch and master. I also have, on separate branches rebased on this one, fixes for both the inaccessible ToC tree under Linux, as well as a fix for the menu accelerators not working in the text area, including a GTK-based live region implementation. Again, no rush on reviewing any of this--I can run my own branch indefinitely under Nix pretty easily. Just wanted to keep the PR updated as to the state of things. |
|
Seems I just broke some of your hard work when I merged in my Rust branch. Sorry about that :( |
|
Also, FWIW, a custom implementation of the tree for linux would be great, we're already going to have to do this for the mac :( wxWidgets really sucks at treeviews on not Windows, I guess. |
458c9b4 to
eeadb63
Compare
|
Please hold off just a bit, there's an odd issue where it segfaults if I attempt to open a book when launching from the desktop but works fine when opened from the CLI. Going to attach a debugger and investigate that today, should hopefully have a fix later this afternoon. |
|
Okay, sounds good. Thanks for all your work! |
|
Sorry for the delay. Aside from the conflicts, this should be ready to merge. Note that it doesn't have the textarea and tree accessibility fixes which I saved for followup. If you like, I can throw those plus the conflicts at Claude Code over the next few days. I also found that it's possible to make AppImages pretty easily from Nix packages. I can set those up instead of or in addition to flatpaks if you'd like something a little more download-and-run for Linux. |
|
Yeah, feel free to throw all that into this PR, I would like to have basic Linux support in 0.8, but 0.8 is also going to involve rewriting the entire GUI in Rust, so it may be a little |
|
Okay, well the entire GUI has been rewritten minus IPC, and I plan to do that next. Last huge bit of merge conflicts for a while, sorry... |
|
@ndarilek are you still interested in working on this? If not, I'll close it. |
|
Actively working on this now, but am hitting odd issues trying to make treeviews accessible. Something about trying to shoehorn GTK trees into WX is causing activedescendant mismatches, and arrowing around ToCs presents things out of order. I'll keep trying to work around it, but worst case I do know that a flat list works, so if all else fails I'll switch to that and we'll just take the slightly suckier experience on Linux like we're used to anyway. :) |
|
Ah, okay so get ready to hate wx. |
|
Oh believe me, I've hated WX's tree control for years, it's been a pretty huge tetanus-encrusted papercut for Linux users for as long as I can remember. Which tree control do you mean by "that tree control?" The one I'm working on, or some other WX control? I now have an awful hack--take a ListView, append ": collapsed" or ": expanded" to the accessible representations of rows as appropriate, announce "expanded" or "collapsed" via the live region when left/right arrow is pressed, and if you hold your nose and don't use flat review it feels mostly identical. I'll probably ship this unless you have another approach. It isn't quite what I want but at least gets us something that does the job. |
|
I mean wxDataViewTreeCtrl, https://docs.wxwidgets.org/stable/classwx_data_view_tree_ctrl.html It apparently is accessible o nmacOS and Linux. |
|
Got it. The good news is that it is accessible. The bad news is 2-fold:
So we're back to the weird hacky list, and someone smarter than me will have to figure it out. But as of now both the ToC and elements list use this hacky tree and are accessible. Marking this as draft because I haven't fully reviewed the code myself yet. I'll do that tomorrow morning or early afternoon and undraft. |
|
I think we're good for review. Sorry that took longer than anticipated. After initially starting work on this, I did discover a fairly easy way to convert Nix derivations into AppImage bundles. Not sure if you have a preference on those vs. Flatpak but happy to add that as well, to replace flatpak with appimage, etc. Also happy to help get this on Flathub so it's available in most distros' software centers. But we'll save either for followups. |
This gets most of Paperback running under Linux, either directly on Nix via
nix run, or via Flatpak standalone bundles attached to each PR/release.What doesn't work?
Even with these limitations, having something I can throw just about any document I might want to read at under Linux and get back an accessible version is something I was going to write myself 6 months ago, so thanks for saving me the trouble! I think this is very useful even in its current form.
Followup
Additional tasks to pursue once this gets merged--I'm happy to look into them but I'll put them here in case others might be interested:
Disclosure
This PR was made largely with the help of Claude Code. As per my usual agentic workflow, I've reviewed every line of this PR. While nothing appears to
rm -rf /or exfiltrate the nuclear launch codes, I can't speak to:-Werrorflagged a bunch of issues with my version of GCC, and not having done C++ in a couple decades, I let Claude fix them. At first glance it looks like pedantic style/correctness fixes, and a variable rename to prevent a shadowing-related error, but that's the smallest part of the diff so hopefully should be easy to review.