Open jhspetersson opened 5 years ago
Should be possible. Are there currently binaries available for GJS and WebKitGTK? I imagine having to compile those two wouldn't be fun, especially the latter.
I don't currently have access to Windows, though, so there's no way I can work on this. Would appreciate any help if anyone's interested in this.
@johnfactotum AppImage (https://github.com/johnfactotum/foliate/issues/115) should be able to do it, for newer versions that have the linux submodule. See discussion here.
Using WSL is just cheating, no? Well, I suppose that's one way to do it. But it would be much better if it can be run natively on Windows and macOS. GTK is still cross-platform, after all, even if that's not their main focus now.
Actually, I've been thinking, if GJS+WebKit apps can be easily run on Windows and macOS, then it'd even become a viable alternative to Electron for developers. If you bundle one of those high quality GTK themes that emulates Windows or macOS UI, then it'd even look very native on those platforms.
If only we had an AppImage for Bionic...
@probonopd What do you think about this discussion? Can you make a test AppImage for Bionic (or higher), so that we can check cross-OS compatibility?
I don't get what a Windows build has to do with AppImage. I also don't get why an AppImage built on trusty or xenial (as we recommend) would not work just fine on bionic.
Trusty is not a supported version anymore. Xenial's support is not enough to meet basic requirements.
Xenial's support is not enough to meet basic requirements.
What do you mean by that and what does this have to do with a "Windows build"?
Providing Windows builds while using WebKitGTK is impossible currently. The easiest way to create a windows bundle is by using MinGW, but they don't package WebKitGTK, it's a big, could cause security risks, take too much time to build and so on dependency. If you ever get WebkitGTK maintainers to officially support the MinGW package, the rest is just a matter of packaging it.
Has the situation improved any, after a year?
Same question.
Hi, @johnfactotum any update? This issue is labeled help wanted
. I would like to work on this. Is it possible to provide a roadmap?
@BlackWingedKing Are you able to open books? Because I couldn't.
Hey @Include-sys I'm not able to open the books. Sorry I should have checked it before posting
@BlackWingedKing Btw, I compiled it without sandboxing support and it works.
@Include-sys that's very cool Can you list down the steps you have followed here?
I mean command or process to remove sandboxing support?
@BlackWingedKing
In /src/main.js at line 38,
webContext.set_sandbox_enabled(true)
I changed it to false,
webContext.set_sandbox_enabled(false)
Then builded and installed, and it worked.
Thank you @Include-sys
Just an idea: Is it worth looking to get WebKitGTK working in WebAssably and run the whole app inside an electron instance?
or has anyone tried the WinCairo port?
Could someone be so kind to share a working build that will run on Windows 7?
Wish if there be a windows native version, This software is good , amazing , useful
Obviously it isn't quite as nice as having a native build, but I've been following this for a while and wanted to verify that the Linux version is working fairly well on the latest WSL2.
All I had to do is install the latest dev channel build of Windows, enable and update WSL, install Ubuntu in WSL, and install Foliate on Ubuntu.
Issues doing it this way: a little slow to load, generic Tux icon instead of app icon, Windows Explorer won't associate Foliate with EPUB files. No problem accessing the Windows file system to get to my books, though.
@darrian77 Can you publish detailed instuctions for Windows users (as a comment in this thread).
Sure.
Install Windows 10 Insider Preview build 21362 or higher. To do this you have to enroll in the Windows Insider program and select the Dev channel.
Open the Start menu and search (just start typing) for "turn Windows features on or off" (about when you get to "turn Windows" it should appear as the top result). Turn on Virtual Machine Platform and Windows Subsystem for Linux.
Reboot.
Open the Windows Store, search for and install the Linux distribution of your choice. I use and recommend Ubuntu. Additionally, I recommend the Ubuntu on Windows Community Preview, which you can only get at this link since it won't show up in a Store search.
Open the command prompt or powershell as administrator and type wsl --update
Update the WSL2 kernel by installing the package. If you're on a x64 machine use https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi and if you're using an ARM64 machine use https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_arm64.msi
Open Ubuntu (or your distro) in the start menu. This will launch Linux in the command prompt, which will then download files if needed and then guide you through the initial setup, where you can choose your username and password for Linux.
After setting up the environment, get updates, install additional packages. You can use any file manager, and I'm not sure if x11-apps are strictly required, but it made sense to install it.
sudo apt update
sudo apt upgrade
sudo apt install nautilus
sudo apt install x11-apps
Install Foliate.
sudo add-apt-repository ppa:apandada1/foliate
sudo apt update
sudo apt install foliate
Foliate should show up as a shortcut in the Start Menu in a folder named after the Linux distro you installed.
For more detailed instructions on setting up WSL2 with GUI, or WSLg, check this link https://github.com/microsoft/wslg
@johnfactotum Given that these instructions produce the much coveted Windows Build, without added costs (to the foliate developer/s), are you willing to add the instructions to a README_WINDOWS.md file and close this bug ?
@johnfactotum Given that these instructions produce the much coveted Windows Build, without added costs (to the foliate developer/s), are you willing to add the instructions to a README_WINDOWS.md file and close this bug ?
I know this wasn't addressed to me, but I would like to point out that this doesn't produce a genuine Windows build. This allows you to run the Linux build on Windows, and I think the distinction is great enough that it shouldn't be the end of the line here. I don't see why this workaround shouldn't be freely shared in the interim, but I personally would like to see further development continue on a native Windows build and would urge that this "bug" not be closed, even if it is more of a feature request than a genuine bug.
@darrian77 Thanks for the detailed instructions. But how do we add the books? I had done something similar to what you instructed before visiting the github. I don't know anything about coding so I won't understand the technical stuff. Please help me out, I just want to read a few books is all.
@GhostUnamused install a file manager. If you're on Ubuntu I suggest "apt install nautilus". Then when you go to open a book it should open the file manager and you can browse for it. If you go to the root file system then navigate to /mnt/c then you will be at the root of the Windows file system. If the books are like in your documents then you would go to like /mnt/c/Users/PROFILE NAME/My Documents. When you get to the folder where you keep your books I would recommend bookmarking it for easier access later.
When I tried to open the root file via nautilus this happens
And I the books are in a folder in my desktop and I tried to do cd mnt/c
but I don't know my way around linux
Edit: I tried to do my own research. And I found out that I can't even access %localappdata%\lxss
for my WSL. Is that a problem?
Honestly idk. Try cd /mnt/c/Users/(your profile)/Desktop. It may be because you didn't put a / before mnt? You could also try ../mnt/. If that doesn't work go into PowerShell and try WSL -l -v and confirm your distro is wsl version 2. It should be or else WSLg shouldn't even work, but it can't hurt to check.
When I tried to open the root file via nautilus this happens
Now that I've fixed my own wsl I realized what you've done. By root I meant the very beginning of the file system, not the /root/ folder. Click on FileSystem on the left side of nautilus and you should see all the folders at /, then open mnt, and then c, not root.
I got it! thanks!
I built Foliate from source, and disabled sand boxing, but whenever I try to open a book it shows this error
(WebKitWebProcess:110): Gdk-ERROR **: 18:58:17.966: The program 'WebKitWebProcess' received an X Window System error.
This probably reflects a bug in the program.
The error was 'GLXBadFBConfig'.
(Details: serial 172 error_code 163 request_code 149 (GLX) minor_code 21)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the GDK_SYNCHRONIZE environment
variable to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
I am using VcXsrv tho, not WSLg
Update:
Never mind, disabling Native opengl
and exporting LIBGL_ALWAYS_INDIRECT=0
fixed it
@ShaadiAlfred would you mind sharing your builds?
@darrian77 I'm not sure how. You mean like the binary in my /usr/bin
directory?
@darrian77 I'm not sure how. You mean like the binary in my
/usr/bin
directory?
This is the thread for Windows builds, so I thought you'd actually built a Windows executable. If that's not the case then nvm. /usr/bin sounds like you just built the Linux version.
I was doing some research on WebkitGTK for Windows, and came across this Stack Overflow thread which led to this archived website with instructions on how to compile WebkitGTK for Windows. Just thought I'd share what I've found so far, as this seems to be the main thing preventing Foliate from working natively.
Are there any plans to build a native Windows Binary for this app? It would be awesome to have it working in windows w/o WSL etc.
Making a native Windows Binary app is equivalent to re-engineering the app from scratch, for Windows only.
Such activity will require too much time and support, but Foliate already works in Windows with WSL.
Therefore, it's very unlikely that it will happen.
Making a native Windows Binary app is equivalent to re-engineering the app from scratch,
To clarity, either someone maintains WebKitGTK for Windows, or there needs to be a non-WebKitGTK version of Foliate.
Note that non-WebKitGTK doesn't necessarily mean non-GTK. Perhaps it would be possible to embed Chromium as an alternative. I have no idea how to do that, but if that can be done, then you only need to change the parts related to WebKitGTK and wouldn't need to re-build everything from scratch.
for Windows only.
To be fair, if there should ever be a non-WebKitGTK version of Foliate, it will almost certainly be cross-platform, not Windows only.
Furthermore, if there should ever be a non-GTK version of Foliate, it will almost certainly be something that can run directly in any browser, as a single plain web page (or PWA, if you like). Such a web page can either be run directly (if the platform supports it) or we can wrap it either with the native toolkits of each platform or a cross-platform toolkit.
Such a version probably wouldn't be too hard to implement. The one big hurdle is probably how to handle storing and syncing data. Once the filesystem-related Web APIs are better supported by browsers, it should be easy to write web apps that store data just like native apps (I think). Otherwise you'd probably use something like PouchDB to handle storing and syncing data. (Aside: actually, storing data in PouchDB might not be a bad idea even for the current GTK app; but I guess that's a separate issue.)
Since—apart from Calibre’s reader app—Foliate currently seems the most usable Open Source e-reader for desktops, I do think it would profit from being available for Windows (and maybe MacOS) users, too.
I don’t have a Mac and haven’t been using Windows for 10+ years, but I’m assuming Foliate could be built on a Mac using HomeBrew, and having it under WSL for Windows is the second best solution after a native Windows app.
Most users I know of (including me) nowadays often look for cross-platform solutions first, thus avoiding the need of re-learning when changing platforms. So if this could be done in the long run, it’d be just great, and certainly worth it. Also, Foliate doesn’t suffer from the resource and performance problems an app has that needs to be run on a limited hardware platform, like an actual e-reader—modern desktops and laptops should have enough power to allow for a little overhead, like Epub.js, Electron or whatever.
We surely do need a good e-reading app for use on the desktop/laptop.
Just my 2¢.
Foliate should show up as a shortcut in the Start Menu in a folder named after the Linux distro you installed.
Is this method still working? @citrus77 Cause it's not showing up on my start menu and i don't know how to open it But it seems to be installed on my distro
It does still work, but may or may not create a start menu entry depending on the build of Windows and WSL and possibly the distro that are installed. I'm not sure how to manually create a shortcut, but you can launch Foliate from the linux bash prompt and can probably create a batch file to execute it.
This is still running through WSL, and not a native build, but here it is on the Surface Pro 9 (SQ3). Still working great, and the instructions haven't changed from what I posted earlier.
Since we still don't have a native build, WSL instructions have changed as follows assuming you are on Windows 11: -When enabling Windows features, only check Virtual Machine Platform -Install the Windows Subsystem for Linux from the Microsoft Store app -No longer any need to install WSLg or update your WSL kernel; the Store will install the latest version of WSL -Simply the latest release of Ubuntu from the Store -X11-apps are no longer necessary, if they ever were
Considering the aggregate of features and UX, this seems to be the best EPUB reader out there, so native Win 10/11 builds would be very welcome. The most close alternative I could find on the platform is Freda, but it's non-free, unstable and very damn slow on older hardware.
Yes, a Windows version would be great.
Just an update on this: Myself and a contractor I've hired for this project are taking this on. We are in the opening stages of planning but my intention is to build it for React Native for Windows / MacOS. I was thinking of also developing a React Native + Electron port for Linux but considering this project exists and mine is going to have to be a bit more forked I don't want to split things up too much.
It's a shame that there aren't many fully cross platform Javascript platforms. Electron is basically it but it also adds a lot of weight.
You may want to look into tauri. There is also this tool to make a .msi package easelly https://github.com/crabnebula-dev/cargo-packager.
What alternative would you guys advise for windows ?
Great project! Please, provide Windows binaries if possible.