summaryrefslogtreecommitdiffstats
path: root/pkgs/tools/typesetting
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2019-03-03 21:36:10 -0500
committerDmitry Kalinkin <dmitry.kalinkin@gmail.com>2019-03-03 22:07:19 -0500
commit8f35ef724a8e7f7e7ef2b4d4120182acf2ef7119 (patch)
treec10bf6b5db48397b062aa2ab931dcefbaf2f8a16 /pkgs/tools/typesetting
parent30364211e699ec91a70f1135dd6ad0a9b89a7940 (diff)
texlive/combine.nix: fix bugs in languages filter
Initial language.{dat,def} configuration files provided by `texlive.hyphen-base` may declare languages that were not part of the combined packages. Those are filtered out by a sed script that had few problems: 1) The sed script was generated from a list of potentially non-unique packages. Every repetition of a select and print clause would produce a copy of a language declaration in the output file. This became a problem for update to the 2018-final, the fmtutil would crash from too much German hyphenation. 2) The select clauses were ambiguous: both '^% from hyphen' and '^% from hyphen-welsh' will match a line 'from hyphen-welsh'.
Diffstat (limited to 'pkgs/tools/typesetting')
-rw-r--r--pkgs/tools/typesetting/tex/texlive/combine.nix13
1 files changed, 9 insertions, 4 deletions
diff --git a/pkgs/tools/typesetting/tex/texlive/combine.nix b/pkgs/tools/typesetting/tex/texlive/combine.nix
index 834828248e2e..7a06689c5e66 100644
--- a/pkgs/tools/typesetting/tex/texlive/combine.nix
+++ b/pkgs/tools/typesetting/tex/texlive/combine.nix
@@ -132,10 +132,15 @@ in buildEnv {
# updmap.cfg seems like not needing changes
# now filter hyphenation patterns, in a hacky way ATM
- (let script =
- writeText "hyphens.sed" (
- lib.concatMapStrings (pkg: "/^\% from ${pkg.pname}/,/^\%/p;\n") pkgList.splitBin.wrong
- + "1,/^\% from/p;" );
+ (let
+ pnames = uniqueStrings (map (p: p.pname) pkgList.splitBin.wrong);
+ script =
+ writeText "hyphens.sed" (
+ # pick up the header
+ "1,/^\% from/p;"
+ # pick up all sections matching packages that we combine
+ + lib.concatMapStrings (pname: "/^\% from ${pname}:$/,/^\%/p;\n") pnames
+ );
in ''
(
cd ./share/texmf/tex/generic/config/