Source: ncurses
Version: 5.9+20140913-1
Severity: wishlist
Tags: patch
Usertags: timestamps


While working on the “reproducible builds” effort [1], we have noticed
that ncurses could not be built reproducibly.

The attached patch will add calls to strip-nondeterminism on static
libraries. Once applied, the package can be built reproducibly with our
current experimental framework.

I've initially tried to run `ar` in deterministic mode by passing
ARFLAGS="Dcrv". Unfortunately, `ranlib` is called after `ar` and there
doesn't seem to be a way to pass the `-D` flag to it, and so it will
write a timestamp in the newly created index.


Lunar                                .''`.                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
From 914efd4f2ca07ada794bc70e6ecc8eb39725303c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= <>
Date: Sat, 3 Jan 2015 13:54:20 +0100
Subject: [PATCH] Call strip-nondeterminism on static libraries

Static libraries will unfortunately contain timestamps, preventing the
package to be built reproducibly. strip-nondeterminism will take care
of normalizing the libraries.

Passing 'Dcvr' as ARFLAGS to configure is unfortunately not enough.
The build process also calls ranlib, and there doesn't seem to be
a way to give it the '-D' flag.
 debian/control | 1 +
 debian/rules   | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/debian/control b/debian/control
index 5c32f76..2cbbd67 100644
--- a/debian/control
+++ b/debian/control
@@ -9,6 +9,7 @@ Build-Depends: debhelper (>= 8.1.3),
                libgpm-dev [linux-any],
+               strip-nondeterminism,
 Standards-Version: 3.9.5
 Vcs-Git: git://
diff --git a/debian/rules b/debian/rules
index 1c0bc1a..924e7dd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -344,6 +344,11 @@ install: build
+	find $(objdir) $(objdir-static) $(objdir-32) $(objdir-64) \
+		$(wobjdir) $(wobjdir-static) $(wobjdir-32) \
+		$(objdir-debug) $(wobjdir-debug) -type f -name '*.a' -print0 | \
+		xargs -0r strip-nondeterminism --type ar
 	# Static debug libraries need _g suffix to avoid file clashes
 	set -e; \
 	for lib in $(objdir-debug)/lib/*.a; do \

Attachment: signature.asc
Description: Digital signature

Reproducible-builds mailing list

Reply via email to