aboutsummaryrefslogtreecommitdiffstats
path: root/community/texlive/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/texlive/APKBUILD')
-rw-r--r--community/texlive/APKBUILD439
1 files changed, 371 insertions, 68 deletions
diff --git a/community/texlive/APKBUILD b/community/texlive/APKBUILD
index 5d65d91d24f..180119c967f 100644
--- a/community/texlive/APKBUILD
+++ b/community/texlive/APKBUILD
@@ -1,17 +1,27 @@
# Contributor: Isaac Dunham <ibid.ag@gmail.com>
# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
pkgname=texlive
-pkgver=20210325
-pkgrel=4
+pkgver=20240210.69778
+_commit=8fc7b0ba764da3d30d18662dd7ea5a97abced38b
+pkgrel=1
pkgdesc="Comprehensive TeX document production system"
url="https://tug.org/texlive/"
-# mips64, s390x and riscv64 blocked by failing luatex
-# ppc64le: fails with "texk/web2c/mplibdir/psout.w:5342:1: error: unknown type name 'mp_gr_knot'"
-arch="all !mips64 !s390x !riscv64 !ppc64le"
+# ppc64le: fatal error: mplib.h: No such file or directory
+# s390x, riscv64: luajit fails to compile
+arch="all !ppc64le !s390x !riscv64"
license="GPL-2.0-or-later AND GPL-3.0-or-later"
-options="!check" # no unit tests provided
-depends="perl texmf-dist>=2020.55416"
+depends="
+ ghostscript
+ perl
+ texmf-dist>=2024.0
+ "
+_xetex_deps="
+ icu-data-full
+ texmf-dist-xetex
+ "
makedepends="
+ autoconf
+ automake
cairo-dev
fontconfig-dev
freetype-dev
@@ -28,63 +38,151 @@ makedepends="
mpfr-dev
pixman-dev
poppler-dev
+ potrace-dev
+ zlib-dev
zziplib-dev
"
+checkdepends="
+ $_xetex_deps
+ texmf-dist-full
+ "
triggers="$pkgname.trigger=/usr/share/texmf-dist"
subpackages="
- $pkgname-static
+ $pkgname-dbg
$pkgname-dev
+ $pkgname-context:context
$pkgname-doc
- xdvik:xdvi
$pkgname-dvi:dvi
$pkgname-full:meta:noarch
- $pkgname-xetex:xetex
$pkgname-luatex:lua
+ $pkgname-xetex:xetex
+ libsynctex
+ xdvik:xdvi
+ "
+source="
+ $pkgname-$pkgver.tar.gz::https://github.com/TeX-Live/texlive-source/archive/$_commit.tar.gz
"
-source="https://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/${pkgver:0:4}/texlive-$pkgver-source.tar.xz"
+builddir="$srcdir"/texlive-source-$_commit
-builddir="$srcdir"/texlive-$pkgver-source
+# secfixes:
+# 20230506.66984-r0:
+# - CVE-2023-32700
-_luatex="dvilualatex dviluatex lualollipop lualatex"
-_pdftex="amstex cslatex csplain eplain etex jadetex latex lollipop mex
- mllatex mltex pdfetex pdfcslatex pdfcsplain pdfjadetex pdflatex
- pdfmex pdfxmltex texsis utf8mex xmltex"
-_xetex="xelatex xelollipop"
-_dvi="afm2tfm bbox dvigif dvipng dvips epsffit extractres includeres ps2eps psbook psjoin psnup psresize psselect pstops"
+_dvi="
+ afm2tfm
+ bbox
+ chkdvifont
+ dosepsbin
+ dvi2fax
+ dviasm
+ dvibook
+ dviconcat
+ dvicopy
+ dvidvi
+ dvigif
+ dvihp
+ dviinfox
+ dvilj
+ dvilj2p
+ dvilj4
+ dvilj4l
+ dvilj6
+ dvilualatex
+ dvilualatex-dev
+ dviluatex
+ dvipdfm
+ dvipdfmx
+ dvipdft
+ dvipng
+ dvipos
+ dvips
+ dvired
+ dviselect
+ dvispc
+ dvitodvi
+ dvitomp
+ dvitype
+ epsffit
+ epspdf
+ epspdftk
+ epstopdf
+ extractres
+ gftodvi
+ includeres
+ odvicopy
+ odvitype
+ pdvitomp
+ pdvitype
+ ps2eps
+ ps2frag
+ ps2pk
+ ps4pdf
+ psbook
+ psjoin
+ pslatex
+ psnup
+ psresize
+ psselect
+ pst2pdf
+ pstops
+ purifyeps
+ repstopdf
+ updvitomp
+ updvitype
+ xdvipdfmx
+ "
-build() {
- mkdir -p $builddir/build && cd $builddir/build
+prepare() {
+ default_prepare
+ # bibtex-x needs kpathsea flags
+ sed -i '/AC_SEARCH_LIBS/a KPSE_KPATHSEA_FLAGS' texk/bibtex-x/configure.ac
+ (cd texk/bibtex-x && autoreconf)
+
+ # t4ht expects to be run as /usr/share/texmf/bin/t4ht
+ # (see https://bugs.archlinux.org/task/27251)
+ sed -i s/SELFAUTOPARENT/TEXMFROOT/ texk/tex4htk/t4ht.c
+}
+
+build() {
# builders keep failing when -jN == nproc
export MAKEFLAGS="$MAKEFLAGS -j$((JOBS<16 ? JOBS : 16))"
+ # makes -dbg much smaller
+ export CFLAGS="$CFLAGS -g1"
+ export CXXFLAGS="$CXXFLAGS -g1"
+
+ mkdir -p build
+ cd build
+
../configure -C \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
+ --datarootdir=/usr/share \
+ --datadir=/usr/share \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
- --localstatedir=/var \
+ --enable-aleph \
--enable-biber \
+ --enable-dvipng \
+ --enable-dvipsk \
--enable-epsfwin \
--enable-ipc \
--enable-luatex \
--enable-mftalkwin \
+ --enable-ps2eps \
+ --enable-psutils \
--enable-regiswin \
--enable-shared \
--enable-tektronixwin \
+ --enable-tex4htk \
--enable-unitermwin \
--enable-xetex \
- --enable-dvipng \
- --enable-dvipsk \
- --enable-ps2eps \
- --enable-psutils \
- --disable-bibtex-x \
- --disable-chktex \
- --disable-cjkutils \
- --disable-detex \
+ --disable-bibtexu \
--disable-dialog \
+ --disable-dump-share \
--disable-dvi2tty \
--disable-dvisvgm \
--disable-largefile \
@@ -93,71 +191,245 @@ build() {
--disable-native-texlive-build \
--disable-pdfopen \
--disable-ps2pkm \
+ --disable-static \
--disable-t1utils \
- --disable-tex4htk \
--disable-ttf2pk2 \
- --disable-vlna \
--disable-xindy \
+ --disable-xindy-docs \
+ --disable-xindy-rules \
--disable-xpdfopen \
- --with-ps=gs \
+ --disable-xz \
--with-banner-add="/Alpine Linux" \
+ --with-clisp-runtime=default \
+ --with-freetype2-include=/usr/include/freetype2 \
+ --with-freetype2-libdir=/usr/lib \
+ --with-ps=gs \
--with-system-cairo \
--with-system-freetype2 \
--with-system-gd \
--with-system-gmp \
+ --with-system-graphite \
--with-system-graphite2 \
--with-system-harfbuzz \
--with-system-icu \
--with-system-libpaper \
--with-system-libpng \
--with-system-mpfr \
+ --with-system-ncurses \
--with-system-pixman \
+ --with-system-pnglib \
--with-system-poppler \
+ --with-system-potrace \
+ --with-system-t1lib \
--with-system-zlib \
--with-system-zziplib \
- --with-x-dvi-toolkit=motif \
+ --with-x-dvi-toolkit=xaw \
--without-texinfo
+
make
}
-package() {
- cd $builddir/build
+_install() {
+ local destdir="$1"
+ (
+ cd build
- make DESTDIR="$pkgdir" install
+ make DESTDIR="$destdir" install
- local texcmd; for texcmd in $_pdftex; do
- ln -s pdftex "$pkgdir"/usr/bin/$texcmd
- done
- ln -s eptex "$pkgdir"/usr/bin/platex
- ln -s euptex "$pkgdir"/usr/bin/uplatex
+ # A lot of cmds are provided as symlinks and are intended to be
+ # created post installation by the texlinks script. With a little
+ # hack we can run this in-place
+ export PATH="$destdir/usr/bin:$PATH"
+ export LD_LIBRARY_PATH="$destdir/usr/lib:$LD_LIBRARY_PATH"
+ texlinks -f /usr/share/texmf-dist/web2c/fmtutil.cnf "$destdir"/usr/bin
+
+ # Provide ConTeXt executables by hand
+ cat > "$destdir/usr/bin/mtxrun" << EOF
+#!/bin/sh
+env TEXMF=/usr/share/texmf-dist /usr/share/texmf-dist/scripts/context/lua/mtxrun.lua "\$@"
+EOF
+ chmod +x "$destdir/usr/bin/mtxrun"
+ cat > "$destdir/usr/bin/context" << EOF
+#!/bin/sh
+env TEXMF=/usr/share/texmf-dist /usr/share/texmf-dist/scripts/context/lua/mtxrun.lua -script context "\$@"
+EOF
+ chmod +x "$destdir/usr/bin/context"
- # As Alpine has packaged all TeXlive packages, there is no need for a
- # separate package manager. apk should be used to get and update texmf-dist
- rm "$pkgdir"/usr/bin/tlmgr
+ # As Alpine has packaged all TeXlive packages, there is no need for a
+ # separate package manager. apk should be used to get and update texmf-dist
+ rm "$destdir"/usr/bin/tlmgr
- # texmf-dist is not platform dependent, those are packaged in the
- # texmf-dist package
- rm -rf "$pkgdir"/usr/share/texmf-dist
+ # texmf-dist is not platform dependent, those are packaged in the
+ # texmf-dist package
+ rm -rf "$destdir"/usr/share/texmf-dist
+ )
}
-xetex() {
- # Split off XeTeX because it depends on graphite/harfbuzz/icu
- pkgdesc="TeX typesetting engine supporting modern typography and bidirectional text"
- depends="$pkgname"
+_prepare_check_env() {
+ local checkenv
+ checkenv="$1"
- install -d -m 0755 "$subpkgdir"/usr/bin
- mv "$pkgdir"/usr/bin/xetex "$subpkgdir"/usr/bin/
+ _install "$checkenv"
+ mkdir -p "$checkenv"/usr/share/texmf-dist
+ # provide tlpkg
+ ln -s /usr/share/tlpkg "$checkenv"/usr/share/tlpkg
+ # Populate texmf-dist with symlinks to the installed data. This allows
+ # creating the ls-R databse inside the checkenv
+ find /usr/share/texmf-dist -maxdepth 1 -mindepth 1 \
+ -exec ln -s {} "$checkenv"{} \;
- local texcmd; for texcmd in $_xetex; do
- ln -s xetex "$subpkgdir"/usr/bin/$texcmd
- done
+ # In case the host system does have an ls-R, remove it out of the checkenv
+ rm -f "$checkenv"/usr/share/texmf-dist/ls-R
+
+ (
+ export PATH="$checkenv/usr/bin:$PATH"
+ export LD_LIBRARY_PATH="$checkenv/usr/lib:$LD_LIBRARY_PATH"
+ export TEXMFROOT="$checkenv/usr/share"
+ mktexlsr
+ yes | updmap-sys --syncwithtrees
+ updmap-sys
+ fmtutil-sys --all || true
+ )
}
-meta() {
- pkgdesc="A complete TeX distribution"
- depends="$pkgname $pkgname-doc $pkgname-luatex $pkgname-xetex xdvik $pkgname-dvi texmf-dist-full"
+check() {
+ local checkenv
+ checkenv="$srcdir"/check-env
- mkdir -p "$subpkgdir"
+ # speed up re-running "abuild check" by only preparing the check env
+ # on the first run
+ if [ ! -d "$checkenv" ]; then
+ _prepare_check_env "$checkenv"
+ fi
+
+ (
+ export PATH="$checkenv/usr/bin:$PATH"
+ export LD_LIBRARY_PATH="$checkenv/usr/lib:$LD_LIBRARY_PATH"
+ export TEXMFROOT="$checkenv/usr/share"
+
+ mkdir -p "$srcdir/check-results"
+ cd "$srcdir/check-results"
+
+ msg "Running ltxcheck.tex"
+ yes | pdflatex -halt-on-error /usr/share/texmf-dist/tex/latex/base/ltxcheck.tex
+
+ for cmd in pdflatex lualatex xelatex htlatex; do
+ msg "Compiling sample docs with $cmd"
+ local cmdflags
+ case "$cmd" in
+ htlatex)
+ # htlatex does not support command line flags
+ cmdflags=""
+ ;;
+ *)
+ # we cannot have the test get stuck waiting on user interaction
+ cmdflags="-halt-on-error -interaction=nonstopmode"
+ ;;
+ esac
+ for doc in sample2e small2e; do
+ # intentionally splitting words in cmdflags
+ # shellcheck disable=SC2086
+ "$cmd" $cmdflags \
+ /usr/share/texmf-dist/tex/latex/base/$doc.tex
+ done
+ done
+
+ msg "Compiling sample docs with plain old latex"
+ for doc in sample2e small2e; do
+ latex \
+ -halt-on-error \
+ -interaction=nonstopmode \
+ /usr/share/texmf-dist/tex/latex/base/$doc.tex
+ # common workflow is to convert the result to PS or PDF, so let's
+ # try both
+ dvips $doc.dvi
+ dvipdfm $doc.dvi
+ done
+
+ msg "Compiling IEEE examples"
+ # shellcheck disable=SC3045 # Not caring about dash compatibility here
+ find /usr/share/texmf-dist/doc/latex/ieeetran/ \
+ -name '*.tex' -type f -print0 \
+ | while IFS= read -r -d '' doc; do
+ echo "--> $doc"
+ case "$doc" in
+ */testflow.tex)
+ # This file would ask for the paper and whether to use
+ # duplex, if not manually defined.
+ echo '\def\papertype{a4paper}\def\makeduplexpage{yes}' > testflow.tex
+ cat "$doc" >> testflow.tex
+ pdflatex \
+ -halt-on-error \
+ -interaction=nonstopmode \
+ testflow.tex
+ ;;
+ *)
+ pdflatex \
+ -halt-on-error \
+ -interaction=nonstopmode \
+ "$doc"
+ ;;
+ esac
+ done
+
+ msg "Compiling TikZ examples"
+ for doc in \
+ /usr/share/texmf-dist/doc/latex/aobs-tikz/example.tex \
+ /usr/share/texmf-dist/doc/latex/causets/causet_tikz_example1.tex \
+ /usr/share/texmf-dist/doc/latex/dot2texi/examples/d2ttikzexamples.tex \
+ /usr/share/texmf-dist/doc/latex/tikz-bayesnet/example.tex \
+ /usr/share/texmf-dist/doc/latex/tikz-kalender/tikz-kalender-example1.tex \
+ /usr/share/texmf-dist/doc/latex/tikz-kalender/tikz-kalender-example2.tex \
+ /usr/share/texmf-dist/doc/latex/tikz-palattice/example1_linear.tex \
+ /usr/share/texmf-dist/doc/latex/tikz-palattice/example2_circular.tex \
+ /usr/share/texmf-dist/doc/latex/tikz-palattice/example3_coordinates.tex \
+ /usr/share/texmf-dist/doc/latex/tikz-palattice/example4_labels.tex \
+ /usr/share/texmf-dist/doc/latex/tikz-palattice/example5_legend.tex \
+ /usr/share/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/minimal_working_example.tex \
+ /usr/share/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_berg.tex \
+ /usr/share/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_chamstadt.tex \
+ /usr/share/texmf-dist/doc/latex/tikzposter/tikzposter-example.tex \
+ /usr/share/texmf-dist/doc/latex/webquiz/examples/tikz-ex.tex \
+ ; do
+ echo "--> $doc"
+ (
+ cd "$(dirname "$doc")" || exit
+ exec lualatex \
+ -halt-on-error \
+ -interaction=nonstopmode \
+ -output-directory "$srcdir/check-results" \
+ "$(basename "$doc")"
+ )
+ done
+
+ msg "Compiling LNI example"
+ for cmd in pdflatex lualatex; do
+ $cmd \
+ -halt-on-error \
+ -interaction=nonstopmode \
+ /usr/share/texmf-dist/doc/latex/lni/lni-paper-example-de.tex
+ done
+ )
+}
+
+package() {
+ _install "$pkgdir"
+}
+
+libsynctex() {
+ pkgdesc="Library for synchronization between TeX files and resulting file"
+ depends="" # don't depend on perl/texmf-dist
+ amove usr/lib/libsynctex.so.*
+}
+
+xetex() {
+ # Split off XeTeX because it depends on graphite/harfbuzz/icu
+ pkgdesc="TeX typesetting engine supporting modern typography and bidirectional text"
+ depends="$pkgname $_xetex_deps"
+
+ install -d -m 0755 "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/*xetex* "$subpkgdir"/usr/bin/
+ mv "$pkgdir"/usr/bin/*xelatex* "$subpkgdir"/usr/bin/
}
dvi() {
@@ -165,8 +437,8 @@ dvi() {
depends="$pkgname"
install -d -m 0755 "$subpkgdir"/usr/bin
- for tool in $_dvi; do
- mv "$pkgdir/usr/bin/$tool" "$subpkgdir/usr/bin/"
+ for tool in $_dvi; do
+ amove "usr/bin/$tool"
done
}
@@ -180,11 +452,6 @@ lua() {
mv "$pkgdir"/usr/bin/*lua* "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/lib/lib*lua*.so.* "$subpkgdir"/usr/lib/
-
- local texcmd; for texcmd in $_luatex
- do ln -s luatex "$subpkgdir"/usr/bin/$texcmd
- done
- cd -
}
xdvi() {
@@ -201,6 +468,42 @@ xdvi() {
mv "$pkgdir"/usr/bin/xdvi "$pkgdir"/usr/bin/xdvi-* usr/bin/
}
+context() {
+ pkgdesc="ConTeXt is a general-purpose document processor derived from TeX"
+ depends="$pkgname $pkgname-luatex texmf-dist-context"
+ triggers="$pkgname-context.trigger=/usr/share/texmf-dist"
+
+ amove usr/bin/mtxrun
+ amove usr/bin/context
+
+ # installing ConTeXt stubs. This is a bit delicate, as this is expected
+ # to be done post-installation with a working ConTeXt setup.
+ (
+ export PATH="$pkgdir/usr/bin:$PATH"
+ export LD_LIBRARY_PATH="$pkgdir/usr/lib:$LD_LIBRARY_PATH"
+
+ /usr/share/texmf-dist/scripts/context/lua/mtxrun.lua \
+ --stubpath="$subpkgdir"/usr/bin \
+ --unix \
+ --makestubs
+ )
+}
+
+meta() {
+ pkgdesc="A complete TeX distribution"
+ depends="
+ $pkgname
+ $pkgname-context
+ $pkgname-dvi
+ $pkgname-luatex
+ $pkgname-xetex
+ xdvik
+ texmf-dist-full
+ "
+
+ mkdir -p "$subpkgdir"
+}
+
sha512sums="
-afd6eb24efaeac7c58d43ff24162aece919079a9ae02934509f068c7a3828223c33c14d9db11ff7fea3560b08a06f352446ba7f845eefb4a56a87b96f088f213 texlive-20210325-source.tar.xz
+519546a939f981c35d457f39fb57133e417fb6f87cc51ec4a55f0872fe332e62fd6d37e7436f06500e83d04a7b0653a57c7177510be4e2d2b9fcf0fe48d5d633 texlive-20240210.69778.tar.gz
"