TeX Live and pdflatex from source

Ken Moffat zarniwhoop at ntlworld.com
Tue Oct 24 18:22:15 CEST 2023


On Tue, Oct 24, 2023 at 07:11:30AM +0000, Nick D wrote:
> Hi TeX Live team,
> 
> I have been using LaTeX with TeX Live for a few years now and have been very appreciative of the work the community has contributed.
> 
> I am currently tasked with a new dilemma. I want to use TeX Live and pdflatex at my work to typeset some documents as part of some internal pipelines. The only catch is, nothing can be precompiled binaries and everything must be built from source code as part of my requirements. I originally saw someone else ask a similar question on the tlbuild mailing list here: https://tug.org/pipermail/tlbuild/2018q1/004133.html and it was suggested to follow up on the tex-live mailing list.
> 
> Essentially what I want to do is build TeX Live from source and then build the various packages I need (fonts, styles, ect.) to build LaTeX. My aim is to have a working version of pdflatex. So far I have been able to accomplish the following.
> 
>   1.  Cloned the TeX Live sources from the github repo here: https://github.com/TeX-Live/texlive-source to "texlive"
>   2.  Created a directory in that folder called "texlive/artifacts"
>   3.  Ran the configuration script with a prefix "texlive/configure --prefix=texlive/artifacts"
>   4.  Ran the make file "make -j8"
>   5.  Then installed the libs and binaries in the prefix directory with "make install"
> 
> >From this point I see some of the binaries created in "texlive/artifacts/bin/x86_64-pc-linux-gnu" like "latexmk", "pdftex", and "tlmgr" just to name a few. [I should point out that when I try to run some of these binaries like "tlmgr", I do get the error message of "Can't locate TeXLive/TLConfig.pm in @INC (you may need to install the TeXLive::TLConfig module)"]
> 
> >From this I am trying to understand what the next steps would be. My goal is to get a working version of "pdflatex" built which I think requires getting the pdflatex format files to use with "pdftex". Does this involve getting "tlmgr" to work so I can download the packages from CTAN?
> 
> If anyone could provide some guidance or assistance on how to move forward, I would appreciate it very much. Once again thank you for all your work.
> 
> Best,
> Nick

If you use tlmgr to update packages, it will pull in precompiled
binaries when the package has an updated binary.  That is not what
you want.

The texlive build system has a lot of technical debt, very few
people understand it enough to minimally build (only) a subset of it
and almost every distro appears to end up taking the binaries.  I
believe that fedora build from source, but they split it into so many
parts that I gave up trying to follow the details.  Not sure which
other distros still build comletely from source and have 2023
packages - if you find any, look for *how* they build (i.e. the
recipes).

TLConfig.pm, along with TLUtils.pm, are essential and mentioned in
the blfs books I point to below.

It all depends what you wish to do - on linuxfromscratch we (that's
mostly 'I') rebuild texlive for the new release, and only update
that for critical vulnerabilities (this year, lualatex) - and then
only minimally so the build is the original release plus a few small
patches.

If you are only using legacy pdflatex ('legacy' in the sense that it
does not natively deal with UTF-8 and system fonts) then a full
build is probably more than an order of magnitude greater than what
you need.

We also separate certain programs (asy, biber, dvisvgm, xindy) and
for context we have a very minimal mkiv but will be dropping context
whenever we next have to rebuild the main texlive.  We build in
/opt/texlive/YYYY with programs matching where the binaries will go
and we still have instructions for installing the binary
(install-tl-unx) as an alternative.

If our approach might have any hints for you, the books are at:

 https://www.linuxfromscratch.org/blfs/view/stable/ sysv init,
 our current release

 https://www.linuxfromscratch.org/blfs/view/svn/ sysv init,
 development book

 https://www.linuxfromscratch.org/blfs/view/stable-systemd/ systemd,
 our current release

 https://www.linuxfromscratch.org/blfs/view/systemd/ sysemd,
 development book

(all in chapter 51, errata and security advisories can be found from
https://www.linuxfromscratch.org/blfs/read.html )

Please be aware that we do not mention dependencies which are in
linuxfromscratch itself (e.g. python-3.11 in the release), the
development book *will* change from day to day, and that to follow
our layout of dependencies you need to work all the way back -
'required' means what it says, 'recommended' might allow you to avoid
the dependency if you change the options for a configure|meson|cmake
invocation, or 'recommended' could be because someone in the past
thought the dependency added important functionality.

We assume texlive is built for a desktop system using Xorg.

Sorry if that is almost totally tangential to what you want to do.

ĸen
-- 
  'The universe is so big, sir, that it obeys all possible laws,'
  said Ponder, 'For a given value of "teapot".
           -- The Science of Discworld II, 'The Globe'


More information about the tex-live mailing list.