From fc04385d8c5fd6edabf2ec21afe171dbb61887ab Mon Sep 17 00:00:00 2001 From: Vincenzo Mantova <1962985+xworld21@users.noreply.github.com> Date: Mon, 28 Aug 2023 18:27:21 +0100 Subject: texlive.bin.core-big: split output according to texlive.tlpdb --- pkgs/tools/typesetting/tex/texlive/bin.nix | 46 +++++++--------------- .../tex/texlive/build-texlive-package.nix | 4 +- .../typesetting/tex/texlive/tlpdb-overrides.nix | 17 ++------ 3 files changed, 21 insertions(+), 46 deletions(-) (limited to 'pkgs/tools/typesetting/tex/texlive') diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index dce462072f9a..a30066bf6136 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -33,7 +33,9 @@ let "ps2eps" "ps2pk" "psutils" "ptex" "seetexk" "synctex" "t1utils" "tex" "tex4ht" "texlive-scripts-extra" "texware" "tie" "tpic2pdftex" "ttfutils" "uptex" "velthuis" "vlna" "web" "xml2pmx" ]; - binPackages = lib.getAttrs corePackages tlpdb; + coreBigPackages = [ "metafont" "mflua" "metapost" "luatex" "luahbtex" + "xetex" ] ++ lib.optional withLuaJIT "luajittex"; + binPackages = lib.getAttrs (corePackages ++ coreBigPackages) tlpdb; common = { src = fetchurl { @@ -215,12 +217,15 @@ core = stdenv.mkDerivation rec { }; -inherit (core-big) metafont mflua metapost luatex luahbtex luajittex xetex; +inherit (core-big) metafont mflua metapost luatex luahbtex xetex; +luajittex = core.big.luajittex or null; core-big = stdenv.mkDerivation { #TODO: upmendex pname = "texlive-core-big.bin"; inherit version; - inherit (common) src prePatch; + __structuredAttrs = true; + + inherit (common) binToOutput src prePatch; patches = [ # improves reproducibility of fmt files. This patch has been proposed upstream, @@ -293,34 +298,13 @@ core-big = stdenv.mkDerivation { #TODO: upmendex doCheck = false; # fails - # now distribute stuff into outputs, roughly as upstream TL - # (uninteresting stuff remains in $out, typically duplicates from `core`) - outputs = [ - "out" - "metafont" - "mflua" - "metapost" - "luatex" - "luahbtex" - "luajittex" - "xetex" - ]; - postInstall = '' - for output in $(getAllOutputNames); do - mkdir -p "''${!output}/bin" - done - - mv "$out/bin"/{inimf,mf,mf-nowin} "$metafont/bin/" - mv "$out/bin"/mflua{,-nowin} "$mflua/bin/" - mv "$out/bin"/{*tomp,mfplain,*mpost} "$metapost/bin/" - mv "$out/bin"/{luatex,texlua,texluac} "$luatex/bin/" - mv "$out/bin"/luahbtex "$luahbtex/bin/" - mv "$out/bin"/xetex "$xetex/bin/" - cp libs/teckit/teckit_compile "$xetex/bin/" - '' + lib.optionalString withLuaJIT '' - mv "$out/bin"/mfluajit{,-nowin} "$mflua/bin/" - mv "$out/bin"/{luajittex,luajithbtex,texluajit,texluajitc} "$luajittex/bin/" - '' ; + outputs = [ "out" ] + ++ (builtins.map (builtins.replaceStrings [ "-" ] [ "_" ]) coreBigPackages) + # some outputs of metapost, omegaware are for ptex/uptex + ++ [ "ptex" "uptex" ] + # unavoidable duplicates from core + ++ [ "ctie" "cweb" "omegaware" "texlive_scripts_extra" "tie" "web" ]; + postInstall = common.moveBins; }; diff --git a/pkgs/tools/typesetting/tex/texlive/build-texlive-package.nix b/pkgs/tools/typesetting/tex/texlive/build-texlive-package.nix index b83075a141e4..c1e98d710b95 100644 --- a/pkgs/tools/typesetting/tex/texlive/build-texlive-package.nix +++ b/pkgs/tools/typesetting/tex/texlive/build-texlive-package.nix @@ -120,7 +120,9 @@ let inherit meta; # shebang interpreters and compiled binaries buildInputs = let outName = builtins.replaceStrings [ "-" ] [ "_" ] pname; in - [ texliveBinaries.${pname} or texliveBinaries.core.${outName} or null ] + [ texliveBinaries.core.${outName} or null + texliveBinaries.${pname} or null + texliveBinaries.core-big.${outName} or null ] ++ (args.extraBuildInputs or [ ]) ++ [ bash perl ] ++ (lib.attrVals (args.scriptExts or [ ]) extToInput); nativeBuildInputs = extraNativeBuildInputs; diff --git a/pkgs/tools/typesetting/tex/texlive/tlpdb-overrides.nix b/pkgs/tools/typesetting/tex/texlive/tlpdb-overrides.nix index a9439193dca1..7930e6f903e2 100644 --- a/pkgs/tools/typesetting/tex/texlive/tlpdb-overrides.nix +++ b/pkgs/tools/typesetting/tex/texlive/tlpdb-overrides.nix @@ -13,7 +13,9 @@ let # so we remove them from binfiles, and add back the ones texlinks purposefully ignore (e.g. mptopdf) removeFormatLinks = lib.mapAttrs (_: attrs: if (attrs ? formats && attrs ? binfiles) - then let formatLinks = lib.catAttrs "name" (lib.filter (f: f.name != f.engine) attrs.formats); + # TLPDB reports erroneously that various metafont binaries like "mf" are format links to engines + # like "mf-nowin"; core-big provides both binaries and links so we simply skip them here + then let formatLinks = lib.catAttrs "name" (lib.filter (f: f.name != f.engine && ! lib.hasSuffix "-nowin" f.engine) attrs.formats); binNotFormats = lib.subtractLists formatLinks attrs.binfiles; in if binNotFormats != [] then attrs // { binfiles = binNotFormats; } else removeAttrs attrs [ "binfiles" ] else attrs); @@ -122,12 +124,6 @@ in lib.recursiveUpdate orig rec { epstopdf.binlinks.repstopdf = "epstopdf"; pdfcrop.binlinks.rpdfcrop = "pdfcrop"; - ptex.binlinks = { - pdvitomp = bin.metapost + "/bin/pdvitomp"; - pmpost = bin.metapost + "/bin/pmpost"; - r-pmpost = bin.metapost + "/bin/r-pmpost"; - }; - texdef.binlinks = { latexdef = "texdef"; }; @@ -143,13 +139,6 @@ in lib.recursiveUpdate orig rec { kpsexpand = "kpsetool"; }; - # metapost binaries are in bin.metapost instead of bin.core - uptex.binlinks = { - r-upmpost = bin.metapost + "/bin/r-upmpost"; - updvitomp = bin.metapost + "/bin/updvitomp"; - upmpost = bin.metapost + "/bin/upmpost"; - }; - #### add PATH dependencies without wrappers # TODO deduplicate this code a2ping.postFixup = '' -- cgit 1.4.1