about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincenzo Mantova <1962985+xworld21@users.noreply.github.com>2023-05-13 21:32:09 +0100
committerVincenzo Mantova <1962985+xworld21@users.noreply.github.com>2023-05-14 14:51:04 +0100
commit1623309ee2df85e952f79ea7ed7c75137b48f48b (patch)
tree9853ae46329531f7a0b1ed4c328f6b87a847e054
parent17d4034e89f418108837af481e043586a0e44568 (diff)
texlive: execute postaction scripts
-rw-r--r--pkgs/tools/typesetting/tex/texlive/combine.nix11
-rw-r--r--pkgs/tools/typesetting/tex/texlive/default.nix2
-rw-r--r--pkgs/tools/typesetting/tex/texlive/tl2nix.sed3
-rw-r--r--pkgs/tools/typesetting/tex/texlive/tlpdb.nix5
4 files changed, 21 insertions, 0 deletions
diff --git a/pkgs/tools/typesetting/tex/texlive/combine.nix b/pkgs/tools/typesetting/tex/texlive/combine.nix
index 540ac10cfc528..76f4f9ba841b6 100644
--- a/pkgs/tools/typesetting/tex/texlive/combine.nix
+++ b/pkgs/tools/typesetting/tex/texlive/combine.nix
@@ -248,6 +248,17 @@ in (buildEnv {
     done
     }
   '' +
+  # texlive postactions (see TeXLive::TLUtils::_do_postaction_script)
+  (lib.concatMapStrings (pkg: ''
+    postaction='${pkg.postactionScript}'
+    case "$postaction" in
+      *.pl) postInterp=perl ;;
+      *.texlua) postInterp=texlua ;;
+      *) postInterp= ;;
+    esac
+    echo "postaction install script for ${pkg.pname}: ''${postInterp:+$postInterp }$postaction install $TEXMFROOT"
+    $postInterp "$TEXMFROOT/$postaction" install "$TEXMFROOT"
+  '') (lib.filter (pkg: pkg ? postactionScript) pkgList.tlpkg)) +
   # texlive post-install actions
   ''
     ln -sf "$TEXMFDIST"/scripts/texlive/updmap.pl "$out"/bin/updmap
diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix
index ec0c79ab1ab5d..972462c1d5dbe 100644
--- a/pkgs/tools/typesetting/tex/texlive/default.nix
+++ b/pkgs/tools/typesetting/tex/texlive/default.nix
@@ -178,6 +178,8 @@ let
           } // lib.optionalAttrs (tlType == "run") {
             hasFormats = args.hasFormats or false;
             hasHyphens = args.hasHyphens or false;
+          } // lib.optionalAttrs (tlType == "tlpkg" && args ? postactionScript) {
+            postactionScript = args.postactionScript;
           };
         } // lib.optionalAttrs (fixedHash != null) {
           outputHash = fixedHash;
diff --git a/pkgs/tools/typesetting/tex/texlive/tl2nix.sed b/pkgs/tools/typesetting/tex/texlive/tl2nix.sed
index c4317a7aea939..94b10ba6f7765 100644
--- a/pkgs/tools/typesetting/tex/texlive/tl2nix.sed
+++ b/pkgs/tools/typesetting/tex/texlive/tl2nix.sed
@@ -66,6 +66,9 @@ $a}
     s/^.*\n//          # remove saved lines, resume processing
   }
 
+  # extract postaction scripts (right now, at most one per package, so a string suffices)
+  s/^postaction script file=(.*)$/  postactionScript = "\1";/p
+
   # extract hyphenation patterns and formats
   # (this may create duplicate lines, use uniq to remove them)
   /^execute\sAddHyphen/i\  hasHyphens = true;
diff --git a/pkgs/tools/typesetting/tex/texlive/tlpdb.nix b/pkgs/tools/typesetting/tex/texlive/tlpdb.nix
index fc11112cf6822..2d932c76d1b20 100644
--- a/pkgs/tools/typesetting/tex/texlive/tlpdb.nix
+++ b/pkgs/tools/typesetting/tex/texlive/tlpdb.nix
@@ -13966,6 +13966,7 @@
   deps = [
     "glyphlist"
   ];
+  postactionScript = "tlpkg/tlpostcode/dvipdfmx.pl";
   sha512.run = "6dd78f4b5cabb51c3bd9988fa46bf90a5a79b3d3293257a4c563a8a76a5a03eb167ce3ec0d4ce6ed05412a551eb201f2379a50a97ac5355ebe833f7b34cee4b4";
   sha512.doc = "00dce9b36eefd1788bbe455b2e5104efd9afc8bd891aeafb2cd9bdee406eeb25ab520e42e614e9d2363eb6a7273232bc3c4805bacd82a22099c5ffc438e852cb";
   hasRunfiles = true;
@@ -18806,6 +18807,7 @@
 };
 "haranoaji" = {
   revision = 66119;
+  postactionScript = "tlpkg/tlpostcode/haranoaji-tlpost.pl";
   sha512.run = "96100a78ab4292a4dc656fb70e2973f75ece3964f3a0d85d9f9153b7052ea90c14f074b195d31e46465dc52ea0516541a16981239abf552861dbca16fac3ab1d";
   sha512.doc = "bb4161c95b760c9c103f086c134d7f7528dafd92f82623dd95322ea644b86c35e2baef05170c3c67a7f1c4905dc8a5fd40108db1c65074b558eec69f0e3c6910";
   hasRunfiles = true;
@@ -31282,6 +31284,7 @@
 };
 "ptex-fontmaps" = {
   revision = 59711;
+  postactionScript = "tlpkg/tlpostcode/ptex-fontmaps-tlpost.pl";
   sha512.run = "16afa97812d830b2b98f657f67ef690da420afe63ccf6f002131101f3ce9a03ff6e5170db1b316e9db521e4cdf89c7aedf26c57be162bf1c5b48fa4226e5e029";
   sha512.doc = "affd6dde30276fa680a0d99d0a51650ee95260535dff717801d61ccb8165c5526047e46ad6478367a439e9a84721500128062b8cb6a1f33a25a65fadae4547f1";
   sha512.source = "eb450119b3897f9e8374d29a3a9512819a05263d5829c81d56dc00dd35995133d1a3cfcadc59ce2aea52ac8b5bc195d27446f159356e63b433e235d1098e93b5";
@@ -31304,6 +31307,7 @@
 };
 "ptex2pdf" = {
   revision = 64072;
+  postactionScript = "tlpkg/tlpostcode/ptex2pdf-tlpost.pl";
   sha512.run = "1893a49eb389914d7a9247dece7f67d9d6af05efca77801130726d6422b1a0150b56f29d3f133f433d70989f6ffcc2b44d209cd044c84ee0833c2f77b87f3e46";
   sha512.doc = "f193b44004b487d93f025b34b72a17cbaf4111b1a6e1ceb4ac1b69c6c07aa4dce46cde510cbd01fb71fb08c06f7bbb415a4a8051de5861f1f586b756060f386f";
   hasRunfiles = true;
@@ -39929,6 +39933,7 @@
     "xetexconfig"
   ];
   hasFormats = true;
+  postactionScript = "tlpkg/tlpostcode/xetex.pl";
   sha512.run = "e9f0aebda0a7fb36e2cbce4dd49e965335438c4ebf2d41eb8e19eabe29617239dd67e7e3433a8c75fd40f072a2c6753a7d0762afd34fca4130929e51888aaabf";
   sha512.doc = "31f03ee1ae00bc7883109ab7b7374feedc384d86b491873e90797658eae12299dd60b95edc1c86f1faa61a0b7a952cca23993e991863b37e49c27afd6c21c034";
   hasRunfiles = true;