[main]Notes on TeXmacs

Build TeXmacs using CMake and MXE on WSL for Windows

There are three major steps to build TeXmacs on WSL:

Step 1. Install Ubuntu 20.04 on Windows 10

Ubuntu is available in the Windows Store. Just click to install it. You may first need to install WSL as described here. When running Ubuntu for the first time, you will be prompted to provide a username and a password for the installed Ubuntu on Windows. The following steps should be executed inside the newly-installed Ubuntu.

Step 2. Install MXE

Download the source code of MXE to $HOME/github/mxe/mxe

mkdir -p $HOME/github/mxe/
cd $HOME/github/mxe/
git clone https://github.com/mxe/mxe.git

In case of network issues with git clone, one can initialize an empty git repo with git init, add the remote and use git fetch. See also here for further suggestions.

Install dependencies for MXE

sudo apt update

sudo apt install autoconf automake autopoint bash \
 bison bzip2 flex g++ g++-multilib gettext git gperf \
 intltool libgdk-pixbuf2.0-dev libltdl-dev libssl-dev \
 libtool-bin libxml-parser-perl lzip make openssl \
 p7zip-full patch perl python ruby sed unzip wget xz-utils \
 python3-mako libc6-dev-i386-cross

Build qtbase and guile using MXE

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
make MXE_PLUGIN_DIRS=plugins/gcc8 qtbase qtsvg guile dlfcn-win32 # use -jN (-j8/-j12) to speed up

Note: we make use of MXE_PLUGIN_DIRS=plugins/gcc8 because of current build failures with gcc11. This may no longer be necessary in the future.

Step 3: Build GNU TeXmacs

export PATH=$PATH:$HOME/github/mxe/mxe/usr/bin

# Download the source code
mkdir -p $HOME/github/texmacs/
cd $HOME/github/texmacs/
git clone https://github.com/texmacs/texmacs.git

# Build
mkdir build && cd build/
i686-w64-mingw32.static-cmake .. \
  -DCMAKE_INSTALL_PREFIX=$HOME/win \
  -DQT_CMAKE_DIR=$HOME/github/mxe/mxe/usr/i686-w64-mingw32.static/qt5/lib/cmake/
make -j4 && make install -j4

# Move the built result to the Documents folder
cp -r $HOME/github/mxe/mxe/usr/i686-w64-mingw32.static/share/guile/1.8/ice-9/ $HOME/win/progs/
mv $HOME/win /mnt/c/Users/xxxx/Documents/texmacs_build_‘date +%Y%m%d%H‘

# please replace xxxx with your Windows user name

To launch the built TeXmacs, just click the bin/texmacs.exe.

NOTICE: This is a build guide but not a package guide, the binary dependencies (wget.exe/gs.exe/...) of a TeXmacs Windows installation are not automatically prepared in the bin/ for GNU TeXmacs v2.1.