ngz pushed a commit to branch tex-team
in repository guix.
commit 0e0e2e6537a77ca7a71f78b76069b52e5d4e92be
Author: Nicolas Goaziou <[email protected]>
AuthorDate: Tue Feb 11 09:47:21 2025 +0100
gnu: Make modular TeX Live reproducible.
Fixes: https://issues.guix.gnu.org/73613
* gnu/packages/tex.scm (texlive-aleph):
(texlive-amstex):
(texlive-eplain):
(texlive-hitex):
(texlive-lollipop):
(texlive-mex):
(texlive-mltex):
(texlive-texsis):
(texlive-luatex):
(texlive-xmltex):
(texlive-latex-bin):
(texlive-cslatex):
(texlive-mptopdf):
(texlive-mflua):
(texlive-luajittex):
(texlive-csplain):
(texlive-luahbtex):
(texlive-jadetex):
(texlive-pdftex):
(texlive-optex):
(texlive-context-legacy):
(texlive-everyshi):
(texlive-xetex): Add libfaketime to native inputs.
* guix/build/texlive-build-system.scm (enforce-source-date-epoch): New
function.
(create-formats): Wrap format generation within a `faketime' call.
(%standard-phases): Add a phase to obey to SOURCE_DATE_EPOCH.
Change-Id: Ieef6adb18b7f4373194e3550d41761f75334e574
---
gnu/packages/tex.scm | 72 ++++++++++++++++++++++++++++++++-----
guix/build/texlive-build-system.scm | 20 +++++++++--
2 files changed, 81 insertions(+), 11 deletions(-)
diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 7055e4bea4..cd4276f2a8 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -69,6 +69,7 @@
#:use-module (gnu packages autotools)
#:use-module (gnu packages bash)
#:use-module (gnu packages boost)
+ #:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages cpp)
#:use-module (gnu packages digest)
@@ -2438,8 +2439,10 @@ number styles are available.")
(base32
"096p2kcfmdvf09xpijwsrhkhmaggvd04jxrs2abag45wsrj75h0s"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments (list #:create-formats #~(list "aleph")))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-aleph-bin
texlive-cm
@@ -3060,6 +3063,7 @@ create a bibliography.")
(base32
"19wmfij3g3kaqnhypczpda7i2c3nhin1h6fjwjb5raimr9g5qyql"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list #:create-formats #~(list "amstex")
@@ -3072,6 +3076,7 @@ create a bibliography.")
(mkdir-p bin)
(with-directory-excursion bin
(symlink pdftex "amstex"))))))))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-amsfonts
texlive-cm
@@ -15732,6 +15737,7 @@ Cosmetica font, which is a similar design to Optima and
includes Greek.")
(base32
"00nmqhfckrf8ygw6i93d5xnf85i8a88ryadb5ml73w4rllwjxr72"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list #:create-formats #~(list "eplain")
@@ -15744,6 +15750,7 @@ Cosmetica font, which is a similar design to Optima and
includes Greek.")
(mkdir-p bin)
(with-directory-excursion bin
(symlink pdftex "eplain"))))))))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-babel
texlive-cm
@@ -20475,8 +20482,10 @@ Indian Type Foundry, with support for LaTeX and
pdfLaTeX.")
(base32
"1wim25zd8wmqc2g8l9lk2gwwq51fwmj46hj8bmzbzy1a455ih0zq"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments (list #:create-formats #~(list "hilatex" "hitex")))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-babel
texlive-cm
@@ -24716,6 +24725,7 @@ symbol variants more suited to work in logic.")
(base32
"0xdldlnhsr2n8544j9vd6gllin8bfkpcbhlpmxlhrvjl5bdg0rjp"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list #:create-formats #~(list "lollipop")
@@ -24728,6 +24738,7 @@ symbol variants more suited to work in logic.")
(mkdir-p bin)
(with-directory-excursion bin
(symlink tex "lollipop"))))))))
+ (native-inputs (list libfaketime))
(propagated-inputs (list texlive-cm texlive-hyphen-base texlive-tex))
(home-page "https://ctan.org/pkg/lollipop")
(synopsis "TeX made easy")
@@ -26757,6 +26768,7 @@ with symbols, giving automatic alignment.")
(base32
"0kc766cvvbcqrj60ncz4a105nrn454y5c2330y7s7jzh45dx8qsi"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list #:create-formats #~(list "mex" "pdfmex" "utf8mex")
@@ -26771,6 +26783,7 @@ with symbols, giving automatic alignment.")
(symlink pdftex "mex")
(symlink pdftex "pdfmex")
(symlink pdftex "utf8mex"))))))))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-enctex
texlive-hyphen-complete
@@ -27139,6 +27152,7 @@ avoids the spindliness of most other Type 1 versions of
Computer Modern.")
(base32
"1ip0q5kqj6bg4jkginzljknbrd74ss4iky2gvlmf8nnrq06n89my"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list #:create-formats #~(list "mllatex" "mltex")
@@ -27152,6 +27166,7 @@ avoids the spindliness of most other Type 1 versions of
Computer Modern.")
(with-directory-excursion bin
(symlink pdftex "mllatex")
(symlink pdftex "mltex"))))))))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-babel
texlive-cm
@@ -36489,6 +36504,7 @@ produces.")
(base32
"1vdywyg03ab5w50370ml8hwiidim2sy7hhygmz917rnhsnm87lnv"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list #:create-formats #~(list "texsis")
@@ -36501,6 +36517,7 @@ produces.")
(mkdir-p bin)
(with-directory-excursion bin
(symlink pdftex "texsis"))))))))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-cm
texlive-hyphen-base
@@ -45074,6 +45091,7 @@ LaTeX packages use of @samp{@@@@}) in nested package
files.")
(base32
"0kdmnlbg5jh9ym3iasbpp5al7ljhn8fiirw6y5g4k5x3v9f3bmm8"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list #:create-formats #~(list "platex" "platex-dev")
@@ -45094,6 +45112,7 @@ LaTeX packages use of @samp{@@@@}) in nested package
files.")
(mkdir-p bin)
(with-directory-excursion bin
(symlink euptex "platex"))))))))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-babel
texlive-cm
@@ -45355,8 +45374,10 @@ their specific needs.")
(base32
"0aqan2g9cp5nv0hh1i6d6wcsp19f8zdlrij7wi3xs0hf5kwl2ql9"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments (list #:create-formats #~(list "eptex" "ptex")))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-cm
texlive-etex
@@ -46210,10 +46231,12 @@ of the fonts used in printers shops in Lispia.")
(base32
"05jj1pyfipz1qmdxkavz7axflgga6bpl20abzc6j3sj8xxz7g9j8"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list #:texlive-latex-bin? #f
#:create-formats #~(list "tex")))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-cm
texlive-hyphen-base
@@ -46460,6 +46483,7 @@ barcodes.")
(base32
"0fn5x56nn38k9b90mcyvfwla7ib7nv774z2cjncwwmbsd7s1abm1"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list #:create-formats #~(list "uplatex" "uplatex-dev")
@@ -46480,6 +46504,7 @@ barcodes.")
(mkdir-p bin)
(with-directory-excursion bin
(symlink euptex "uplatex"))))))))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-babel
texlive-cm
@@ -46548,8 +46573,10 @@ and e-upTeX.")
(base32
"14hn2n6jbibbqbdr72j74z5bz003jnlabi3kja0f0waxhas680gd"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments (list #:create-formats #~(list "euptex" "uptex")))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-cm
texlive-etex
@@ -48508,12 +48535,14 @@ environments and another with all extracted
environments converted to
(base32
"0ky6maprb0xnzb38bz9bd28q54pa32015wjczc2zfbqibyxrmv9s"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list #:create-formats
#~(and (not #$(or (target-ppc64le?)
(target-riscv64?)))
(list "luajithbtex" "luajittex"))))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-cm
texlive-etex
@@ -48628,8 +48657,10 @@ clearly show any mismatches.")
(sha256
(base32
"0ngbhdh8hgpjfqnrjlnp27x3qziks3yf2zp1qq7r4bjfa5jx9gr6"))))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments (list #:create-formats #~(list "mflua")))
+ (native-inputs (list libfaketime))
(propagated-inputs (list texlive-luatex texlive-metafont
texlive-mflua-bin))
(home-page "https://ctan.org/pkg/mflua")
(synopsis "Configuration and base files for MFLua")
@@ -49686,6 +49717,7 @@ information in the TFM file.")
(base32
"03782qwjz0fnr8l0h8rc8hj32wxaz8zc8v20l94lrkhmc3d40j6z"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list
@@ -49698,6 +49730,7 @@ information in the TFM file.")
(let ((perl (search-input-file inputs "/bin/perl")))
(substitute* "scripts/context/perl/mptopdf.pl"
(("exec perl") (string-append "exec " perl)))))))))
+ (native-inputs (list libfaketime))
(inputs (list perl))
(propagated-inputs (list texlive-pdftex texlive-plain))
(home-page "https://ctan.org/pkg/mptopdf")
@@ -50289,6 +50322,7 @@ see the structure of a document by looking at the
source file of the manual.")
(sha256
(base32
"1dddk20v3acc3pb3wkg58y2y6z6fkx0ifsi03fffm0903z1h2zhm"))))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list
@@ -50303,6 +50337,7 @@ see the structure of a document by looking at the
source file of the manual.")
(substitute* "source/cslatex/base/cslatex.ins"
(("\\keepsilent\n" all)
(string-append all "\\askforoverwritefalse\n"))))))))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-atbegshi
texlive-atveryend
@@ -58183,6 +58218,7 @@ formats.")
(base32
"1f73x92hwybkq6gqhps6gnsy8rs12zwxbfnp226d0bm6b2ji31z6"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list
@@ -58204,6 +58240,7 @@ formats.")
(symlink pdftex "latex")
(symlink luahbtex "lualatex")
(symlink pdftex "pdflatex"))))))))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-babel
texlive-cm
@@ -59175,6 +59212,7 @@ and @code{pdfxmltex}.")
(base32
"1rqwsapba8zs2ijjs7lpzksm20jqb8zbmanpw7wmdp2rq26ahylh"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list
@@ -59187,6 +59225,7 @@ and @code{pdfxmltex}.")
(mkdir-p (string-append #$output "/bin"))
(symlink pdftex (string-append #$output "/bin/xmltex"))
(symlink pdftex (string-append #$output
"/bin/pdfxmltex"))))))))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-babel
texlive-cm
@@ -60625,7 +60664,8 @@ in the same way as BSD/GNU @code{getopt_long(3)}
functions do.")
(base32
"1jcqymq0a2yyn7smbwl0inc6q7ly4x7hraq8wbx3r5qr9q63hlpg"))))
(outputs '("out" "doc"))
- (properties '((updater-extra-native-inputs "texlive-kpathsea")))
+ (properties '((updater-extra-native-inputs "libfaketime"
+ "texlive-kpathsea")))
(build-system texlive-build-system)
(arguments
(list
@@ -60643,7 +60683,7 @@ in the same way as BSD/GNU @code{getopt_long(3)}
functions do.")
"TEXMFSYSCONFIG = \"$TEXMFDIST/../texmf-config\",\n")
(("TEXMF *=.*")
"TEXMF =
\"{$TEXMFCONFIG,$TEXMFVAR,$TEXMFHOME,$TEXMFSYSCONFIG,$TEXMFSYSVAR,$TEXMFDIST}\",\n")))))))
- (native-inputs (list texlive-kpathsea))
+ (native-inputs (list libfaketime texlive-kpathsea))
(propagated-inputs
(list texlive-cm
texlive-etex
@@ -60762,12 +60802,13 @@ Either of the Plain and LaTeX2e formats may be used
with the package.")
"0y47q58jggwzy5hk9n2arh0g4a92pqcavadzxa38lpadf16zxbck"))))
(outputs '("out" "doc"))
(build-system texlive-build-system)
- (properties '((updater-extra-native-inputs "texlive-kpathsea")))
+ (properties '((updater-extra-native-inputs "libfaketime"
+ "texlive-kpathsea")))
(arguments
(list
#:texlive-latex-bin? #f
#:create-formats #~(list "luahbtex")))
- (native-inputs (list texlive-kpathsea))
+ (native-inputs (list libfaketime texlive-kpathsea))
(propagated-inputs
(list texlive-cm
texlive-etex
@@ -61509,7 +61550,8 @@ available.")
(sha256
(base32
"14z479gkiwgw17pdghrxh5q0rlxnij7ccj49kgf3macwgmh5lm0r"))))
- (properties '((updater-extra-native-inputs "texlive-xetex")))
+ (properties '((updater-extra-native-inputs "libfaketime"
+ "texlive-xetex")))
(build-system texlive-build-system)
(arguments
(list #:create-formats #~(list "csplain" "luacsplain" "pdfcsplain")
@@ -61525,7 +61567,7 @@ available.")
(symlink pdftex "csplain")
(symlink pdftex "pdfcsplain")
(symlink luatex "luacsplain"))))))))
- (native-inputs (list texlive-xetex))
+ (native-inputs (list libfaketime texlive-xetex))
(propagated-inputs
(list texlive-cm
texlive-cs
@@ -70363,6 +70405,7 @@ of ink traps which typify the Kurier font.")
(base32
"0acan496ixymwjvygcd5rx5pmz4p5vffzkmazdryw1kpilhiixcx"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list
@@ -70377,6 +70420,7 @@ of ink traps which typify the Kurier font.")
(with-directory-excursion bin
(symlink pdftex "jadetex")
(symlink pdftex "pdfjadetex"))))))))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-amsfonts
texlive-auxhook
@@ -71276,7 +71320,8 @@ e-TeX.")
(base32
"03l4qmlx3ax9dfgbp6266l2hfxgra53n5an5hbdai4a0x1k2d1pm"))))
(outputs '("out" "doc"))
- (properties '((updater-extra-inputs "ghostscript")))
+ (properties '((updater-extra-native-inputs "libfaketime")
+ (updater-extra-inputs "ghostscript")))
(build-system texlive-build-system)
(arguments
(list #:texlive-latex-bin? #f
@@ -71297,6 +71342,7 @@ e-TeX.")
(string-append prefix
#$(this-package-input "ghostscript")
"/bin\"\n"))))))))
+ (native-inputs (list libfaketime))
(inputs (list ghostscript))
(propagated-inputs
(list texlive-cm
@@ -71817,6 +71863,7 @@ and back-ends. It also ensures compatibility with the
@code{media9} and
(base32
"1px8hihdhnv7364qhysk78i56kwccfdwzrkmvfxhz0jm1f0zqbd1"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list #:create-formats #~(list "optex")
@@ -71829,6 +71876,7 @@ and back-ends. It also ensures compatibility with the
@code{media9} and
(mkdir-p bin)
(with-directory-excursion bin
(symlink luatex "optex"))))))))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-amsfonts
texlive-cm
@@ -73588,11 +73636,13 @@ to make the correct sequence of sections of a book
block visible.")
(sha256
(base32 "15wfyb8s3n7l7692k5ny4w0im6paicaypyjfpzm4k5yhi0jxfgqw"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list
#:link-scripts #~(list "texexec.rb" "texmfstart.rb")
#:create-formats #~(list "cont-en")))
+ (native-inputs (list libfaketime))
(inputs (list ruby))
(propagated-inputs (list texlive-context texlive-metapost texlive-mptopdf
texlive-pdftex texlive-xetex))
@@ -89794,7 +89844,8 @@ compatibility reasons.")
(base32
"11y6xazv1nk0m2hzsainjr8ijn5cff04xfccm6a65hzg7ipggraj"))))
(outputs '("out" "doc"))
- (properties '((updater-extra-native-inputs "texlive-firstaid"
+ (properties '((updater-extra-native-inputs "libfaketime"
+ "texlive-firstaid"
"texlive-l3kernel"
"texlive-l3packages"
"texlive-latex"
@@ -89831,7 +89882,8 @@ compatibility reasons.")
(lambda _
(delete-file-recursively "web2c"))))))
(native-inputs
- (list texlive-firstaid
+ (list libfaketime
+ texlive-firstaid
texlive-l3kernel
texlive-l3packages
texlive-latex
@@ -90529,10 +90581,12 @@ that it will build with web2c out of the box.")
(base32
"18idq0h7s692vkmnk4gnfnmwg6jy003d4gpi2d19xwfafx5aii08"))))
(outputs '("out" "doc"))
+ (properties '((updater-extra-native-inputs "libfaketime")))
(build-system texlive-build-system)
(arguments
(list #:link-scripts #~(list "xelatex-unsafe.sh" "xetex-unsafe.sh")
#:create-formats #~(list "xelatex" "xetex")))
+ (native-inputs (list libfaketime))
(propagated-inputs
(list texlive-babel
texlive-cm
diff --git a/guix/build/texlive-build-system.scm
b/guix/build/texlive-build-system.scm
index 90936c178d..87f08d4ec6 100644
--- a/guix/build/texlive-build-system.scm
+++ b/guix/build/texlive-build-system.scm
@@ -91,6 +91,15 @@ runfile to replace. If a file has no matching runfile, it
is ignored."
((command-regexp _ command)
(which command))))))
+(define* (enforce-source-date-epoch #:rest _)
+ "Toggle FORCE_SOURCE_DATE in order to make some Web2C binaries obey to
+SOURCE_DATE_EPOCH.
+
+This is only a part of the solution to make TeX Live reproducible as format
+generation also needs to be wrapped within a `faketime' call in the
+`create-formats' phase."
+ (setenv "FORCE_SOURCE_DATE" "1"))
+
(define* (configure-texmf #:rest _)
"Ensure TEXMFVAR is writable and \"ls-R\" database is not required."
;; Default TEXMFVAR value is relative to $HOME, which is not set during
@@ -176,7 +185,8 @@ runfile to replace. If a file has no matching runfile, it
is ignored."
(install-as-runfiles "build" "\\.tfm$"))
local-sources)))
-(define* (create-formats #:key create-formats inputs #:allow-other-keys)
+(define* (create-formats
+ #:key create-formats native-inputs inputs #:allow-other-keys)
(define (collect-locations inputs pred)
(delete-duplicates
(append-map (match-lambda
@@ -194,7 +204,12 @@ runfile to replace. If a file has no matching runfile, it
is ignored."
(setenv "LUAINPUTS"
(string-join (collect-locations inputs "\\.lua$") ":"))
(mkdir-p "web2c")
- (for-each (cut invoke "fmtutil-sys" "--byfmt" <> "--fmtdir=web2c")
+ ;; The ".fmt" format files contain timestamps. Reset them.
+ (unless (assoc-ref (or native-inputs inputs) "libfaketime")
+ (error "Missing 'libfaketime' native input"))
+ (for-each (cut invoke
+ "faketime" "1970-01-01T00:00:00+00:00"
+ "fmtutil-sys" "--byfmt" <> "--fmtdir=web2c")
create-formats)
;; Remove cruft.
(for-each delete-file (find-files "web2c" "\\.log$"))))
@@ -302,6 +317,7 @@ runfile to replace. If a file has no matching runfile, it
is ignored."
(delete 'bootstrap)
(delete 'configure)
(add-after 'unpack 'patch-shell-scripts patch-shell-scripts)
+ (add-before 'build 'enforce-source-date-epoch enforce-source-date-epoch)
(add-before 'build 'configure-texmf configure-texmf)
(add-before 'build 'delete-drv-files delete-drv-files)
(add-after 'delete-drv-files 'generate-font-metrics generate-font-metrics)