summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-01-08 19:54:46 +0900
committerNorbert Preining <norbert@preining.info>2024-01-08 19:54:46 +0900
commit965f1f8c16a595c7ed6997a521798621d2dcf779 (patch)
tree72e69072a3a543807e6dea44ff2fcbf7e54b0572
parent8874dd436a6a1383dfca702d823abc3b32c38f52 (diff)
WIP auto-rebuild context formatsdev/context-auto-build
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl23
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm7
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm4
3 files changed, 34 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 86c821ce9ce..cf505d9b020 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -1002,6 +1002,29 @@ sub handle_execute_actions {
}
}
+ if ($::regenerate_all_formats || $::regenerate_context_formats) {
+ # lmtx/context setup. The story here is that in 2023, the lmtx binary
+ # for x86_64-linux was too new to run on the system where we build TL.
+ # (luametatex: /lib64/libm.so.6: version `GLIBC_2.23' not found)
+ # So we have to try running it to see it succeeds, not just test for
+ # the program's existence. And since it exits nonzero given no args,
+ # we have to specify --version. Hope it keeps working like that ...
+ my $lmtx = "$plat_bindir/luametatex$progext";
+ if (exists($install{"context"}) && $install{"context"} == 1
+ && !exists $ENV{"TEXLIVE_INSTALL_NO_CONTEXT_CACHE"}
+ && TeXLive::TLUtils::system_ok("$lmtx --version")
+ ) {
+ info("setting up ConTeXt cache: ");
+ $errcount += run_postinst_cmd("mtxrun --generate");
+ $errcount += run_postinst_cmd("context --luatex --generate");
+ if (TeXLive::TLUtils::system_ok("luajittex --version")) {
+ $errcount += run_postinst_cmd("context --luajitex --generate");
+ }
+ } else {
+ debug("skipped ConTeXt cache setup\n");
+ }
+ }
+
# now go back to the hyphenation patterns and regenerate formats
# based on the various language files
# this of course will in some cases duplicate fmtutil calls,
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index 06da78f3b57..88a093b8d55 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -1911,6 +1911,13 @@ sub not_virtual_install_package {
$totlpdb->save;
# compute the return value
TeXLive::TLUtils::announce_execute_actions("enable", $tlpobj);
+ # If we did install context, also announce the rebuild of context formats.
+ # This cannot be done via the AddFormat directives, since the calls are
+ # not in the expected format.
+ if ($tlpobj->name eq "context") {
+ TeXLive::TLUtils::announce_execute_actions("context-formats");
+ }
+
# do the postinstallation actions
#
# Run the post installation code in the postaction tlpsrc entries
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 4997be204d8..ad92873214a 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -2239,6 +2239,10 @@ sub announce_execute_actions {
$::regenerate_all_formats = 1;
return;
}
+ if (defined($type) && ($type eq "context-formats")) {
+ $::regenerate_context_formats = 1;
+ return;
+ }
if (defined($type) && ($type eq "files-changed")) {
$::files_changed = 1;
return;