gnu: r-minimal: Respect SOURCE_DATE_EPOCH in srcfile.
Fixes <https://bugs.gnu.org/30729>. * gnu/packages/statistics.scm (r-minimal)[arguments]: Replace timestamp hack with patch to "srcfile" and "srcfilecopy".
This commit is contained in:
parent
8e3b852ad0
commit
0fa4702c04
|
@ -172,21 +172,15 @@ be output in text, PostScript, PDF or HTML.")
|
||||||
;; queries the mtime of a given file and records it in an object.
|
;; queries the mtime of a given file and records it in an object.
|
||||||
;; This is acceptable at runtime to detect stale source files,
|
;; This is acceptable at runtime to detect stale source files,
|
||||||
;; but it destroys reproducibility at build time.
|
;; but it destroys reproducibility at build time.
|
||||||
;;
|
|
||||||
;; Instead of disabling this feature, which may have unexpected
|
;; Similarly, the "srcfilecopy" procedure records the current
|
||||||
;; consequences, we reset the mtime of generated files before
|
;; time. We change both of them to respect SOURCE_DATE_EPOCH.
|
||||||
;; passing them to the "srcfile" procedure.
|
(substitute* "src/library/base/R/srcfile.R"
|
||||||
(substitute* "src/library/Makefile.in"
|
(("timestamp <- (timestamp.*|file.mtime.*)" _ time)
|
||||||
(("@\\(cd base && \\$\\(MAKE\\) mkdesc\\)" line)
|
(string-append "timestamp <- \
|
||||||
(string-append line "\n find $(top_builddir)/library/tools | xargs touch -d '1970-01-01'; \n"))
|
as.POSIXct(if (\"\" != Sys.getenv(\"SOURCE_DATE_EPOCH\")) {\
|
||||||
(("@\\$\\(MAKE\\) Rdobjects" line)
|
as.numeric(Sys.getenv(\"SOURCE_DATE_EPOCH\"))\
|
||||||
(string-append "@find $(srcdir)/tools | xargs touch -d '1970-01-01'; \n "
|
} else { " time "}, origin=\"1970-01-01\")\n")))
|
||||||
line)))
|
|
||||||
(substitute* "src/library/tools/Makefile.in"
|
|
||||||
(("@\\$\\(INSTALL_DATA\\) all.R \\$\\(top_builddir\\)/library/\\$\\(pkg\\)/R/\\$\\(pkg\\)" line)
|
|
||||||
(string-append
|
|
||||||
line
|
|
||||||
"\n find $(srcdir)/$(pkg) $(top_builddir)/library/$(pkg) | xargs touch -d \"1970-01-01\"; \n")))
|
|
||||||
|
|
||||||
;; This library is installed using "install_package_description",
|
;; This library is installed using "install_package_description",
|
||||||
;; so we need to pass the "builtStamp" argument.
|
;; so we need to pass the "builtStamp" argument.
|
||||||
|
|
Loading…
Reference in New Issue