johnfactotum / foliate

Read e-books in style
https://johnfactotum.github.io/foliate/
GNU General Public License v3.0
6.42k stars 295 forks source link

Windows build #115

Open jhspetersson opened 5 years ago

jhspetersson commented 5 years ago

Great project! Please, provide Windows binaries if possible.

johnfactotum commented 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.

itprojects commented 5 years ago

@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.

johnfactotum commented 5 years ago

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.

itprojects commented 5 years ago

If only we had an AppImage for Bionic...

itprojects commented 5 years ago

@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?

probonopd commented 5 years ago

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.

itprojects commented 5 years ago

Trusty is not a supported version anymore. Xenial's support is not enough to meet basic requirements.

probonopd commented 5 years ago

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"?

bilelmoussaoui commented 5 years ago

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.

opusforlife2 commented 4 years ago

Has the situation improved any, after a year?

make-42 commented 4 years ago

Same question.

BlackWingedKing commented 4 years ago

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 commented 4 years ago

I was able to run on windows using wsl2 following this and building from the source. This also helped me solve some issues faced. update: Unable to open the books.

image

Include-sys commented 4 years ago

@BlackWingedKing Are you able to open books? Because I couldn't.

BlackWingedKing commented 4 years ago

Hey @Include-sys I'm not able to open the books. Sorry I should have checked it before posting

Include-sys commented 4 years ago

@BlackWingedKing Btw, I compiled it without sandboxing support and it works.

image

BlackWingedKing commented 4 years ago

@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?

Include-sys commented 4 years ago

@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.

BlackWingedKing commented 4 years ago

Thank you @Include-sys

hegerdes commented 3 years ago

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?

sergeevabc commented 3 years ago

Could someone be so kind to share a working build that will run on Windows 7?

ghost commented 3 years ago

Wish if there be a windows native version, This software is good , amazing , useful

citrus77 commented 3 years ago

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.

Foliate

itprojects commented 3 years ago

@darrian77 Can you publish detailed instuctions for Windows users (as a comment in this thread).

citrus77 commented 3 years ago

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. windowsfeatures

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.

https://www.microsoft.com/en-us/p/ubuntu-on-windows-community-preview/9p9q5zh1hrr0?rtc=1&activetab=pivot:overviewtab

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

itprojects commented 3 years ago

@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 ?

citrus77 commented 3 years ago

@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.

GhostUnamused commented 3 years ago

@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.

citrus77 commented 3 years ago

@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.

GhostUnamused commented 3 years ago

When I tried to open the root file via nautilus this happens

image

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?

citrus77 commented 3 years ago

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.

citrus77 commented 3 years ago

When I tried to open the root file via nautilus this happens

image

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.

GhostUnamused commented 3 years ago

I got it! thanks!

shadyalfred commented 3 years ago

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

citrus77 commented 3 years ago

@ShaadiAlfred would you mind sharing your builds?

shadyalfred commented 3 years ago

@darrian77 I'm not sure how. You mean like the binary in my /usr/bin directory?

citrus77 commented 3 years ago

@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.

Darthagnon commented 2 years ago

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.

RuthlessRuler commented 2 years ago

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.

itprojects commented 2 years ago

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.

johnfactotum commented 2 years ago

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.)

Moonbase59 commented 2 years ago

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¢.

Br41ni4c commented 2 years ago

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

citrus77 commented 2 years ago

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.

citrus77 commented 2 years ago

Screenshot 2022-10-28 015452 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.

citrus77 commented 1 year ago

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

ironwheal commented 1 year ago

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.

tigerinus commented 10 months ago

Yes, a Windows version would be great.

teamcoltra commented 8 months ago

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.

wiiznokes commented 7 months ago

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 ?