TexLive installation from sources

Dec 20, 2016

How to install TexLive from scratch, starting from sources, on macOS Sierra

I decided to install texlive from scratch, starting from the sources, on Sierra. As a prerequisite, you need to have installed Xcode and its command line utils, otherwise you couldn’t compile anything :-)

To begin with, you need to get the sources and distribution files. Let’s create a working directory and fetch the files

1 mkdir  ~/scratch
2 cd ~/scratch
3 rsync -av --progress --delete --exclude=.svn --exclude=Master/bin tug.org::tldevsrc texlive

Notice we aren’t pulling the precompiled binaries in Master/bin directory as we will compile them from scratch.

It will take a while to rsync to the local directory ~/scratch/texlive. Once done, enter the folder, create an “out of source” build directory, configure and build as follow:

1 cd ~/scratch/texlive/Build/source
2 mkdir temp && cd temp
3 eval full_path=$(echo "~/scratch/texlive/Dist")
4 ../configure --prefix=$full_path --exec-prefix=$full_path --enable-mktextex-default
5 make world
6 make install

The command make world run also the tests. In my case the pdftexdir/ttf2afm.test failed, but it wasn’t a problem for me, so I proceeded with make install as usual. Once the binaries are copied, you should find them in the Dist/bin directory. On Sierra the binaries are in:


Now it’s time to setup a soft link to our freshly built binaries so the installer (in Master space) can find them.

1 cd ~/scratch/texlive/Master/bin
2 ln -s ~/scratch/texlive/Dist/bin/x86_64-apple-darwin16.3.0 x86_64-darwin

Time to run the installer with the following:

1 cd ~/scratch/texlive/Master
2 sudo ./install-tl

You will be greeted with a textual menu. Do your choices and install your customized texlive. Don’t forget to add the binaries to your path, like this:

export PATH=$PATH:/usr/local/texlive/2016/bin/x86_64-darwin