mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-11 16:23:26 +00:00
texlive: use looping in tl2nix (#216066)
This commit is contained in:
parent
c88d7615bc
commit
641fb6ab84
@ -2,37 +2,47 @@
|
|||||||
1itl: { # no indentation
|
1itl: { # no indentation
|
||||||
$a}
|
$a}
|
||||||
|
|
||||||
# trash packages we don't want
|
|
||||||
/^name .*\./,/^$/d
|
|
||||||
|
|
||||||
# quote package names, as some start with a number :-/
|
|
||||||
s/^name (.*)/name "\1"/
|
|
||||||
|
|
||||||
# extract revision
|
|
||||||
s/^revision ([0-9]*)$/ revision = \1;/p
|
|
||||||
|
|
||||||
# form an attrmap per package
|
# form an attrmap per package
|
||||||
/^name /s/^name (.*)/\1 = {/p
|
# ignore packages whose name contains "." (such as binaries)
|
||||||
/^$/,1i};
|
/^name ([^.]+)$/,/^$/{
|
||||||
|
# quote package names, as some start with a number :-/
|
||||||
|
s/^name (.*)$/"\1" = {/p
|
||||||
|
/^$/,1i};
|
||||||
|
|
||||||
# extract hashes of *.tar.xz
|
# extract revision
|
||||||
s/^containerchecksum (.*)/ sha512.run = "\1";/p
|
s/^revision ([0-9]*)$/ revision = \1;/p
|
||||||
s/^doccontainerchecksum (.*)/ sha512.doc = "\1";/p
|
|
||||||
s/^srccontainerchecksum (.*)/ sha512.source = "\1";/p
|
|
||||||
/^runfiles /i\ hasRunfiles = true;
|
|
||||||
|
|
||||||
# number of path components to strip, defaulting to 1 ("texmf-dist/")
|
# extract hashes of *.tar.xz
|
||||||
/^relocated 1/i\ stripPrefix = 0;
|
s/^containerchecksum (.*)/ sha512.run = "\1";/p
|
||||||
|
s/^doccontainerchecksum (.*)/ sha512.doc = "\1";/p
|
||||||
|
s/^srccontainerchecksum (.*)/ sha512.source = "\1";/p
|
||||||
|
/^runfiles /i\ hasRunfiles = true;
|
||||||
|
|
||||||
# extract version and clean unwanted chars from it
|
# number of path components to strip, defaulting to 1 ("texmf-dist/")
|
||||||
/^catalogue-version/y/ \/~/_--/
|
/^relocated 1/i\ stripPrefix = 0;
|
||||||
/^catalogue-version/s/[\#,:\(\)]//g
|
|
||||||
s/^catalogue-version_(.*)/ version = "\1";/p
|
|
||||||
|
|
||||||
# extract deps
|
# extract version and clean unwanted chars from it
|
||||||
s/^depend ([^.]*)$/ deps."\1" = tl."\1";/p
|
/^catalogue-version/y/ \/~/_--/
|
||||||
|
/^catalogue-version/s/[\#,:\(\)]//g
|
||||||
|
s/^catalogue-version_(.*)/ version = "\1";/p
|
||||||
|
|
||||||
# extract hyphenation patterns and formats
|
# extract deps
|
||||||
# (this may create duplicate lines, use uniq to remove them)
|
/^depend [^.]+$/{
|
||||||
/^execute\sAddHyphen/i\ hasHyphens = true;
|
s/^depend (.+)$/ deps."\1" = tl."\1";/
|
||||||
/^execute\sAddFormat/i\ hasFormats = true;
|
|
||||||
|
# loop through following depend lines
|
||||||
|
:next
|
||||||
|
h ; N # save & read next line
|
||||||
|
s/\ndepend (.+)\.(.+)$//
|
||||||
|
s/\ndepend (.+)$/\n deps."\1" = tl."\1";/
|
||||||
|
t next # loop if the previous lines matched
|
||||||
|
|
||||||
|
x; p; x # print saved deps
|
||||||
|
s/^.*\n// # remove deps, resume processing
|
||||||
|
}
|
||||||
|
|
||||||
|
# extract hyphenation patterns and formats
|
||||||
|
# (this may create duplicate lines, use uniq to remove them)
|
||||||
|
/^execute\sAddHyphen/i\ hasHyphens = true;
|
||||||
|
/^execute\sAddFormat/i\ hasFormats = true;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user