Manual Compilation
This guide is only tried and tested on GNU/ Linux, but should (hopefully) work on the other platforms. It is adjusted to some of the heuristics that context standalone uses. Words in brackets (i.e. {word}) have to be substituted by your username or similar unique identifier.
Note that this is NOT a system wide install, but if you are reading this guide you probably know how to generalize this.
Preparations
- Create install directory (recommended name:
tex):mkdir /home/{user}/tex - Create the directory that houses the binaries:
mkdir -p /home/{user}/tex/texmf-linux-64/bin - Add
/home/{user}/tex/texmf-linux-x64/binto yourPATH. This depends on the specific shell you are using, for bash use the.bashrc. Make sure the open a new shell (or logout and login again) for the change to take effect.
Fetch the files
- Clone the context archive from github into the
texmf-contextfolder i.e.git clone git@github.com:contextgarden/context.git /home/{user}/tex/texmf-context - Clone the font files into the
fontsfolder from githubgit clone git@github.com:contextgarden/context-distribution-fonts.git /home/{user}/tex/texmf/ - In order for the configuration to work:
cp /home/{user}/tex/texmf-context/web2c/contextcnf.lua /home/{user}/tex/texmf-context/web2c/texmfcnf.lua. Check out/home/{user}/tex/texmf-context/web2c/readme.txtto see why this is neccesary.
Compile
Execute build.sh --native in texmf-context/source/luametatex. The luametatex binary will appear in the build/native/ folder. You may need to chmod +x ./build.sh to make the build script executable.
Install the Binary
- Copy the
luametatexbinary to/home/{user}/tex/texmf-linux-64/bin - Symlink
contextandmtxrunto this binary:ln -s /home/{user}/tex/texmf-linux-64/bin/luametatex /home/{user}/tex/texmf-linux-64/bin/mtxrunandln -s /home/{user}/tex/texmf-linux-64/bin/luametatex /home/{user}/tex/texmf-linux-64/bin/context.
- Copy the
context.luaandmtxrun.luafiles from/home/{user}/tex/texmf-context/scripts/context/lua/into the/home/{user}/tex/texmf-linux-x64/bindirectory. Make sure they are executable (i.e.chmod +x /home/{user}/tex/texmf-linux-x64/bin/mtxrun.lua)
Finish the install
Run mtxrun --generate. After that try to compile a test document to make sure it works.
Updates
For newer ConTeXt versions go through the above steps. Take care to empty the build directory before compiling anything to remove/ empty the old build directory:rm /home/{user}/tex/texmf-context/source/luametatex/build -R. Otherwise you might get weird bugs when running context.