Skip to content

busytex/busytex

Repository files navigation

Programs from TexLive 2023 compiled with Emscripten into a single fully static binary (x86_64-linux / WASM)

Currently compiles into a fully static binary (via musl on Alpine Linux):

  • xetex
  • pdftex
  • luahbtex
  • bibtex8
  • xdvipdfmx
  • kpsewhich, kpsestat, kpseaccess, kpsereadlink
  • makeindex

Supported architecture targets:

  • x86_64-linux
  • WASM32

Future work:

  • mf-nowin
  • LuaMetaTex / LMTX (lua)
  • tlmgr (perl, web requests)
  • Biber (perl)
  • mktexlsr, fmtutil, updmap (perl)

Usage

# wasm version, download latest compiled assets, launch the web server example.py and then go to http://localhost:8080/example/example.html
mkdir -p dist
wget -P dist --backups=1 $(printf "https://github.com/busytex/busytex/releases/latest/download/%s " busytex_pipeline.js busytex_worker.js    busytex.wasm busytex.js texlive-basic.js texlive-basic.data    ubuntu-texlive-latex-extra.data ubuntu-texlive-latex-extra.js    ubuntu-texlive-latex-recommended.data ubuntu-texlive-latex-recommended.js    ubuntu-texlive-science.data ubuntu-texlive-science.js)
python3 example/example.py

# native version
sh example/example.sh
wget http://mirrors.ctan.org/systems/texlive/Images/texlive2023-20230313.iso
split -b2G -d texlive2023-20230313.iso texlive2023-20230313.iso.

Help needed

Building from source

# install dependencies: wget, cmake, gperf, p7zip-full, emscripten
apt-get install wget cmake gperf p7zip-full 
git clone https://github.com/emscripten-core/emsdk
cd emsdk
./emsdk update-tags
./emsdk install tot
./emsdk activate tot
source emsdk_env.sh

# clone busytex
git clone https://github.com/busytex/busytex
cd busytex

# set make parallelism
export MAKEFLAGS=-j8

# download and patch texlive into ./source
make texlive

# build native tools and fonts file into ./build/native
make native

# smoke test native binaries
make test

# build wasm tools into ./build/wasm
make wasm

# build TeX Directory Structure (TDS)
make tds-basic

# test native binaries
sh example/example.sh

# reproduce and pack Ubuntu TexLive packages into wasm data files
make build/wasm/texlive-basic.js

# copies binaries and TexLive TDS into ./dist
make dist-native dist-wasm

# remove ./build and ./source completely
make clean

References