unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#28016] [PATCH] Reproducible issue for libjpeg-turbo
@ 2017-08-08  7:32 Z. Ren
  2017-08-16  4:02 ` Z. Ren
  0 siblings, 1 reply; 3+ messages in thread
From: Z. Ren @ 2017-08-08  7:32 UTC (permalink / raw)
  To: 28016

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]

Hi!
While conducting a study inspired by the "reproducible builds" practice [1], we have noticed that the package libjpeg-turbo could not be built reproducibly.

After investigation, we observe that the unreproducibility is caused by the "configure" script, in which the output of `date` is captured. 

The attached patch substitutes the `date` according to the SOUR_DATE_EPOCH.  Once applied, libjpeg-turbo could be built deterministically.

 [1]: https://wiki.debian.org/ReproducibleBuilds

[-- Attachment #2: 0001-reproducible-fix-for-libjpeg-turbo.patch --]
[-- Type: application/octet-stream, Size: 1402 bytes --]

From 17a33f6199d47cde1bd2f76849899fe5d39f763c Mon Sep 17 00:00:00 2001
From: Z. Ren <zren@dlut.edu.cn>
Date: Tue, 8 Aug 2017 14:05:25 +0800
Subject: [PATCH] reproducible fix for libjpeg-turbo

---
 gnu/packages/image.scm | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 63e3fa504..854a85ae2 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -1122,7 +1122,21 @@ PNG, and performs PNG integrity checks and corrections.")
     (native-inputs
      `(("nasm" ,nasm)))
     (arguments
-     '(#:test-target "test"))
+     '(#:test-target "test"
+       #:modules ((srfi srfi-19)
+                  (guix build utils)
+                  (guix build gnu-build-system))
+       #:phases
+       (modify-phases %standard-phases
+        (add-before 'configure 'reproducible
+         (lambda _
+          (let ((source-date-epoch
+           (time-utc->date
+            (make-time time-utc 0 (string->number
+             (getenv "SOURCE_DATE_EPOCH"))))))
+              (substitute* "configure"
+               (("`date .*`") (date->string source-date-epoch "'{~Y~m~d}'"))
+              )))))))
     (home-page "http://www.libjpeg-turbo.org/")
     (synopsis "SIMD-accelerated JPEG image handling library")
     (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-22 12:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-08  7:32 [bug#28016] [PATCH] Reproducible issue for libjpeg-turbo Z. Ren
2017-08-16  4:02 ` Z. Ren
2017-08-22 12:53   ` bug#28016: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).