From d9e764d0bf9ffff5ca83cc5c1ce3b970dc5705e2 Mon Sep 17 00:00:00 2001 From: Christian Cornelssen Date: Fri, 16 Jun 2023 03:14:27 +0200 Subject: [PATCH] texlive-fmtutil.*: Adapt to installation/removal of texlive-lang*. texlive-fmtutil.hook: Add hyphenation file patterns to the watch list. texlive-fmtutil.script: Regenerate language.def and language.dat FIXME: Although the language.def and language.dat in /etc/... have a comment that says not to edit by hand and use tlmgr instead, this could previously be ignored because pacman would leave those files untouched. Now the hook scripts overwrite them. A better solution would be to mimic what tlmgr would do to those files. Presumably tlmgr allows local tweaks somehow. --- PKGBUILD | 6 +++--- texlive-fmtutil.hook | 3 ++- texlive-fmtutil.script | 35 +++++++++++++++++++++++++++-------- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 7a22115..1482e74 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -10,7 +10,7 @@ for _coll in ${_collections[@]}; do done _rev=66594 pkgver=2023.$_rev -pkgrel=9 +pkgrel=10 pkgdesc='TeX Live - ' license=(GPL) arch=(any) @@ -37,8 +37,8 @@ sha256sums=('SKIP' '05afeae62a5d4c9de79c838c9636e2aefe9ad1d6b787fed4e5930c13baf60eba' '2141c0842668fb937fd21ca2fae39b642c9665656e404a0d4ee7bdc477bf51fe' 'ee6e76192a5ad880a2152cd7900b86c8465239fb228045a2f8360b0d7a449f4a' - 'b641550fe7727422b6964d505db7dbc35b3680a9d47b8d97ac550828bdb9bac7' - 'f96e9f815fa0a4b85e677f2a9215d9106b8abe46eceb3f3e36a6c76eda3e4a85') + 'fdc1815e46c8ea4edaa7cd1f077b3c9782963ebd56ee6018de4d33403c7ed635' + '941433a6a49659c63c878b33fb7844bd30f6c188f0dfda44ef2e7f946908e1a6') options=(!strip) # Nothing to strip, save packaging time prepare() { diff --git a/texlive-fmtutil.hook b/texlive-fmtutil.hook index 46936e8..a27e012 100644 --- a/texlive-fmtutil.hook +++ b/texlive-fmtutil.hook @@ -10,9 +10,10 @@ Operation = Install Operation = Upgrade Operation = Remove Target = var/lib/texmf/arch/installedpkgs/*.fmts +Target = usr/share/texmf-dist/tex/generic/hyph-utf8/patterns/tex/*.tex [Action] -Description = Updating TeXLive format files... +Description = Updating TeXLive language defs and format files... When = PostTransaction Exec = /usr/share/libalpm/scripts/texlive-fmtutil diff --git a/texlive-fmtutil.script b/texlive-fmtutil.script index 0e3b943..243473c 100644 --- a/texlive-fmtutil.script +++ b/texlive-fmtutil.script @@ -1,18 +1,37 @@ #!/bin/bash +LANGUAGE_DAT="etc/texmf/tex/generic/config/language.dat" +LANGUAGE_DEF="etc/texmf/tex/generic/config/language.def" + +LANGUAGE_DAT_DIST="usr/share/texmf-dist/tex/generic/config/language.dat" +LANGUAGE_DEF_DIST="usr/share/texmf-dist/tex/generic/config/language.def" + FMTUTIL="etc/texmf/web2c/fmtutil.cnf" FMTUTILLOCAL="etc/texmf/web2c/fmtutil-local.cnf" -cp usr/share/texmf-dist/web2c/fmtutil-hdr.cnf $FMTUTIL -for file in var/lib/texmf/arch/installedpkgs/*.fmts; do - echo >> $FMTUTIL - echo "# $file" >> $FMTUTIL - cat $file >> $FMTUTIL +FMTUTIL_HDR="usr/share/texmf-dist/web2c/fmtutil-hdr.cnf" +FMTUTIL_PKGS="var/lib/texmf/arch/installedpkgs" + +# Use the full distribution's language set, +# except those with uninstalled hyphenation files. +perl -pe 's{^\w\S*\s+(\S+)|^=} + {($1 ? ($c = !`kpsewhich $1` && "%") : $c).$&}e' \ +"$LANGUAGE_DAT_DIST" > "$LANGUAGE_DAT" +perl -pe 's{^\\addlanguage\{[^{}]+\}\{([^{}]+)\}} + {(!`kpsewhich $1` && "%").$&}e' \ +"$LANGUAGE_DEF_DIST" > "$LANGUAGE_DEF" + +# Assemble fmtutil.cnf from packaged and local parts +cp "$FMTUTIL_HDR" "$FMTUTIL" +for file in "$FMTUTIL_PKGS"/*.fmts; do + echo >> "$FMTUTIL" + echo "# $file" >> "$FMTUTIL" + cat "$file" >> "$FMTUTIL" done if [[ -f "$FMTUTILLOCAL" ]]; then - echo >> $FMTUTIL - echo "# $FMTUTILLOCAL" >> $FMTUTIL - cat "$FMTUTILLOCAL" >> $FMTUTIL + echo >> "$FMTUTIL" + echo "# $FMTUTILLOCAL" >> "$FMTUTIL" + cat "$FMTUTILLOCAL" >> "$FMTUTIL" fi /usr/bin/fmtutil-sys --all --cnffile $FMTUTIL > /dev/null -- 2.41.0