gnu: r-cli: Attempt to build reproducibly.

* gnu/packages/cran.scm (r-cli)[arguments]: Add phase to avoid embedding the
PID while building.

Change-Id: Ia119af44bc59a324d55ee750d3d6dd0dfb231b0c
This commit is contained in:
Ricardo Wurmus 2024-09-08 15:10:05 +02:00
parent 3048b6f204
commit 65c78c05a9
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -11163,6 +11163,19 @@ (define-public r-cli
(base32
"0ha8mijnzlz1cxsjk502j2gzspd8fnk3j79bvnqm871225ghi5a2"))))
(build-system r-build-system)
(arguments
(list
#:phases
'(modify-phases %standard-phases
;; Do not embed the PID of the build process.
(add-after 'unpack 'build-reproducibly
(lambda _
(setenv "GUIX_BUILD" "yes")
(substitute* '("R/onload.R" "R/app.R")
(("\\<- Sys\\.getpid\\(\\)")
(lambda _
(string-append
"<- if (Sys.getenv(\"GUIX_BUILD\") == \"\") { Sys.getpid() } else { 12345 }")))))))))
(home-page "https://github.com/r-lib/cli#readme")
(synopsis "Helpers for developing command line interfaces")
(description "This package provides a suite of tools designed to build