Build MikTeX

Building MikTeX is not straightforward and requires patience in particular due to difficulty to translate error messages. Some of them below:

Failed to find required Qt component "Qml"
Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
Could NOT find CAIRO (missing: CAIRO_LIBRARY CAIRO_INCLUDE_DIR)
--   Package 'fribidi', required by 'virtual:world', not found
Could NOT find GD (missing: GD_LIBRARY GD_INCLUDE_DIR)

Under antiX version 26, based on Debian Trixie, it is necessary to install a bunch of programs and headers in order to fix the errors above:

apt-get install cmake xsltproc bison flex qt6-base-dev 
qt6-tools-dev qt6-declarative-dev qt6-scxml-dev qt6-5compat-dev 
libapr1-dev libaprutil1-dev libboost-locale-dev libbz2-dev libcairo2-dev 
libfribidi-dev libgd-dev libgmp-dev libgraphite2-dev libharfbuzz-dev 
libhunspell-dev liblog4cxx-dev libmpfi-dev libmspack-dev libssl-dev 
libpopt-dev liburiparser-dev libzzip-dev libcurl4-gnutls-dev

Now, the installation can begin:

wget https://miktex.org/download/ctan/systems/win32/miktex/source/miktex-25.4.tar.xz
tar xf miktex-25.4.tar.xz
mkdir miktex-build
cd miktex-build/
cmake ../miktex.25.4/
make # Build takes 72 min on Lenovo X200

Finally, as root:

make install

Now, MikTeX is installed, but it still needs some post-install steps. I follow page https://miktex.org/howto/build-unx, as root:

mpm --admin --update-db
initexmf --admin --set-config-value [MPM]AutoInstall=1
initexmf --admin --update-fndb
initexmf --admin --mklinks
mpm --admin --verbose --package-level=basic --upgrade
initexmf --admin --mkmaps
initexmf --admin --update-fndb
rm -fr ~/.miktex

Test as normal user:

pdflatex sample2e