Subject: [bug#57628] [PATCH 2/2] gnu: gnunet-scheme: Make scheme-gnunet.pdf reproducible.

From: Maxime Devos <[email-masked]>
Date: Tue, 6 Sep 2022 17:49:11 +0200

* gnu/packages/gnunet.scm
(gnunet-scheme)[arguments]<#:phases>{reproducible-timestamp}:
New phase.
---
 gnu/packages/gnunet.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gnu/packages/gnunet.scm b/gnu/packages/gnunet.scm
index cd97decd6f..1288d8d18c 100644
--- a/gnu/packages/gnunet.scm
+++ b/gnu/packages/gnunet.scm
@@ -33,6 +33,7 @@ (define-module (gnu packages gnunet)
   #:use-module (gnu packages file)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
@@ -363,6 +364,15 @@ (define-public gnunet-scheme
                (base32
                 "0kvqbqijfyp3fhsqjyzwd7b3cm5khwv557wq196mv6rx47aaivgd"))))
     (build-system gnu-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               ;; For reproducibility, do not insert real timestamps in the PDF.
+               (add-after 'unpack 'reproducible-timestamp
+                 (lambda _
+                   (substitute* "Makefile.am"
+                     (("\\$\\(TEXMACS_CONVERT\\)")
+                      "faketime -m -f '1970-01-01 00:00:00' $(TEXMACS_CONVERT)")))))))
     (inputs (list guile-3.0)) ;for pkg-config
     (propagated-inputs (list guile-bytestructures guile-gcrypt guile-pfds
                              guile-fibers-1.1))
@@ -373,6 +383,7 @@ (define-public gnunet-scheme
                          guile-gcrypt
                          guile-pfds
                          guile-fibers-1.1
+                         libfaketime
                          automake
                          autoconf
                          pkg-config
-- 
2.37.2