Skip to content

Commit

Permalink
texlive.tlpdb.nix: change hasRunfiles to default true and omit hashes…
Browse files Browse the repository at this point in the history
… if not required (NixOS#365219)
  • Loading branch information
veprbl authored Dec 23, 2024
2 parents ae6dd82 + 47d39de commit 9477b6c
Show file tree
Hide file tree
Showing 3 changed files with 4,308 additions and 8,749 deletions.
4 changes: 2 additions & 2 deletions pkgs/tools/typesetting/tex/texlive/build-texlive-package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
, version ? toString revision
, extraRevision ? ""
, extraVersion ? ""
, sha512
, sha512 ? { }
, mirrors
, fixedHashes ? { }
, postUnpack ? ""
Expand All @@ -48,7 +48,7 @@
, hasHyphens ? false
, hasInfo ? false
, hasManpages ? false
, hasRunfiles ? false
, hasRunfiles ? (sha512 ? run)
, hasTlpkg ? false
, hasCatalogue ? true
, catalogue ? pname
Expand Down
38 changes: 32 additions & 6 deletions pkgs/tools/typesetting/tex/texlive/tl2nix.sed
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ $a}
}

# extract hashes of *.tar.xz
s/^containerchecksum (.*)/ sha512.run = "\1";/p
/^containerchecksum (.*)/{
# save in holdspace, print later if hasRunfiles || hasTlpkg
s/^containerchecksum (.*)/ sha512.run = "\1";/
H
}
s/^doccontainerchecksum (.*)/ sha512.doc = "\1";/p
s/^srccontainerchecksum (.*)/ sha512.source = "\1";/p

Expand Down Expand Up @@ -152,8 +156,14 @@ $a}
t next-file # loop if previous line matched
s/\n/ \n/ # add space before last newline for accurate matching below

/ (RELOC|texmf-dist)\//i\ hasRunfiles = true;
/ tlpkg\//i\ hasTlpkg = true;
/ (RELOC|texmf-dist)\//{
# flag existence of runtime files in hold space
x ; s/$/\n hasRunfiles = true;/ ; x
}
/ tlpkg\//{
# flag existence of tlpkg files in hold space
x ; s/$/\n hasTlpkg = true;/ ; x
}

# extract script extensions
/ texmf-dist\/scripts\/.*\.(jar|lua|py|rb|sno|tcl|texlua|tlu) /{
Expand Down Expand Up @@ -247,10 +257,26 @@ $a}
x

# change hasCatalogue default from false to true
/(^|\n) hasCatalogue = true;(\n|$)/!{
s/$/\n hasCatalogue = false;/M
}
s/^ hasCatalogue = true;$//Mg
t had-catalogue
s/(\n?)$/\1 hasCatalogue = false;/
:had-catalogue

# change hasRunfiles default from false to (sha512 ? run)
/(^|\n) hasRunfiles = true;(\n|$)/!{
# if no runfiles nor tlpkg, omit sha512.run altogether
/^ hasTlpkg = true;$/M{
s/$/\n hasRunfiles = false;/M
}
/^ hasTlpkg = true;$/M!{
s/^ sha512.run = "[^"]*";$//M
}
}
s/^ hasRunfiles = true;$//Mg

# clear empty lines
s/(^\n*|\n*$)//g
s/\n\n+/\n/g

# print hold space if not empty
/./Mp
Expand Down
Loading

0 comments on commit 9477b6c

Please sign in to comment.