diff mbox series

[bug#56729,RFC,v3,20/32] gnu: gap: Build reproducibly.

Message ID 81c81c228c3c1df489194d3f5229c7dce6ed5e5f.1685391447.git.guix@ikherbers.com
State New
Headers show
Series None | expand

Commit Message

vicvbcun May 29, 2023, 8:38 p.m. UTC
* gnu/packages/algebra.scm (gap)[arguments]<#:phases> {'pin-build-time}
{'remove-logs}: New phases.
---

Notes:
    Some packages seem to include pdfs, LaTeX output; pdflatex missing

 gnu/packages/algebra.scm | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index c2d1c3ce1e..4d5483bf4d 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -1412,6 +1412,12 @@  (define-public gap
                   (guix build utils))
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'pin-build-time
+           ;; https://github.com/gap-system/gap/issues/5204
+           (lambda _
+             (substitute* "src/version.c.in"
+               (("@GAP_BUILD_DATETIME@")
+                "@GAP_RELEASEDAY@"))))
          (add-after 'build 'build-packages
            ;; Compile all packages that have not been deleted by the
            ;; code snippet above.
@@ -1428,7 +1434,14 @@  (define-public gap
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
                     (share (string-append out "/share/gap")))
-               (copy-recursively "pkg" (string-append share "/pkg"))))))))
+               (copy-recursively "pkg" (string-append share "/pkg")))))
+         ;; configure logs and LaTeX output that contains timestamps, uname
+         ;; output etc
+         (add-after 'install-packages 'remove-logs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (for-each
+              delete-file
+              (find-files (assoc-ref outputs "out") "\\.(out|log)$")))))))
     (home-page "https://www.gap-system.org/")
     (synopsis
      "System for computational group theory")