Skip to content

Source and utilities for compiling libzim binaries to WASM and ASM with JavaScript wrapper

License

Notifications You must be signed in to change notification settings

openzim/javascript-libzim

Repository files navigation

Prototype of libzim in WebAssembly (WASM)

This Repository provides the source code and utilities for compiling the ZIM File reader lbizim from C++ to WebAssembly (and ASM.js).

A prototype in HTML/JS, for testing the WASM version, is provided at https://openzim.github.io/javascript-libzim/tests/prototyep/. This prototype uses WORKERFS as the Emscripten File System and runs in a Web Worker. The file object is mounted before run, and the name is passed as argument.

There is also an HTML/JS utility for testing the ability of Emscripten File Systems to read large files (muliti-gigabyte) at https://openzim.github.io/javascript-libzim/tests/test_large_file_access/.

Steps to recompile manually

sudo apt install ninja-build meson pkg-config python3 autopoint libtool autoconf
sudo apt install zlib1g-dev libicu-dev libxapian-dev liblzma-dev
  • activate emscripten environment variables with something like source ./emsdk_env.sh
  • run make

Steps to recompile with Docker

While being at the root of this repository:

docker build -t "docker-emscripten-libzim:v3" ./docker
  • Run the build with:
docker run --rm -v $(pwd):/src -v /tmp/emscripten_cache/:/home/emscripten/.emscripten_cache -u $(id -u):$(id -g) -it docker-emscripten-libzim:v3 make

About

Source and utilities for compiling libzim binaries to WASM and ASM with JavaScript wrapper

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • JavaScript 88.4%
  • HTML 3.0%
  • Makefile 3.0%
  • C++ 2.2%
  • PowerShell 2.2%
  • Shell 0.7%
  • Dockerfile 0.5%