From 056910ec864cb7cf3225a0c27679d94405db7dcd Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sat, 7 Sep 2024 21:53:19 +0200 Subject: [PATCH] gnu: r-quantmod: Attempt to build reproducibly. * gnu/packages/cran.scm (r-quantmod)[arguments]: Add phase to avoid recording system time when SOURCE_DATE_EPOCH is set. Change-Id: I818ddf5f5bac7041c9a26624996b6b6a0256f3ea --- gnu/packages/cran.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm index 98ca4bf2dc..13b92bb6f1 100644 --- a/gnu/packages/cran.scm +++ b/gnu/packages/cran.scm @@ -12300,6 +12300,17 @@ (define-public r-quantmod (base32 "165vp2ygry8ibcpxjbyfvfrjbv98syln12kkyzci2ygp84r5sv1r")))) (build-system r-build-system) + (arguments + (list + #:phases + '(modify-phases %standard-phases + (add-after 'unpack 'build-reproducibly + (lambda _ + (substitute* "R/buildModel.R" + (("Sys.time\\(\\)") + "if (\"\" != Sys.getenv(\"SOURCE_DATE_EPOCH\")) {\ + as.numeric(Sys.getenv(\"SOURCE_DATE_EPOCH\"))\ +} else { Sys.time() }\n"))))))) (propagated-inputs (list r-curl r-jsonlite r-ttr r-xts r-zoo)) (home-page "https://cran.r-project.org/web/packages/quantmod/")