texlive.tlpdb.nix: add hyphenation patterns and font maps to tlpdb

This commit is contained in:
Vincenzo Mantova
2024-03-27 21:10:23 +00:00
parent 30392650ee
commit ea6ca290e2
4 changed files with 1830 additions and 66 deletions
@@ -318,7 +318,7 @@ let
'' +
# now filter hyphenation patterns and formats
(let
hyphens = lib.filter (p: p.hasHyphens or false && p.tlOutputName or p.outputName == "tex") pkgList.nonbin;
hyphens = lib.filter (p: p ? hyphenPatterns && p.tlOutputName or p.outputName == "tex") pkgList.nonbin;
hyphenPNames = map (p: p.pname) hyphens;
formats = lib.filter (p: p ? formats && p.tlOutputName or p.outputName == "tex") pkgList.nonbin;
formatPNames = map (p: p.pname) formats;
@@ -82,8 +82,9 @@ let
outputSpecified = true;
inherit tex;
} // lib.optionalAttrs (args ? deps) { tlDeps = args.deps; }
// lib.optionalAttrs (args ? fontMaps) { inherit (args) fontMaps; }
// lib.optionalAttrs (args ? formats) { inherit (args) formats; }
// lib.optionalAttrs hasHyphens { inherit hasHyphens; }
// lib.optionalAttrs (args ? hyphenPatterns) { inherit (args) hyphenPatterns; }
// lib.optionalAttrs (args ? postactionScript) { inherit (args) postactionScript; }
// lib.optionalAttrs hasDocfiles { texdoc = texdoc; }
// lib.optionalAttrs hasSource { texsource = texsource; }
+46 -3
View File
@@ -80,6 +80,22 @@ $a}
D # restart cycle from the current line
}
# extract font maps
/^execute add.*Map /{
# open a list
i\ fontMaps = [
# loop through following map lines
:next-map
s/^\n?execute add(.*Map .*)$/ "\1"/p # print map
s/^.*$// # clear pattern space
N; /^\nexecute add.*Map /b next-map
# close the string
i\ ];
D # restart cycle from the current line
}
# detect presence of notable files
/^docfiles /{
s/^.*$// # ignore the first line
@@ -129,9 +145,36 @@ $a}
# 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;
# extract hyphenation patterns
/^execute\sAddHyphen\s/{
# open a list
i\ hyphenPatterns = [
# create one attribute set per hyphenation pattern
# plain keys: name, lefthyphenmin, righthyphenmin, file, file_patterns, file_exceptions, comment
# optionally double quoted key: luaspecial, comment
# comma-separated lists: databases, synonyms
:next-hyphen
s/(^|\n)execute\sAddHyphen/ {/
s/\s+luaspecial="([^"]+)"/\n luaspecial = "\1";/
s/\s+(name|lefthyphenmin|righthyphenmin|file|file_patterns|file_exceptions|luaspecial|comment)=([^ \t\n]*)/\n \1 = "\2";/g
s/\s+(databases|synonyms)=([^ \t\n]+)/\n \1 = [ "\2" ];/g
s/$/\n }/
:split-hyphens
s/"([^,]+),([^"]+)" ]/"\1" "\2" ]/;
t split-hyphens # repeat until there are no commas
p
s/^.*$// # clear pattern space
N
/^\nexecute\sAddHyphen\s/b next-hyphen
# close the list
i\ ];
D # restart cycle from the current line
}
# extract format details
/^execute\sAddFormat\s/{
File diff suppressed because it is too large Load Diff