Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 1.8 KB

README.md

File metadata and controls

35 lines (23 loc) · 1.8 KB

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