openzim / libzim

Reference implementation of the ZIM specification
https://download.openzim.org/release/libzim/
GNU General Public License v2.0
166 stars 49 forks source link

Looking for direction on building for Windows #846

Closed j0hnm4r5 closed 10 months ago

j0hnm4r5 commented 10 months ago

I'm trying to use node-libzim on Windows, which requires this library to be installed. Does anyone have a short writeup for the steps involved? Looking through other issues, it seems people have successfully gotten it running, but I'm getting very stuck.

I'm using Python 3.9 via a venv. I have meson, ninja, and pkgconfiglite installed (the first via pip and the latter two via choco).

Running meson . build starts off okay, but then throws an error that meson.build:51:17: ERROR: Dependency "xapian-core" not found, tried pkgconfig and cmake.

Installing xapian-core on Windows seems to be an absolute nightmare (I tried building it from source, but it's also getting stuck pretty early in the process), plus it says in the README that xapian isn't required to build? How can I skip that dependency?

And I haven't even gotten to LZMA, LCU, or Zstd.

Really any insight would be extremely helpful. Thanks in advance.

kelson42 commented 10 months ago

@j0hnm4r5 libzim is knowingly complicated to compile on MS Windows. Xapian compilation been the worse part. This is something we have difficulties ourself. What do you want to compile exactly? A static or dynamic library? @mgautierfr is currently working on this very same challenge within kiwix/kiwix-build, see https://github.com/kiwix/kiwix-build/issues/466. @mgautierfr Can you please share an update?

j0hnm4r5 commented 10 months ago

Dynamic I think? Sorry, I'm more of a Nodejs and web guy and this is a little out of my depth. I really want to contribute though; I just need a little direction on what would be the best route to go down.

At the end of the day, I'm trying to build a cross-platform electron app with electron-builder, utilizing @openzim/node-libzim.

node-libzim automatically installs libzim binaries on macOS and Linux, but doesn't with Windows. The best possible outcome of this would be the inclusion of prebuilt binaries in node-libzim, but I'll personally settle for being able to compile them myself locally and with GitHub Actions or some other CI.

kelson42 commented 10 months ago

@j0hnm4r5 Thank you for the clarification and thank you for proposing your help on openzim/node-libzim. Regarding this topic, I will give more hints in https://github.com/openzim/node-libzim/issues/113.

What is sure is that to achieve that you need https://github.com/kiwix/kiwix-build/issues/466 to be implemented and we work on this right now. Actually such a release for Windows might be available as soon as next week. The reason why we need it is exactly the reason why you are here: libzim nodejs/python bindings.

Considering that your ticket is mostly a duplicate of https://github.com/kiwix/kiwix-build/issues/466 I will close it.