Skip to content

Commit 0ee5c47

Browse files
tannevaledjhheider
andauthored
new(tug.org/texlive): TeX Live engines built from source (#13055)
Co-authored-by: Jacob Heider <jacob@pkgx.dev>
1 parent c1767dd commit 0ee5c47

1 file changed

Lines changed: 156 additions & 0 deletions

File tree

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# TeX Live — comprehensive TeX/LaTeX distribution.
2+
#
3+
# Built from source via the `texlive-YYYYMMDD-source.tar.xz` release
4+
# bundle, which contains the *engines* (pdftex, xetex, luatex, dvips,
5+
# bibtex, makeindex, tlmgr, etc.). The macro packages (LaTeX, AMS,
6+
# beautifully-formatted whatever) are NOT bundled here — install them
7+
# via `tlmgr install <pkg>` after the bottle is set up.
8+
#
9+
# From-source over vendored — this builds the engines fresh against
10+
# pantry's freetype/cairo/poppler/harfbuzz instead of pulling the
11+
# precompiled binaries from the TeXLive installer.
12+
#
13+
# Build is heavy (~15-30 min on a fast runner) — texlive-source
14+
# bundles ~600MB of C/C++ source for ~50 engines + tools.
15+
16+
distributable:
17+
# TeXLive releases annually; tarball filename is YYYYMMDD but the
18+
# archive directory is just YYYY (e.g. 2026/). pkgx templating
19+
# exposes {{ version.major }} which for an 8-digit version returns
20+
# the whole `20260301` rather than the year — no year-only field
21+
# exists. Hardcode the year and bump on next annual release.
22+
- url: https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2027/texlive-{{ version.raw }}-source.tar.xz
23+
strip-components: 1
24+
- url: https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2026/texlive-{{ version.raw }}-source.tar.xz
25+
strip-components: 1
26+
- url: https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2025/texlive-{{ version.raw }}-source.tar.xz
27+
strip-components: 1
28+
- url: https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2024/texlive-{{ version.raw }}-source.tar.xz
29+
strip-components: 1
30+
31+
versions:
32+
- url: https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2027/
33+
match: /texlive-\d{8}-source\.tar\.xz/
34+
strip:
35+
- /texlive-/
36+
- /-source\.tar\.xz/
37+
- url: https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2026/
38+
match: /texlive-\d{8}-source\.tar\.xz/
39+
strip:
40+
- /texlive-/
41+
- /-source\.tar\.xz/
42+
- url: https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2025/
43+
match: /texlive-\d{8}-source\.tar\.xz/
44+
strip:
45+
- /texlive-/
46+
- /-source\.tar\.xz/
47+
- url: https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2024/
48+
match: /texlive-\d{8}-source\.tar\.xz/
49+
strip:
50+
- /texlive-/
51+
- /-source\.tar\.xz/
52+
53+
dependencies:
54+
# Engine runtime dependencies.
55+
freetype.org: "*"
56+
libpng.org: "*"
57+
cairographics.org: "*"
58+
pixman.org: "*"
59+
poppler.freedesktop.org: "*"
60+
harfbuzz.org: "*"
61+
gnu.org/gmp: "*"
62+
gnu.org/mpfr: "*"
63+
freedesktop.org/fontconfig: "*"
64+
zlib.net: "*"
65+
perl.org: "*" # required at runtime (tlmgr is Perl)
66+
67+
build:
68+
dependencies:
69+
gnu.org/m4: "*"
70+
perl.org: "*" # build scripts need Perl
71+
linux:
72+
gnu.org/gcc: "*"
73+
74+
# TeXLive source ships a `build` script at the root (file, not dir),
75+
# so `working-directory: build` (which mkdirs build/) collides. Use
76+
# a different name for the out-of-source build dir.
77+
working-directory: pkgx-build
78+
script:
79+
# TeXLive's configure has many sub-projects (each engine has its
80+
# own). The top-level configure passes through to subdirs.
81+
# --with-system-* makes texlive use pantry's libs instead of its
82+
# vendored copies.
83+
- ../configure $ARGS
84+
- make --jobs {{ hw.concurrency }}
85+
- make install
86+
87+
# Strip +brewing from baked-in paths post-install — TeXLive's
88+
# web2c/texmf.cnf and tlmgr scripts hardcode the configure-time
89+
# prefix. Same pattern as R / Octave.
90+
- run:
91+
# Engines-only build: texmf-dist / texmf-var aren't installed.
92+
# Walk every dir that actually exists. Use `|| true` so an
93+
# empty grep result doesn't abort the script under set -e.
94+
- for d in bin share/texmf-dist share/texmf-var lib; do
95+
- test -d "$d" || continue
96+
- grep -rIl '+brewing' "$d" 2>/dev/null | xargs -r sed -i 's|+brewing||g' || true
97+
- done
98+
working-directory: "{{prefix}}"
99+
100+
env:
101+
ARGS:
102+
- --prefix={{ prefix }}
103+
- --datarootdir={{ prefix }}/share
104+
- --disable-native-texlive-build # use a tlpkg-free layout
105+
- --enable-shared
106+
- --disable-static
107+
# Use pantry's system libs instead of TeXLive's vendored copies.
108+
- --with-system-zlib
109+
- --with-system-libpng
110+
- --with-system-freetype2
111+
- --with-system-cairo
112+
- --with-system-pixman
113+
- --with-system-harfbuzz
114+
- --with-system-poppler
115+
- --with-system-gmp
116+
- --with-system-mpfr
117+
- --with-system-fontconfig
118+
# Skip components that need extra deps (can add back if needed).
119+
- --disable-xindy # needs CLISP
120+
- --disable-dvisvgm # needs xxhash + freetype-aware build
121+
- --without-x # xdvik needs Xaw widgets not in pantry
122+
- --disable-xdvik # belt+braces — same Xaw dependency
123+
124+
test:
125+
# Quick smoke tests on the major engines.
126+
script:
127+
- out=$(tex --version 2>&1 | head -1)
128+
- 'echo "tex: $out"'
129+
130+
- case "$out" in
131+
- '*"TeX"*) echo "tex PASS" ;;'
132+
- '*) echo "FAIL: $out"; exit 1 ;;'
133+
- esac
134+
135+
- pdftex --version 2>&1 | head -1
136+
- xetex --version 2>&1 | head -1
137+
- luatex --version 2>&1 | head -1
138+
139+
provides:
140+
# Major engines (from texk/ subtree). Not exhaustive — texlive
141+
# installs ~80 binaries; listing the ones users actually invoke.
142+
- bin/tex
143+
- bin/pdftex
144+
- bin/xetex
145+
- bin/luatex
146+
- bin/luahbtex
147+
- bin/dvips
148+
- bin/dvipdfmx
149+
- bin/bibtex
150+
- bin/makeindex
151+
- bin/mktexlsr
152+
- bin/tlmgr # TeX Live Manager (Perl)
153+
- bin/kpsewhich
154+
# `biber` (Perl tool with extra modules) + `dvipdfm` (legacy, replaced
155+
# by dvipdfmx) + `kpathsea` (library, not a binary) intentionally
156+
# omitted — install biber via `tlmgr install biber` if needed.

0 commit comments

Comments
 (0)