We're trying to build XeTeX on Ubuntu 20.04 LTS.
First install necessary tools:
sudo apt install autoconf build-essential libtool pkg-config
Make sure that you have autoconf version 2.69 or lower, version 2.70+ has a breaking change which would lead to a build failure, see this ticket for detailed analysis (Ubuntu 22.04 LTS has autoconf 2.70+ version by default thus it failed to build XeTeX by default).
Then install necessary libraries:
sudo apt install libfontconfig1-dev
Again, we found some bug in the latest version of XeTeX, see this ticket for more analysis.
To make the build succeed, we need to checkout a specific commit, here we reset the repo to a last working commit 8af2b5:
- `git reset --hard 8af2b58c82bdfcd2791a31b506c602d6b9abdf1c
Then try to build by:
./build.sh
If everything goes well, you should be able to get a binary
build/texk/web2c/xetex
.
First we need to choose a version of fontconfig. As declared above, we use xetex version 0.999991 as the base here, and it is released on Jan 2, 2019. Thus it is better for us to choose a fontconfig version which is release around Jan, 2019. Here we choose fontconfig 2.13.1 which is released on Aug 30, 2018.
Fontconfig depends on expat, so we need to build expat to wasm first. Again, we also choose a expat version of 2.2.6 according to here, which is released on Aug 15, 2018.
Building expat to wasm is a low hanging fruit, just use emconfigure ./configure
and emmake make
.
To build fontconfig, we need to install some tools:
sudo apt install gperf gettext autopoint
The overall build process for wasm fontconfig consists of two parts:
- Build native
- Build wasm
The purpose of build native first is to produce a native tool
src/fc-case/fc-case
as the build process relies on this tool to continue and
succeed.
After build native, we would clean up the native mess, apply some patches for emscripten's build, and then build again.
You can refer to build-fontconfig.sh for more details.